|
|
|
@ -54,14 +54,17 @@ export class DrawLatticeDrawerTool extends Singleton
|
|
|
|
|
let position = space.SpaceBox.min.clone();
|
|
|
|
|
|
|
|
|
|
let verBr = Board.CreateBoard(size.z, size.y, config.thickness, BoardType.Vertical);
|
|
|
|
|
this.WriteBoardProcessOption(verBr);
|
|
|
|
|
//分析切角圆弧的结果
|
|
|
|
|
let res = this.ParseArcLenOrObliuqeAng(verBr);
|
|
|
|
|
if (!res) return;
|
|
|
|
|
if (!res)
|
|
|
|
|
{
|
|
|
|
|
this.End();
|
|
|
|
|
return;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.ParseBrTooth(verBr);
|
|
|
|
|
this.ParseHighSealing(verBr, config.leftSealed, config.rightSealed, config.upSealed, config.downSealed, false);
|
|
|
|
|
|
|
|
|
|
this.WriteBoardProcessOption(verBr);
|
|
|
|
|
for (let i = 1; i < config.widthCount; i++)
|
|
|
|
|
{
|
|
|
|
|
let br = verBr.Clone();
|
|
|
|
@ -74,10 +77,9 @@ export class DrawLatticeDrawerTool extends Singleton
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let beBr = Board.CreateBoard(size.z, size.x, config.thickness, BoardType.Behind);
|
|
|
|
|
this.WriteBoardProcessOption(beBr);
|
|
|
|
|
this.ParseBrTooth(beBr);
|
|
|
|
|
this.ParseHighSealing(beBr, config.leftSealed, config.rightSealed, config.upSealed, config.downSealed, true);
|
|
|
|
|
|
|
|
|
|
this.WriteBoardProcessOption(beBr);
|
|
|
|
|
for (let i = 1; i < config.depthCount; i++)
|
|
|
|
|
{
|
|
|
|
|
let br = beBr.Clone();
|
|
|
|
@ -229,27 +231,26 @@ export class DrawLatticeDrawerTool extends Singleton
|
|
|
|
|
if (config.isOpenCut)
|
|
|
|
|
{
|
|
|
|
|
if (config.upCut > size.z || config.downCut > size.z)
|
|
|
|
|
{
|
|
|
|
|
log("切角过大");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
if (config.upCut < 1 || config.downCut < 1)
|
|
|
|
|
{
|
|
|
|
|
log("切角过小");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
let cu = br.ContourCurve as Polyline;
|
|
|
|
|
cu.AddVertexAt(3, new Vector2(config.upCut, br.Height));
|
|
|
|
|
cu.SetPointAt(4, new Vector2(0, br.Height - config.downCut));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (config.arcLen > size.z)
|
|
|
|
|
if (config.arcLen > size.z || config.arcLen > size.y)
|
|
|
|
|
{
|
|
|
|
|
log("圆弧角过大");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
let cu = br.ContourCurve as Polyline;
|
|
|
|
|
if (config.arcLen === 0)
|
|
|
|
|
{
|
|
|
|
|
log("圆弧角为0");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
cu.AddVertexAt(3, new Vector2(config.arcLen, br.Height));
|
|
|
|
|
cu.SetBulgeAt(3, Math.tan(Math.PI / 8));
|
|
|
|
|
cu.SetPointAt(4, new Vector2(0, br.Height - config.arcLen));
|
|
|
|
|