mirror of https://gitee.com/cf-fz/WebCAD.git
!423 独立酒格构建功能
parent
725d816d8a
commit
3175c14eed
@ -0,0 +1,5 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`酒格功能测试 斜酒格1 1`] = `24`;
|
||||
|
||||
exports[`酒格功能测试 斜酒格1 2`] = `33`;
|
@ -0,0 +1,57 @@
|
||||
import { DrawUprightWineRackTool } from "../../src/Add-on/DrawWineRack/DrawUprightWineRackTool";
|
||||
import { DrawBlisWineRackTool } from "../../src/Add-on/DrawWineRack/DrawBlisWineRackTool";
|
||||
import { IWineRackOption, EWineRackType, EWRackArrayType, EFullType, EFullDir } from "../../src/UI/Store/WineRackInterface";
|
||||
import { ISpaceParse } from "../../src/Geometry/SpaceParse/ISpaceParse";
|
||||
import { Box3, Vector3, Matrix4 } from "three";
|
||||
import { Box3Ext } from "../../src/Geometry/Box";
|
||||
import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
|
||||
import { Board } from "../../src/DatabaseServices/Entity/Board";
|
||||
const UprightTool = DrawUprightWineRackTool.GetInstance() as DrawUprightWineRackTool;
|
||||
const blisTool = DrawBlisWineRackTool.GetInstance() as DrawBlisWineRackTool;
|
||||
|
||||
const option: IWineRackOption = {
|
||||
type: EWineRackType.Bias,
|
||||
arrayType: EWRackArrayType.ByWidth,
|
||||
fullType: EFullType.ByWidth,
|
||||
isFull: false,
|
||||
isLock: false,
|
||||
fullDir: EFullDir.Left,
|
||||
heightCount: 3.5,
|
||||
widthCount: 3.5,
|
||||
isTotalDepth: true,
|
||||
depth: 0,
|
||||
gripWidth: 100,
|
||||
calcDepth: "L",
|
||||
boardThick: 18,
|
||||
grooveWidthAdd: 0,
|
||||
leftEdge: 1,
|
||||
rightEdge: 1,
|
||||
topEdge: 1,
|
||||
bottomEdge: 1,
|
||||
frontCut: 0,
|
||||
leftCut: 0,
|
||||
rightCut: 0,
|
||||
topCut: 0,
|
||||
grooveLengthAdd: 3,
|
||||
isDrawLy: false,
|
||||
isDrawVer: false,
|
||||
brThick2: 18,
|
||||
}
|
||||
|
||||
describe("酒格功能测试", () =>
|
||||
{
|
||||
test("斜酒格1", () =>
|
||||
{
|
||||
let data =
|
||||
[2, "Board", 5, 2, 102, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 580.3050847457629, -214.2857142857143, 0, 1], 0, 0, 2, 2000, 600, 18, true, "Polyline", 5, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 4, [0, 0], 0, [600, 0], 0, [600, 2000], 0, [0, 2000], 0, true, 0, 3, 0, 0, 0, 4, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 580.3050847457629, -214.2857142857143, 0, 1], 1, "右侧板", "主卧", "下柜", "", "", "", 0, 0, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 4, "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, "Board", 5, 2, 101, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -601.6949152542372, -214.2857142857143, 0, 1], 0, 0, 2, 2000, 600, 18, true, "Polyline", 5, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 4, [0, 0], 0, [600, 0], 0, [600, 2000], 0, [0, 2000], 0, true, 0, 3, 0, 0, 0, 4, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -601.6949152542372, -214.2857142857143, 0, 1], 1, "左侧板", "主卧", "下柜", "", "", "", 0, 0, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 4, "三合一", "三合一", "三合一", "三合一", true, true, 0, 0]
|
||||
|
||||
let spaceParse = new ISpaceParse();
|
||||
spaceParse.m_Boards = LoadEntityFromFileData(data) as Board[];
|
||||
spaceParse.m_SpaceBox = new Box3Ext(new Vector3(), new Vector3(1200, 600, 2000));
|
||||
spaceParse.Parse();
|
||||
UprightTool.Parse(spaceParse, option);
|
||||
blisTool.Parse(spaceParse, option);
|
||||
expect(UprightTool.boardlist.length).toMatchSnapshot();
|
||||
expect(blisTool.boardlist.length).toMatchSnapshot();
|
||||
})
|
||||
})
|
Loading…
Reference in new issue