mirror of https://gitee.com/cf-fz/WebCAD.git
!1509 修复:V型刀走刀错误的问题
parent
8001f33510
commit
f0d9236efd
@ -0,0 +1,110 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`V型刀测试 1`] = `
|
||||
Array [
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 86.00039030917347,
|
||||
"y": 325.00039030917355,
|
||||
"z": 12,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 106.785,
|
||||
"y": 345.7850000000001,
|
||||
"z": 0,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 193.21499999999997,
|
||||
"y": 345.7850000000001,
|
||||
"z": 0,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 213.9996096908265,
|
||||
"y": 325.00039030917355,
|
||||
"z": 12,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 193.21499999999997,
|
||||
"y": 345.7850000000001,
|
||||
"z": 0,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 193.21499999999997,
|
||||
"y": 359.21500000000015,
|
||||
"z": 0,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 213.9996096908265,
|
||||
"y": 379.99960969082656,
|
||||
"z": 12,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 193.21499999999997,
|
||||
"y": 359.21500000000015,
|
||||
"z": 0,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 106.785,
|
||||
"y": 359.21500000000015,
|
||||
"z": 0,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 86.00039030917347,
|
||||
"y": 379.99960969082656,
|
||||
"z": 12,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 106.785,
|
||||
"y": 359.21500000000015,
|
||||
"z": 0,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 106.785,
|
||||
"y": 345.7850000000001,
|
||||
"z": 0,
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"bul": 0,
|
||||
"pt": Vector3 {
|
||||
"x": 86.00039030917347,
|
||||
"y": 325.00039030917355,
|
||||
"z": 12,
|
||||
},
|
||||
},
|
||||
]
|
||||
`;
|
@ -0,0 +1,14 @@
|
||||
import { MathUtils } from "three";
|
||||
import { Polyline, VKnifToolPath } from "../../src/api";
|
||||
import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
|
||||
|
||||
test('V型刀测试', () =>
|
||||
{
|
||||
let d = { "file": [5, "Polyline", 8, 2, 209, false, 1, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -105.57964735516373, -661.1311234266251, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -105.57964735516373, -661.1311234266251, 0, 1], 0, 2, 4, [212.36464735516373, 1006.9161234266252], 0, [298.7946473551637, 1006.9161234266252], 0, [298.7946473551637, 1020.3461234266252], 0, [212.36464735516373, 1020.3461234266252], 0, true, "Polyline", 8, 2, 234, false, 1, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -105.57964735516373, -661.1311234266251, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -105.57964735516373, -661.1311234266251, 0, 1], 0, 2, 4, [212.36464735516373, 1006.9161234266252], 0, [298.7946473551637, 1006.9161234266252], 0, [298.7946473551637, 1020.3461234266252], 0, [212.36464735516373, 1020.3461234266252], 0, true, "Polyline", 8, 2, 235, false, 1, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -105.57964735516373, -661.1311234266251, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -105.57964735516373, -661.1311234266251, 0, 1], 0, 2, 4, [212.36464735516373, 1006.9161234266252], 0, [298.7946473551637, 1006.9161234266252], 0, [298.7946473551637, 1020.3461234266252], 0, [212.36464735516373, 1020.3461234266252], 0, true, "Polyline", 8, 2, 243, false, 1, 8, 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, 2, [193.21499999999997, 359.21500000000015], 0, [106.785, 359.21500000000015], 0, false, "Polyline", 8, 2, 254, false, 1, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -105.57964735516373, -661.1311234266251, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -105.57964735516373, -661.1311234266251, 0, 1], 0, 2, 4, [212.36464735516373, 1006.9161234266252], 0, [298.7946473551637, 1006.9161234266252], 0, [298.7946473551637, 1020.3461234266252], 0, [212.36464735516373, 1020.3461234266252], 0, true], "basePt": { "x": 106.785, "y": 345.7850000000001, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
|
||||
|
||||
let pl = LoadEntityFromFileData(d)[0] as Polyline;
|
||||
|
||||
let vd = VKnifToolPath(pl, 12, MathUtils.DEG2RAD * 120 / 2);
|
||||
|
||||
expect(vd).toMatchSnapshot();
|
||||
});
|
Loading…
Reference in new issue