mirror of https://gitee.com/cf-fz/WebCAD.git
!1899 变更:镜像矩阵,SetBrXAxis保持纹路,封边,排钻,kjl导入修正坐标系
parent
06538fb759
commit
da9a3464eb
@ -0,0 +1,16 @@
|
||||
import { Vector3 } from "three";
|
||||
import { CADFiler } from "../../src/api";
|
||||
import { MakeMirrorMtx } from "../../src/Common/Matrix4Utils";
|
||||
import { LoadBoardsFromFileData } from "../Utils/LoadEntity.util";
|
||||
|
||||
test('板件镜像', () =>
|
||||
{
|
||||
let d =
|
||||
{ "file": [5, "Board", 8, 2, 106, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 3435.3422864514687, 444.811074718357, 21.352872036479766, 1], 107, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 2671.3422864514687, 444.811074718357, 21.352872036479766, 1], 0, 3, 764, 500.00000000000006, 18, 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, [6.123233995736766e-17, -1, 0, 0, 1, 6.123233995736766e-17, 0, 0, 0, 0, 1, 0, 0, 764, 0, 1], 0, 2, 4, [0, 764], 0, [500, 764], 0, [500.00000000000006, 0], 0, [4.678150772742889e-14, 0], 0, true, 0, 3, 1, 1, 1, 0, 1, 112, 10, 0, "晨丰顶板", "未命名", "晨丰一字柜测试", "", "水曲柳(默认材质)", "", 0, 1, "**多种**", 2, 4, 2, 1, 4, 3, "2", "4", "3", "1", "", "", "", 4, "三合一", "铰链孔", "二合一", "不排", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, 0, 0, "Text", 8, 2, 231, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 2980.073687006361, 1010.7348531969456, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 2980.073687006361, 1010.7348531969456, 0, 1], 0, 1, "1铰链孔", 30, 0, "songti", 10, "Text", 8, 2, 236, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 2497.0038493164498, 635.6980151294591, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 2497.0038493164498, 635.6980151294591, 0, 1], 0, 1, "2三合一", 30, 0, "songti", 10, "Text", 8, 2, 237, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 3047.2444639736723, 397.8015133702329, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 3047.2444639736723, 397.8015133702329, 0, 1], 0, 1, "3不排", 30, 0, "songti", 10, "Text", 8, 2, 238, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 3475.3182280215988, 681.1782287010747, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 3475.3182280215988, 681.1782287010747, 0, 1], 0, 1, "4二合一", 30, 0, "songti", 10], "basePt": { "x": 2497.0038493164498, "y": 397.8015133702329, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 3435.3422864514687, 444.811074718357, 21.352872036479766, 1] };
|
||||
let br = LoadBoardsFromFileData(d)[0];
|
||||
|
||||
br.ApplyMatrix(MakeMirrorMtx(new Vector3(0, 0, 1)));
|
||||
let f = new CADFiler;
|
||||
f.WriteObject(br);
|
||||
expect(f).toMatchSnapshot();
|
||||
});
|
@ -0,0 +1,182 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`板件镜像 1`] = `
|
||||
CADFiler {
|
||||
"_datas": Array [
|
||||
"Board",
|
||||
8,
|
||||
2,
|
||||
0,
|
||||
false,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
Array [
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
-1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
-1,
|
||||
0,
|
||||
3435.3422864514687,
|
||||
444.811074718357,
|
||||
-21.352872036479766,
|
||||
1,
|
||||
],
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
Array [
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
-1,
|
||||
0,
|
||||
2671.3422864514687,
|
||||
444.811074718357,
|
||||
-21.352872036479766,
|
||||
1,
|
||||
],
|
||||
0,
|
||||
3,
|
||||
764,
|
||||
500.00000000000006,
|
||||
18,
|
||||
true,
|
||||
"Polyline",
|
||||
8,
|
||||
2,
|
||||
0,
|
||||
false,
|
||||
0,
|
||||
7,
|
||||
0,
|
||||
Array [
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
],
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
Array [
|
||||
6.123233995736766e-17,
|
||||
-1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
6.123233995736766e-17,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
764,
|
||||
0,
|
||||
1,
|
||||
],
|
||||
0,
|
||||
2,
|
||||
4,
|
||||
Array [
|
||||
0,
|
||||
764,
|
||||
],
|
||||
0,
|
||||
Array [
|
||||
500,
|
||||
764,
|
||||
],
|
||||
0,
|
||||
Array [
|
||||
500.00000000000006,
|
||||
0,
|
||||
],
|
||||
0,
|
||||
Array [
|
||||
4.678150772742889e-14,
|
||||
0,
|
||||
],
|
||||
0,
|
||||
true,
|
||||
0,
|
||||
3,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
10,
|
||||
0,
|
||||
"晨丰顶板",
|
||||
"未命名",
|
||||
"晨丰一字柜测试",
|
||||
"",
|
||||
"水曲柳(默认材质)",
|
||||
"",
|
||||
0,
|
||||
1,
|
||||
"**多种**",
|
||||
2,
|
||||
4,
|
||||
2,
|
||||
1,
|
||||
4,
|
||||
3,
|
||||
"2",
|
||||
"4",
|
||||
"3",
|
||||
"1",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
4,
|
||||
"三合一",
|
||||
"铰链孔",
|
||||
"二合一",
|
||||
"不排",
|
||||
true,
|
||||
true,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
0,
|
||||
0,
|
||||
],
|
||||
"readIndex": 0,
|
||||
}
|
||||
`;
|
Loading…
Reference in new issue