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

17 lines
4.8 KiB

import { Line } from "three";
import { RenderType } from "../../src/GraphicsSystem/RenderType";
import { LoadBoardsFromFileData } from "../Utils/LoadEntity.util";
test('EdgeGeometry生成', () =>
{
let d = [3, "Board", 3, 2, 101, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 842.2974778978387, -349.77794462809106, 5.207248635008, 1], 2, 1200, 1287.9139521874604, 18, true, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 4, [0, 0], 0, [1287.9139521874604, 0], 0, [1287.9139521874604, 1200], 0, [0, 1200], 0, true, 1, 2, 650.3947318524762, 368.7144637049523, 18, false, "Polyline", 3, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1827.9668979500452, -289.76232632197764, 0, 1], 2, 4, [1827.9668979500452, 755.7998263219777], 0, [1827.9668979500452, 289.76232632197764], 0, [2196.6813616549975, 289.76232632197764], 0, [2196.6813616549975, 755.7998263219777], 0.9999999999999999, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 842.2974778978387, -132.52737566129053, 492.2690189409713, 1], 3, 0, 0, 0, 2, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -331.4882673815591, 22.964750159997493, 5.207248635008, 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\":\"\",\"highDrill\":[\"three\",\"three\",\"three\",\"three\",\"three\",\"three\"]}", 0, 0, "Board", 3, 2, 211, false, 1, 2, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1743.9852053204086, 1058.889397823259, -54.29958601640169, 1], 2, 1230.761278665225, 896.6684244728249, 18, false, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 5.684341886080802e-14, 30.761278665225063, 0, 1], 2, 6, [0, 0], 0, [300, 0], 1.44245572325029, [315.9503077287227, 816.1221829065471], 0, [600, 1200], 0, [300, 1200], 0.41421356237309503, [0, 900], 0, true, 1, 2, 385.96920000000006, 177.84615384615404, 10, false, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -422.15384615384596, -402.0513128205126, 0, 1], 2, 5, [597.7122651988514, 788.0205128205126], 0, [422.15384615384596, 788.0205128205126], 0, [422.15384615384596, 402.05131282051263], 0, [600, 402.0513128205126], 0, [599.9999999999998, 786.9320348416215], 0.0014989901540299988, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1751.9852053204086, 1481.043243977105, 378.51300546933595, 1], 3, 0, 0, 0, 2, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -17.633213176275603, 262.61914493865333, 0, 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\":\"\",\"highDrill\":[]}", 0, 0, "Board", 3, 2, 212, false, 1, 2, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1111.9162051636208, 2117.9319139518834, -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, 63.40599363597872, 232.13273756151398, 18, false, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -58.35238007400439, -234.55749771884788, 0, 1], 2, 4, [236.13305395456487, 234.55749771884788], 0, [83.25375055383591, 272.608758187791], 0, [58.35238007400439, 297.9634913548266], 0, [290.48511763551835, 268.97109344254164], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1111.9162051636208, 2230.3214362687672, -230.31172411264944, 1], 3, 0, 0, 0, 2, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -776.2476068199197, 3557.665244594688, -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\":\"\",\"highDrill\":[]}", 0, 0]
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();
}
});