|
|
@ -24,6 +24,7 @@ import { BoardModalType } from "../../UI/Components/Board/BoardModal";
|
|
|
|
import { UpdateBoardInfos } from "../BoardEditor/UpdateBoardInfos";
|
|
|
|
import { UpdateBoardInfos } from "../BoardEditor/UpdateBoardInfos";
|
|
|
|
import { FixDigits } from "../../Common/Utils";
|
|
|
|
import { FixDigits } from "../../Common/Utils";
|
|
|
|
import { GetRectData } from "../../Common/CurveUtils";
|
|
|
|
import { GetRectData } from "../../Common/CurveUtils";
|
|
|
|
|
|
|
|
import { CuttingBoardByBoard } from "../BoardCutting/CuttingUtils2";
|
|
|
|
|
|
|
|
|
|
|
|
const MaxBoardDistance = 200;//左右侧板,顶底板距离边缘的最大距离
|
|
|
|
const MaxBoardDistance = 200;//左右侧板,顶底板距离边缘的最大距离
|
|
|
|
|
|
|
|
|
|
|
@ -98,6 +99,8 @@ export class Polyline2Board implements Command
|
|
|
|
//板名设置属性配置
|
|
|
|
//板名设置属性配置
|
|
|
|
maxThickness: number = 20;
|
|
|
|
maxThickness: number = 20;
|
|
|
|
backBrName = "背板";
|
|
|
|
backBrName = "背板";
|
|
|
|
|
|
|
|
behindIsRelative = false;
|
|
|
|
|
|
|
|
footThickness: number;
|
|
|
|
InitData(store: Rec2BrStore)
|
|
|
|
InitData(store: Rec2BrStore)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let option = store.m_Option;
|
|
|
|
let option = store.m_Option;
|
|
|
@ -123,6 +126,8 @@ export class Polyline2Board implements Command
|
|
|
|
this.grooveWidth = safeEval(option.grooveOption.grooveAddWidth);
|
|
|
|
this.grooveWidth = safeEval(option.grooveOption.grooveAddWidth);
|
|
|
|
this.maxThickness = option.maxThickness;
|
|
|
|
this.maxThickness = option.maxThickness;
|
|
|
|
this.backBrName = option.backBrName;
|
|
|
|
this.backBrName = option.backBrName;
|
|
|
|
|
|
|
|
this.behindIsRelative = option.behindIsRelative;
|
|
|
|
|
|
|
|
this.footThickness = option.footerThickness;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//绘制 传入曲线id表
|
|
|
|
//绘制 传入曲线id表
|
|
|
|
async Doit(pls: Polyline[])
|
|
|
|
async Doit(pls: Polyline[])
|
|
|
@ -472,12 +477,12 @@ export class Polyline2Board implements Command
|
|
|
|
//修改板名和前缩
|
|
|
|
//修改板名和前缩
|
|
|
|
for (let br of leftBoards)
|
|
|
|
for (let br of leftBoards)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
br.ColorIndex = 15;
|
|
|
|
br.ColorIndex = 11;
|
|
|
|
br.Name = storeOption.farLeftVerticalBrName;
|
|
|
|
br.Name = storeOption.farLeftVerticalBrName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (let br of rightBoards)
|
|
|
|
for (let br of rightBoards)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
br.ColorIndex = 12;
|
|
|
|
br.ColorIndex = 11;
|
|
|
|
br.Name = storeOption.farRightVerticalBrName;
|
|
|
|
br.Name = storeOption.farRightVerticalBrName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -502,17 +507,17 @@ export class Polyline2Board implements Command
|
|
|
|
br.ColorIndex = 8;
|
|
|
|
br.ColorIndex = 8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const FixdjsktThickness = (br: Board) =>
|
|
|
|
const FixdjsktThickness = (br: Board, thicknee?: number) =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let oldPt = br.MinPoint;
|
|
|
|
let oldPt = br.MinPoint;
|
|
|
|
br.Thickness = this.boardThick;
|
|
|
|
br.Thickness = thicknee ?? this.boardThick;
|
|
|
|
let newPt = br.MinPoint;
|
|
|
|
let newPt = br.MinPoint;
|
|
|
|
br.Position = br.Position.add(oldPt.sub(newPt));
|
|
|
|
br.Position = br.Position.add(oldPt.sub(newPt));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
for (let br of djxs)//地脚
|
|
|
|
for (let br of djxs)//地脚
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FixdjsktThickness(br);
|
|
|
|
FixdjsktThickness(br, this.footThickness);
|
|
|
|
|
|
|
|
|
|
|
|
if (storeOption.isbottomMostBackBrName)
|
|
|
|
if (storeOption.isbottomMostBackBrName)
|
|
|
|
br.Name = storeOption.bottomMostBackBrName;
|
|
|
|
br.Name = storeOption.bottomMostBackBrName;
|
|
|
@ -558,12 +563,19 @@ export class Polyline2Board implements Command
|
|
|
|
UpdateBoardInfos.ModifyBr(b, nameOption);
|
|
|
|
UpdateBoardInfos.ModifyBr(b, nameOption);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (let br of layerVerBoards)
|
|
|
|
if (this.behindIsRelative)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//柜体内缩
|
|
|
|
for (let br of layerVerBoards)
|
|
|
|
CurtailFunc(br, this.fontDis);
|
|
|
|
CurtailFunc(br, this.fontDis);
|
|
|
|
br.Subtract(backBoards);
|
|
|
|
CuttingBoardByBoard(layerVerBoards, backBoards);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
for (let br of layerVerBoards)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//柜体内缩
|
|
|
|
|
|
|
|
CurtailFunc(br, this.fontDis);
|
|
|
|
|
|
|
|
br.Subtract(backBoards);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DrawBoard(pls: Polyline[], isBack = false, color?: number): Board[]
|
|
|
|
DrawBoard(pls: Polyline[], isBack = false, color?: number): Board[]
|
|
|
|