|
|
@ -1,7 +1,8 @@
|
|
|
|
import { Board } from "../../src/DatabaseServices/Entity/Board";
|
|
|
|
import { Board } from "../../src/DatabaseServices/Entity/Board";
|
|
|
|
import { Curve } from "../../src/DatabaseServices/Entity/Curve";
|
|
|
|
import { Curve } from "../../src/DatabaseServices/Entity/Curve";
|
|
|
|
import { Polyline } from "../../src/DatabaseServices/Entity/Polyline";
|
|
|
|
import { Polyline } from "../../src/DatabaseServices/Entity/Polyline";
|
|
|
|
import { CalcEdgeSealing, GetSealedBoardContour, ParagraphCulist } from "../../src/GraphicsSystem/CalcEdgeSealing";
|
|
|
|
import { CalcEdgeSealing, GetBoardSealingData, GetSealedBoardContour, ParagraphCulist } from "../../src/GraphicsSystem/CalcEdgeSealing";
|
|
|
|
|
|
|
|
import { ConverToPtsBul } from "../../src/Production/Convert2PtsBul";
|
|
|
|
import "../Utils/jest.util";
|
|
|
|
import "../Utils/jest.util";
|
|
|
|
import { LoadBoardsFromFileData } from "../Utils/LoadEntity.util";
|
|
|
|
import { LoadBoardsFromFileData } from "../Utils/LoadEntity.util";
|
|
|
|
|
|
|
|
|
|
|
@ -138,7 +139,8 @@ test("封边错误板件", () =>
|
|
|
|
});
|
|
|
|
});
|
|
|
|
test("封边错误板件2", () =>
|
|
|
|
test("封边错误板件2", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = { "file": [1, "Board", 8, 2, 321, false, 1, 3, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 8511.883548299666, -144.54126186296344, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 8536.883548299666, -144.54126186296344, 0, 1], 0, 3, 400.2476503569924, 2300, 25, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 406.2643066383516, 310.58952284495217, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, -9115.641761047009, -1933.6524071638414, 0, 1], 0, 2, 16, [-67.06912303135869, 78.84805159804773], 0, [0, 0], 0.2202439982667024, [22.874295099078154, -10.58952284995803], 0, [742.3473665786241, -10.589522844952171], 0.22024399852882928, [765.2216616957576, 5.275069270282984e-9], 0, [832.5014391616369, 79.0957019560442], -0.21993334211278368, [855.3527126344816, 89.6581275100466], 0, [1318.9838435386573, 89.65812751204021], -0.21993334237487636, [1341.8351170292226, 79.09570194591333], 0, [1409.1148944956167, 1.0472831490915269e-9], 0.18676524414106982, [1428.1424129374664, -10.341872493370829], 0, [1893.7356933616484, -10.34187248795979], 0, [1893.7356933616484, -310.58952284495217], 0, [-406.2643066383516, -310.58952284495217], 0, [-406.2643066383516, 89.41047715504783], 0, [-89.92039651338382, 89.41047715504783], -0.21993334237487636, true, 1, 3, 80.00000000199361, 243.63113088517912, 25, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 203.6311308697916, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, -10487.258780340819, -2173.90005751884, 0, 1], 0, 2, 4, [-163.63113088158752, 1.9936123862862587e-9], 0, [0, 0], 1.0000000002948966, [7.183189154602587e-9, 80], 0, [-163.63113088158752, 80.00000000199361], 0.9999999997051033, true, 0, 3, 0, 0, 0, 0, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 9883.500567593475, -144.54126186296344, 240.24765035499877, 1], 3, 0, 0, 0, 0, 0, 9, 2, "背板", "小孩房", "小孩房床", "25进口暖白无光麻LZ9202", "多层板", "进口暖白无光麻LZ9202", 1, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 16, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", false, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": 8511.883548299666, "y": -169.54126186296344, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
let data =
|
|
|
|
|
|
|
|
{ "file": [1, "Board", 8, 2, 321, false, 1, 3, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 8511.883548299666, -144.54126186296344, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 8536.883548299666, -144.54126186296344, 0, 1], 0, 3, 400.2476503569924, 2300, 25, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 406.2643066383516, 310.58952284495217, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, -9115.641761047009, -1933.6524071638414, 0, 1], 0, 2, 16, [-67.06912303135869, 78.84805159804773], 0, [0, 0], 0.2202439982667024, [22.874295099078154, -10.58952284995803], 0, [742.3473665786241, -10.589522844952171], 0.22024399852882928, [765.2216616957576, 5.275069270282984e-9], 0, [832.5014391616369, 79.0957019560442], -0.21993334211278368, [855.3527126344816, 89.6581275100466], 0, [1318.9838435386573, 89.65812751204021], -0.21993334237487636, [1341.8351170292226, 79.09570194591333], 0, [1409.1148944956167, 1.0472831490915269e-9], 0.18676524414106982, [1428.1424129374664, -10.341872493370829], 0, [1893.7356933616484, -10.34187248795979], 0, [1893.7356933616484, -310.58952284495217], 0, [-406.2643066383516, -310.58952284495217], 0, [-406.2643066383516, 89.41047715504783], 0, [-89.92039651338382, 89.41047715504783], -0.21993334237487636, true, 1, 3, 80.00000000199361, 243.63113088517912, 25, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 203.6311308697916, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, -10487.258780340819, -2173.90005751884, 0, 1], 0, 2, 4, [-163.63113088158752, 1.9936123862862587e-9], 0, [0, 0], 1.0000000002948966, [7.183189154602587e-9, 80], 0, [-163.63113088158752, 80.00000000199361], 0.9999999997051033, true, 0, 3, 0, 0, 0, 0, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 9883.500567593475, -144.54126186296344, 240.24765035499877, 1], 3, 0, 0, 0, 0, 0, 9, 2, "背板", "小孩房", "小孩房床", "25进口暖白无光麻LZ9202", "多层板", "进口暖白无光麻LZ9202", 1, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 16, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", false, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": 8511.883548299666, "y": -169.54126186296344, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
let br = LoadBoardsFromFileData(data)[0];
|
|
|
|
let br = LoadBoardsFromFileData(data)[0];
|
|
|
|
|
|
|
|
|
|
|
|
let con = GetSealedBoardContour(br, false);
|
|
|
|
let con = GetSealedBoardContour(br, false);
|
|
|
@ -148,7 +150,8 @@ test("封边错误板件2", () =>
|
|
|
|
});
|
|
|
|
});
|
|
|
|
test("封边错误板件3", () =>
|
|
|
|
test("封边错误板件3", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = { "file": [1, "Board", 8, 2, 100, false, 1, 3, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 668.6547958775191, 360.34483792621177, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 668.6547958775191, 360.34483792621177, 0, 1], 0, 3, 430.00000000003945, 843.0000701800069, 18, true, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 429.99984841118567, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 6, [843, -429.99984841118567], 0, [843.0000701800067, 0.00015158885375399223], 0, [843.0000701800069, 0.00015158885375399223], 0, [843.0000000000002, 0.00015158881433308125], 0, [0, 0], 0, [0, -429.99984841118567], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 2, "背板", "", "父母房-衣柜", "兔宝宝洛萨暮影(杉木芯)", "兔宝宝洛萨暮影(杉木芯)", "兔宝宝洛萨暮影(杉木芯)", 0, 1, "三合一", 2, 5, 1, 1, 1, 1, 1, "1", "1", "1", "1", "", "", "", 6, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", false, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": 668.6547958775191, "y": 342.34483792621177, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
let data =
|
|
|
|
|
|
|
|
{ "file": [1, "Board", 8, 2, 100, false, 1, 3, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 668.6547958775191, 360.34483792621177, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 668.6547958775191, 360.34483792621177, 0, 1], 0, 3, 430.00000000003945, 843.0000701800069, 18, true, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 429.99984841118567, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 6, [843, -429.99984841118567], 0, [843.0000701800067, 0.00015158885375399223], 0, [843.0000701800069, 0.00015158885375399223], 0, [843.0000000000002, 0.00015158881433308125], 0, [0, 0], 0, [0, -429.99984841118567], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 2, "背板", "", "父母房-衣柜", "兔宝宝洛萨暮影(杉木芯)", "兔宝宝洛萨暮影(杉木芯)", "兔宝宝洛萨暮影(杉木芯)", 0, 1, "三合一", 2, 5, 1, 1, 1, 1, 1, "1", "1", "1", "1", "", "", "", 6, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", false, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": 668.6547958775191, "y": 342.34483792621177, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
let br = LoadBoardsFromFileData(data)[0];
|
|
|
|
let br = LoadBoardsFromFileData(data)[0];
|
|
|
|
|
|
|
|
|
|
|
|
let con = GetSealedBoardContour(br, false);
|
|
|
|
let con = GetSealedBoardContour(br, false);
|
|
|
@ -158,7 +161,8 @@ test("封边错误板件3", () =>
|
|
|
|
});
|
|
|
|
});
|
|
|
|
test("封边错误板件4", () =>
|
|
|
|
test("封边错误板件4", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = { "file": [1, "Board", 8, 2, 104, false, 1, 4, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1791.2350208071002, 332.28157054709305, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1791.221632944289, 332.28157054709305, -1220.5383064692724, 1], 0, 3, 608.4984929746847, 54, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 5, [0, 0], 0, [53.986612137188786, 0], 0, [54, 0.8772342627713384], 0, [53.99999999999998, 578.4441943321467], 0, [0, 608.4984929746847], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 2, "左收口条", "主卧", "下柜左收口", "多层板", "多层板", "无语枫木", 0, 0, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 5, "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": 1791.2350208071002, "y": 314.28157054709305, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
let data =
|
|
|
|
|
|
|
|
{ "file": [1, "Board", 8, 2, 104, false, 1, 4, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1791.2350208071002, 332.28157054709305, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1791.221632944289, 332.28157054709305, -1220.5383064692724, 1], 0, 3, 608.4984929746847, 54, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 5, [0, 0], 0, [53.986612137188786, 0], 0, [54, 0.8772342627713384], 0, [53.99999999999998, 578.4441943321467], 0, [0, 608.4984929746847], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 2, "左收口条", "主卧", "下柜左收口", "多层板", "多层板", "无语枫木", 0, 0, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 5, "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": 1791.2350208071002, "y": 314.28157054709305, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
let br = LoadBoardsFromFileData(data)[0];
|
|
|
|
let br = LoadBoardsFromFileData(data)[0];
|
|
|
|
|
|
|
|
|
|
|
|
let con = GetSealedBoardContour(br, false);
|
|
|
|
let con = GetSealedBoardContour(br, false);
|
|
|
@ -185,7 +189,8 @@ test("切割残留一个封边厚度的凸角的板件封边", () =>
|
|
|
|
});
|
|
|
|
});
|
|
|
|
test("切割残留2个封边厚度的凸角的板件封边", () =>
|
|
|
|
test("切割残留2个封边厚度的凸角的板件封边", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = { "file": [1, "Board", 8, 2, 194, false, 1, 3, 0, [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, -1942.5790708477725, -1015.708335469244, 53.500000000000114, 1], 0, 0, true, [1, 0, 0, 0, 0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, -1942.5790708477725, -1015.708335469244, 54.000000000000114, 1], 0, 3, 623, 53.5, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [0, 0, 1, 0, -1.8369701987210297e-16, 1, 0, 0, -1, -1.8369701987210297e-16, 0, 0, -653.1428571428573, 743.924437164159, 0, 1], 0, 2, 8, [53.5, 605], 0, [53.49999999999999, 18], 0, [1.4999999999996518, 18], 0, [1.499999999999659, 0], 0, [0, 0], 0, [0, 623], 0, [1.5, 623], 0, [1.5, 605], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 1, "右收口条", "1", "主卧飘窗柜", "", "流金岁月零度实木多层板", "", 0, 0, "不排", 2, 0, "1", "1", "1", "1", "", "", "", 8, "不排", "不排", "不排", "不排", "不排", "不排", "不排", "不排", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": -1942.5790708477725, "y": -1015.708335469244, "z": 0 }, "ucs": [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, 0, 0, 0, 1] };
|
|
|
|
let data =
|
|
|
|
|
|
|
|
{ "file": [1, "Board", 8, 2, 194, false, 1, 3, 0, [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, -1942.5790708477725, -1015.708335469244, 53.500000000000114, 1], 0, 0, true, [1, 0, 0, 0, 0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, -1942.5790708477725, -1015.708335469244, 54.000000000000114, 1], 0, 3, 623, 53.5, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [0, 0, 1, 0, -1.8369701987210297e-16, 1, 0, 0, -1, -1.8369701987210297e-16, 0, 0, -653.1428571428573, 743.924437164159, 0, 1], 0, 2, 8, [53.5, 605], 0, [53.49999999999999, 18], 0, [1.4999999999996518, 18], 0, [1.499999999999659, 0], 0, [0, 0], 0, [0, 623], 0, [1.5, 623], 0, [1.5, 605], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 1, "右收口条", "1", "主卧飘窗柜", "", "流金岁月零度实木多层板", "", 0, 0, "不排", 2, 0, "1", "1", "1", "1", "", "", "", 8, "不排", "不排", "不排", "不排", "不排", "不排", "不排", "不排", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": -1942.5790708477725, "y": -1015.708335469244, "z": 0 }, "ucs": [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, 0, 0, 0, 1] };
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
|
|
|
|
|
|
|
|
for (let b of brs)
|
|
|
|
for (let b of brs)
|
|
|
@ -198,7 +203,8 @@ test("切割残留2个封边厚度的凸角的板件封边", () =>
|
|
|
|
});
|
|
|
|
});
|
|
|
|
test("切割残留一个小于封边厚度的凸角的板件封边", () =>
|
|
|
|
test("切割残留一个小于封边厚度的凸角的板件封边", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = { "file": [2, "Board", 8, 2, 194, false, 1, 3, 0, [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, -1942.5790708477725, -1015.708335469244, 53.500000000000114, 1], 0, 0, true, [1, 0, 0, 0, 0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, -1942.5790708477725, -1015.708335469244, 54.000000000000114, 1], 0, 3, 605, 53.5, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [0, 0, 1, 0, -1.8369701987210297e-16, 1, 0, 0, -1, -1.8369701987210297e-16, 0, 0, -298.0228087167077, 1161.398383895394, 0, 1], 0, 2, 6, [53.5, 605], 0, [53.49999999999999, 18], 0, [1.4999999999996518, 18], 0, [1.499999999999659, 0], 0, [0, 0], 0, [0, 605], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 1, "右收口条", "1", "主卧飘窗柜", "", "流金岁月零度实木多层板", "", 0, 0, "不排", 2, 0, "1", "1", "1", "1", "", "", "", 6, "不排", "不排", "不排", "不排", "不排", "不排", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, "Board", 8, 2, 187, false, 1, 3, 0, [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, -2346.852039258465, -1029.4798626194247, 53.50000000000023, 1], 0, 0, true, [1, 0, 0, 0, 0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, -2346.852039258465, -1029.4798626194247, 54.00000000000023, 1], 0, 3, 605, 53.5, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.5, 605, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.5, 1.3642420526593924e-12, 0, 1], 0, 2, 6, [1.999999999999659, -605], 0, [0.5, -605], 0, [0.5, 0], 0, [54, 0], 0, [54, -587], 0, [1.999999999999659, -587], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 1, "右收口条", "1", "主卧飘窗柜", "", "流金岁月零度实木多层板", "", 0, 0, "不排", 2, 0, "1", "1", "1", "1", "", "", "", 6, "不排", "不排", "不排", "不排", "不排", "不排", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": -2346.852039258465, "y": -1029.4798626194247, "z": 0 }, "ucs": [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, 0, 0, 0, 1] };
|
|
|
|
let data =
|
|
|
|
|
|
|
|
{ "file": [2, "Board", 8, 2, 194, false, 1, 3, 0, [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, -1942.5790708477725, -1015.708335469244, 53.500000000000114, 1], 0, 0, true, [1, 0, 0, 0, 0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, -1942.5790708477725, -1015.708335469244, 54.000000000000114, 1], 0, 3, 605, 53.5, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [0, 0, 1, 0, -1.8369701987210297e-16, 1, 0, 0, -1, -1.8369701987210297e-16, 0, 0, -298.0228087167077, 1161.398383895394, 0, 1], 0, 2, 6, [53.5, 605], 0, [53.49999999999999, 18], 0, [1.4999999999996518, 18], 0, [1.499999999999659, 0], 0, [0, 0], 0, [0, 605], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 1, "右收口条", "1", "主卧飘窗柜", "", "流金岁月零度实木多层板", "", 0, 0, "不排", 2, 0, "1", "1", "1", "1", "", "", "", 6, "不排", "不排", "不排", "不排", "不排", "不排", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, "Board", 8, 2, 187, false, 1, 3, 0, [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, -2346.852039258465, -1029.4798626194247, 53.50000000000023, 1], 0, 0, true, [1, 0, 0, 0, 0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, -2346.852039258465, -1029.4798626194247, 54.00000000000023, 1], 0, 3, 605, 53.5, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.5, 605, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.5, 1.3642420526593924e-12, 0, 1], 0, 2, 6, [1.999999999999659, -605], 0, [0.5, -605], 0, [0.5, 0], 0, [54, 0], 0, [54, -587], 0, [1.999999999999659, -587], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 1, "右收口条", "1", "主卧飘窗柜", "", "流金岁月零度实木多层板", "", 0, 0, "不排", 2, 0, "1", "1", "1", "1", "", "", "", 6, "不排", "不排", "不排", "不排", "不排", "不排", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": -2346.852039258465, "y": -1029.4798626194247, "z": 0 }, "ucs": [0, -1.8369701987210297e-16, -1, 0, 0, 1, -1.8369701987210297e-16, 0, 1, 0, 0, 0, 0, 0, 0, 1] };
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
|
|
|
|
|
|
|
|
for (let b of brs)
|
|
|
|
for (let b of brs)
|
|
|
@ -211,7 +217,8 @@ test("切割残留一个小于封边厚度的凸角的板件封边", () =>
|
|
|
|
});
|
|
|
|
});
|
|
|
|
test("获取封边错误案例", () =>
|
|
|
|
test("获取封边错误案例", () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = { "file": [3, "Board", 8, 2, 100, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 158.18450775789097, -88.04258177080192, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -20.81549224210903, 150.95741822919808, 0, 1], 0, 3, 426, 520, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 426, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 8, [221, -426], 0, [221, -247], 0, [230, -247], 0, [230, -246], 0, [520, -162.60897861073317], 0, [520, 0], 0, [0, 0], 0, [0, -426], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 0, "底板", "厨房", "地柜3", "暖白", "18多层板", "暖白", 0, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 8, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, "Board", 8, 2, 116, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -582.4375243070995, -82.23281127955624, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -761.4375243070995, 156.76718872044376, 0, 1], 0, 3, 426, 520, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 426, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 8, [221, -426], 0, [221, -247], 0, [230, -247], 0, [230, -246], 0, [520, -246.00000000000003], 0, [520, 0], 0, [0, 0], 0, [0, -426], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 0, "底板", "厨房", "地柜3", "暖白", "18多层板", "暖白", 0, 1, "三合一", 2, 8, 2, 2, 2, 2, 2, 2, 2, 2, "1", "1", "1", "1", "", "", "", 8, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, "Board", 8, 2, 125, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -2044.8775109710668, -161.86694795795037, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -2223.877510971067, 77.13305204204963, 0, 1], 0, 3, 426, 520, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 426, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, -4.547473508864641e-13, 0, 1], 0, 2, 8, [221, -426], 0, [0, -426], 0, [0, 0], 0, [520, 0], 0, [520, -246.00000000000003], 0, [230, -246], 0, [230, -247], 0, [221, -247], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 0, "底板", "厨房", "地柜3", "暖白", "18多层板", "暖白", 0, 1, "三合一", 2, 8, 1, 1, 1, 1, 1, 1, 1, 1, "1", "1", "1", "1", "", "", "", 8, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": -2470.877510971067, "y": -161.86694795795037, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
let data =
|
|
|
|
|
|
|
|
{ "file": [3, "Board", 8, 2, 100, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 158.18450775789097, -88.04258177080192, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -20.81549224210903, 150.95741822919808, 0, 1], 0, 3, 426, 520, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 426, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 8, [221, -426], 0, [221, -247], 0, [230, -247], 0, [230, -246], 0, [520, -162.60897861073317], 0, [520, 0], 0, [0, 0], 0, [0, -426], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 0, "底板", "厨房", "地柜3", "暖白", "18多层板", "暖白", 0, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 8, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, "Board", 8, 2, 116, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -582.4375243070995, -82.23281127955624, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -761.4375243070995, 156.76718872044376, 0, 1], 0, 3, 426, 520, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 426, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 8, [221, -426], 0, [221, -247], 0, [230, -247], 0, [230, -246], 0, [520, -246.00000000000003], 0, [520, 0], 0, [0, 0], 0, [0, -426], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 0, "底板", "厨房", "地柜3", "暖白", "18多层板", "暖白", 0, 1, "三合一", 2, 8, 2, 2, 2, 2, 2, 2, 2, 2, "1", "1", "1", "1", "", "", "", 8, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, "Board", 8, 2, 125, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -2044.8775109710668, -161.86694795795037, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -2223.877510971067, 77.13305204204963, 0, 1], 0, 3, 426, 520, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 426, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, -4.547473508864641e-13, 0, 1], 0, 2, 8, [221, -426], 0, [0, -426], 0, [0, 0], 0, [520, 0], 0, [520, -246.00000000000003], 0, [230, -246], 0, [230, -247], 0, [221, -247], 0, true, 0, 3, 0, 0, 0, 0, 0, 9, 0, "底板", "厨房", "地柜3", "暖白", "18多层板", "暖白", 0, 1, "三合一", 2, 8, 1, 1, 1, 1, 1, 1, 1, 1, "1", "1", "1", "1", "", "", "", 8, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true], "basePt": { "x": -2470.877510971067, "y": -161.86694795795037, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
|
|
|
|
|
|
|
|
for (let b of brs)
|
|
|
|
for (let b of brs)
|
|
|
@ -222,3 +229,42 @@ test("获取封边错误案例", () =>
|
|
|
|
expect(con.Length).toMatchNumberSnapshot();
|
|
|
|
expect(con.Length).toMatchNumberSnapshot();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('封边数据个数不匹配', () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let data =
|
|
|
|
|
|
|
|
{ "file": [2, "Board", 8, 2, 101, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1692.3844709212972, 43.15983892617464, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1832.3844709212972, 26.159838926174643, 0, 1], 0, 3, 718, 388, 16, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 718, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 10, [388, -718], 0, [388, -409], 0, [188, -409], -0.41421356237309503, [138, -359], 0, [138, -359], -0.41421356237309515, [188.00000000000003, -309], 0, [388, -309.0000000000001], 0, [388, 0], 0, [0, 0], 0, [0, -718], 0, true, 0, 3, 0, 0, 0, 0, 0, 10, 0, "层板2", "B20813", "主柜", "萨米色", "多层板", "萨米色", 0, 1, "三合一", 2, 6, 1, 0, 1, 0, 1, 0, "0", "0", "1", "1", "", "", "", 10, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 1, "1", "黄海玉", 0, 0, 0, 0, 0, 0, 0, true, 0, 0, "Board", 8, 2, 102, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 762.0444563758392, 43.15983892617464, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 902.0444563758392, 26.159838926174643, 0, 1], 0, 3, 718, 388, 16, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 718, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 10, [388, -718], 0, [388, -409], 0, [188, -409], -0.41421356237309503, [138, -359], 0, [138, -359], -0.41421356237309515, [188.00000000000003, -309], 0, [388, -309.0000000000001], 0, [388, 0], 0, [0, 0], 0, [0, -718], 0, true, 0, 3, 0, 0, 0, 0, 0, 10, 0, "层板1", "B20813", "主柜", "萨米色", "多层板", "萨米色", 0, 1, "三合一", 2, 6, 1, 1, 1, 0, 1, 0, "0", "0", "1", "1", "", "", "", 10, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 1, "1", "黄海玉", 0, 0, 0, 0, 0, 0, 0, true, 0, 0], "basePt": { "x": 44.04445637583922, "y": 43.15983892617464, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let br of brs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let orgContour = GetSealedBoardContour(br, true, true);
|
|
|
|
|
|
|
|
let orgPtsBul = ConverToPtsBul(orgContour);
|
|
|
|
|
|
|
|
orgPtsBul.pts.pop();
|
|
|
|
|
|
|
|
orgPtsBul.buls.pop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let sealData = GetBoardSealingData(orgContour);
|
|
|
|
|
|
|
|
expect(orgPtsBul.pts.length === sealData.length).toBeTruthy();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('封边数据个数不匹配2', () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let data =
|
|
|
|
|
|
|
|
{ "file": [1, "Board", 8, 2, 100, false, 1, 8, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 847.9731543624166, 87.24832214765104, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 847.9731543624166, 127.24832214765104, 0, 1], 0, 3, 740, 420, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 40, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 40, 0, 0, 1], 0, 2, 6, [-20, 0], 0, [380, 0], 0, [380, 740], 0, [-20, 740], 0.41421356237309503, [-40, 720], 0, [-40, 20.000000000000004], 0.41421356237309503, true, 2, 3, 9, 716, 6, true, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 4, [0, 0], 0, [716, 0], 0, [716, 9], 0, [0, 9], 0, true, 0, 3, 6, 1, 1, 0, 0, [-1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 835.9731543624166, 459.24832214765104, 0, 1], 3, 9, 716, 6, true, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 4, [0, 0], 0, [716, 0], 0, [716, 9], 0, [0, 9], 0, true, 0, 3, 6, 1, 1, 0, 0, [-1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 835.9731543624166, 489.24832214765104, 0, 1], 3, 0, 0, 0, 0, 0, 10, 0, "顶板", "大厅", "电视柜", "深咖布纹18厚", "多层板", "深咖布纹", 2, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 6, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, 0, 0], "basePt": { "x": 107.97315436241661, "y": 87.24832214765104, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let brs = LoadBoardsFromFileData(data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let br of brs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let orgContour = GetSealedBoardContour(br, true, true);
|
|
|
|
|
|
|
|
let orgPtsBul = ConverToPtsBul(orgContour);
|
|
|
|
|
|
|
|
orgPtsBul.pts.pop();
|
|
|
|
|
|
|
|
orgPtsBul.buls.pop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let sealData = GetBoardSealingData(orgContour);
|
|
|
|
|
|
|
|
expect(orgPtsBul.pts.length === sealData.length).toBeTruthy();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|