!2423 开发:增加建模测试用例

pull/2568/MERGE
林三 7 months ago committed by ChenX
parent 6bf73a5a87
commit 523f0a974d

@ -128,3 +128,21 @@ test('无法构造盖子轮廓导致的丢面', () =>
//
//{"file":[1,"Board",10,2,186,0,1,3,71,[1,0,0,0,0,0,1,0,0,-1,0,0,483.14082719043313,13.689025306123199,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,-298.8591728095664,-284.3109746938768,0,1],0,0,1,3,121.24601483164042,97.9004594467101,18,true,"Polyline",10,2,0,0,0,7,71,[1,0,2.030561952816011e-30,0,4.5087532658883125e-46,1,-2.220446049250313e-16,0,-2.030561952816011e-30,2.220446049250313e-16,1,0,0,0,2.6645352591003757e-14,1],0,0,1,[1,0,0,0,0,0,-1,0,0,1,0,0,-616.8365854462929,4.729723383396163,2.6645352591003757e-14,1],0,0,1,2,4,[97.9004594467101,121.24601483164042],0,[7.958078640513122e-13,121.24601483163951],0,[0,0],0,[97.90045944670942,0],0,true,2,3,17.53791742793169,17.53791742793169,5,false,"Circle",10,2,0,0,0,1,71,[1,0,0,0,0,1,0,0,0,0,1,0,8.768958713965844,8.768958713965844,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,-2258.0325228168194,-816.6695956959304,1.9667822925839573e-11,1],0,0,1,1,8.768958713965844,0,3,0,0,0,0,0,[1,0,0,0,0,0,1,0,0,-1,0,0,518.2608331537249,0.6890253061231988,48.76970415382985,1],3,11.527154383958326,21.24289879329467,18,true,"Polyline",10,2,0,0,0,7,71,[1,0,0,0,0,1,0,0,0,0,1,0,0,11.527154383958326,0,1],0,0,1,[1,0,0,0,0,0,-1,0,0,1,0,0,-650.2917132537983,-47.319343025706445,0,1],0,0,1,2,4,[21.24289879329467,-11.527154383958326],0,[21.24289879329467,0],0,[0,0],0,[0,-11.527154383958326],0,true,0,3,0,0,0,0,0,[1,0,0,0,0,0,1,0,0,-1,0,0,516.5959549979385,13.689025306123172,52.04906640910261,1],3,0,0,0,0,0,11,2,"背板","","","","多层板","盛橡木多层板",0,1,"无效配置",2,0,"1","0","1","1","","","",4,"无效配置","无效配置","无效配置","无效配置",true,true,0,0,0,0,0,0,0,0,true,0,0,null],"basePt":{"x":483.14082719043313,"y":-4.310974693876801,"z":0},"ucs":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}
test('EdgeGeometry生成和Geometry构建测试', () =>
{
let d = { "file": [1, "Board", 10, 2, 100, 0, 1, 4, 71, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 83.1168831168834, 0, 6.49350649373082, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -866.8831168831166, 20, 6.49350649373082, 1], 0, 0, 1, 3, 2591, 600, 50, true, "Polyline", 10, 2, 0, 0, 0, 7, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, 2, 4, [0, 0], 0, [600, 0], 0, [600, 2591], 0, [0, 2591], 0, true, 0, 3, 0, 0, 0, 0, 0, 13, 1, "见光板", "", "", "", "", "", 0, 0, "不排", 2, 0, "1", "1", "1", "1", "", "", "", 4, "不排", "不排", "不排", "不排", false, false, 0, 0, 0, 0, 0, 0, 0, 0, true, 1, "Polyline", 10, 2, 0, 0, 0, 1, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -5, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -5, 0, 0, 1], 0, 0, 1, 2, 2, [0, 2591], 0, [0, 0], 0, false, 1, 1, 50, 0, "27007", 3, 0.7853981633974483, "50圆弧刀", 0, null, 1, "27007", "Polyline", 10, 2, 0, 0, 0, 7, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 33677.4052763473, -6494.096237586119, 0, 1], 0, 0, 1, 2, 10, [50, 50], 0.41421356237309503, [0, 0], 0.41421356237309503, [-50, 50], 0, [-50, 60], 0, [-5, 60], 0, [-5, 80], 0, [5, 80], 0, [5.000000000000007, 60.00000000000001], 0, [50.00000000000001, 60], 0, [50, 49.99999999999909], 0, false, 0], "basePt": { "x": 83.1168831168834, "y": 0, "z": 6.49350649373082 }, "ucs": [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] };
let brs = LoadBoardsFromFileData(d);
for (let br of brs)
{
let line = br.GetDrawObjectFromRenderType(RenderType.Wireframe) as Line;
//@ts-ignore
expect(line.geometry.attributes.position.count).toMatchSnapshot();
let builder = new ExtrudeGeometryBuilder(br);
expect(builder.verticesArray.length).toMatchSnapshot();
expect(builder.edgeAndLidBuilder.lineVerticesArray.length).toMatchSnapshot();
}
});

@ -8,6 +8,12 @@ exports[`EdgeGeometry生成 3`] = `68`;
exports[`EdgeGeometry生成2 1`] = `66`;
exports[`EdgeGeometry生成和Geometry构建测试 1`] = `28`;
exports[`EdgeGeometry生成和Geometry构建测试 2`] = `108`;
exports[`EdgeGeometry生成和Geometry构建测试 3`] = `78`;
exports[`Geometry构建测试 1`] = `540`;
exports[`Geometry构建测试 2`] = `372`;

Loading…
Cancel
Save