!2719 新增:收口条绘制,辅助条增加横放竖放选项

pull/2759/MERGE
钱若寒 4 months ago committed by ChenX
parent f73ce9ecf4
commit 15c1b39a69

@ -166,8 +166,16 @@ export class DrawClosingStrip implements Command
pos.set(min.x, min.y + thickness + frontShrink, max.z);
if (opt.isDrawFuZhu)
{
br2 = Board.CreateBoard(size.x, opt.fzWidth, opt.fzThickness, BoardType.Layer);
br2.Position = new Vector3(max.x, min.y + frontShrink + thickness, max.z);
if (opt.FuZhuType === StripType.H)
{
br2 = Board.CreateBoard(size.x, opt.fzWidth, opt.fzThickness, BoardType.Layer);
br2.Position = new Vector3(max.x, min.y + frontShrink + thickness, max.z);
}
else
{
br2 = Board.CreateBoard(opt.fzWidth, size.x, opt.fzThickness, BoardType.Behind);
br2.Position = new Vector3(min.x, min.y + frontShrink + thickness + opt.fzThickness, max.z);
}
br2.Name = "上收口条";
}
}
@ -181,7 +189,10 @@ export class DrawClosingStrip implements Command
{
br = Board.CreateBoard(size.z, width, thickness, BoardType.Behind);
if (opt.isDrawFuZhu)
br2 = Board.CreateBoard(size.z, opt.fzWidth, opt.fzThickness, BoardType.Vertical);
if (opt.FuZhuType === StripType.V)
br2 = Board.CreateBoard(size.z, opt.fzWidth, opt.fzThickness, BoardType.Vertical);
else
br2 = Board.CreateBoard(size.z, opt.fzWidth, opt.fzThickness, BoardType.Behind);
}
else
br = Board.CreateBoard(size.z, width, thickness, BoardType.Vertical);
@ -194,7 +205,10 @@ export class DrawClosingStrip implements Command
pos.set(min.x - width, min.y + thickness + frontShrink, min.z);
if (opt.isDrawFuZhu)
{
br2.Position = min.clone().add(new Vector3(-opt.fzThickness, frontShrink + thickness));
if (opt.FuZhuType === StripType.V)
br2.Position = min.clone().add(new Vector3(-opt.fzThickness, frontShrink + thickness));
else
br2.Position = min.clone().add(new Vector3(- opt.fzWidth, frontShrink + thickness + opt.fzThickness));
br2.Name = "左收口条";
}
}
@ -212,7 +226,10 @@ export class DrawClosingStrip implements Command
pos.set(max.x, min.y + thickness + frontShrink, min.z);
if (opt.isDrawFuZhu)
{
br2.Position = min.clone().add(new Vector3(0, frontShrink + thickness)).setX(max.x);
if (opt.FuZhuType === StripType.V)
br2.Position = min.clone().add(new Vector3(0, frontShrink + thickness)).setX(max.x);
else
br2.Position = min.clone().add(new Vector3(0, frontShrink + thickness + opt.fzThickness)).setX(max.x);
br2.Name = "右收口条";
}
}
@ -240,6 +257,8 @@ export class DrawClosingStrip implements Command
br.Position = pos;
//更新总空间
totalSpace.union(br.BoundingBox);
if (br2)
totalSpace.union(br2.BoundingBox);
for (let b of brs)
{

@ -308,7 +308,7 @@ export const DefaultSingleBoardOption: SingleBoardOption = {
Object.freeze(DefaultSingleBoardOption);
export const DefaultClosingStripOption: ClosingStripOption = {
version: 4,
version: 5,
type: BoardType.Vertical,
name: "收口条", //辅助条占用
striptype: StripType.H,
@ -321,6 +321,7 @@ export const DefaultClosingStripOption: ClosingStripOption = {
fzThickness: 18,
addSKTCabinetName: true,
brName: "左收口条",
FuZhuType: StripType.V,
};
Object.freeze(DefaultClosingStripOption);

@ -128,6 +128,13 @@ export const ClosingStripModal =
)
}
</div>
<RadioGroup
onChange={e => opt.FuZhuType = e.currentTarget.value as StripType}
selectedValue={opt.FuZhuType}
>
<Radio label="横放" value={StripType.H} />
<Radio label="竖放" value={StripType.V} />
</RadioGroup>
</div>
);
}));

@ -18,7 +18,7 @@ import { ModalState } from '../Components/Modal/ModalInterface';
import { IModalResult } from '../Components/Modal/ModalsManage';
import { ToasterValueError } from '../Components/Toaster';
import { BoardProcessOption } from "./OptionInterface/BoardProcessOption";
import { ClosingStripOption } from "./OptionInterface/ClosingStripOption";
import { ClosingStripOption, StripType } from "./OptionInterface/ClosingStripOption";
import { AnyObject, BehindBoardOption, BoardConfigOption, IBaseOption, IDrawBoardAutoCutOption, IGrooveOption, IHightDrillOption, IUiOption, LayerBoardOption, LayerNailOption, SideBoardOption, SingleBoardOption, TBBoardOption, VerticalBoardOption } from "./OptionInterface/IOptionInterface";
import { BehindHeightPositon } from "./OptionInterface/OptionEnum";
@ -859,6 +859,11 @@ export class ClosingStripStore extends BoardStore<ClosingStripOption>
cof.option.version = 4;
this.ChangeBrName(cof);
}
if (cof.option.version < 5)
{
cof.option.FuZhuType = StripType.V;
cof.option.version = 5;
}
this.ChangeCabinetName(cof);
super.UpdateOption(cof);
}

@ -17,4 +17,5 @@ export interface ClosingStripOption extends BoardConfigOption
fzThickness: number;
addSKTCabinetName: boolean; //柜名加收口名称
brName: string;//收口条板名 name被辅助条占用
FuZhuType: StripType;//辅助条类型
}

Loading…
Cancel
Save