You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/__test__/Geometry/EdgeGeometry.test.ts

22 lines
2.0 KiB

import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
import { Board } from "../../src/DatabaseServices/Board";
import { RenderType } from "../../src/GraphicsSystem/RenderType";
import { Line } from "three";
test('EdgeGeometry生成', () =>
{
let d = [1, "Board", 3, 2, 101, false, 1, 2, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -646.2420911908739, 230.97217145381728, -423.9845986472139, 1], 2, 484.63826594239083, 642.7439363026181, 18, false, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 54.03714224287984, -40.88462318428341, 0, 1], 2, 6, [226.89796571085776, 338.3121692475904], 0, [248.97426264670497, 525.5228891266743], 0, [-54.03714224287984, 287.9783168893773], 0, [141.82369879876416, 40.88462318428341], 0, [588.7067940597382, 306.7620304373949], 0, [320.72013691164284, 378.99785818408446], 0, true, 1, 2, 109.48289947281157, 198.20905225226585, 18, false, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -208.29382686305865, -201.59010496470867, 0, 1], 2, 4, [298.05328308824403, 206.16728215262995], 0, [208.29382686305865, 201.59010496470867], 0, [267.90926007565713, 311.07300443752024], 0, [406.5028791153245, 272.1962944735834], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -646.2420911908739, 493.3031405597556, -263.2791168667886, 1], 3, 0, 0, 0, 2, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -314.3564875158372, 4019.556363898919, -46.81305616698228, 1], 1, "右侧板", "{\"roomName\":\"\",\"cabinetName\":\"\",\"boardName\":\"\",\"material\":\"\",\"color\":\"\",\"lines\":0,\"bigHoleDir\":0,\"drillType\":\"three\",\"composingFace\":2,\"highSealed\":[],\"sealedUp\":\"1\",\"sealedDown\":\"1\",\"sealedLeft\":\"1\",\"sealedRight\":\"1\",\"spliteHeight\":\"\",\"spliteWidth\":\"\",\"spliteThickness\":\"\"}", 0, 0];
let br: Board = LoadEntityFromFileData(d)[0] as Board;
let obj = br.GetDrawObjectFromRenderType(RenderType.Wireframe);
let line = obj as Line;
let geo = line.geometry;
//@ts-ignore
expect(geo.attributes.position.length).toBe(246);
});