|
|
|
@ -70,6 +70,13 @@ class SetSmoothEdgeFaces extends BoardGetFace
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
override GetArcBoardFaces()
|
|
|
|
|
{
|
|
|
|
|
this.FaceSealingDataMap = new Map();
|
|
|
|
|
this.highSealingData = [];
|
|
|
|
|
this.sealCus = [];
|
|
|
|
|
super.GetArcBoardFaces(this.FaceSealingDataMap, this.highSealingData, this.sealCus);
|
|
|
|
|
}
|
|
|
|
|
GetSmoothFaces(bg: this, scale = 0)
|
|
|
|
|
{
|
|
|
|
|
for (let f1 of this.Faces)
|
|
|
|
@ -86,6 +93,10 @@ class SetSmoothEdgeFaces extends BoardGetFace
|
|
|
|
|
|
|
|
|
|
let localBoard = (f1.type !== f2.type && f1.type === BoardFaceType.NoSide) ? f1.LocalBoard : f2.LocalBoard;
|
|
|
|
|
|
|
|
|
|
let scaleCopy = scale;
|
|
|
|
|
if (f1.LocalBoard.IsArcBoard && f1.type === BoardFaceType.Side || f2.LocalBoard.IsArcBoard && f2.type === BoardFaceType.Side)
|
|
|
|
|
scaleCopy = 0;
|
|
|
|
|
|
|
|
|
|
let nor1 = new Vector3().setFromMatrixColumn(mtx, 2);
|
|
|
|
|
let nor2 = new Vector3().setFromMatrixColumn(mtx2, 2);
|
|
|
|
|
|
|
|
|
@ -107,7 +118,7 @@ class SetSmoothEdgeFaces extends BoardGetFace
|
|
|
|
|
let f2CoverBoxes = bg._CoveredWidthFaceMap.get(f2) ?? [];
|
|
|
|
|
if (f1.type === f2.type)
|
|
|
|
|
{
|
|
|
|
|
let intRes = f1.IsIntersect(f2, scale, f1CoverBoxes);
|
|
|
|
|
let intRes = f1.IsIntersect(f2, scaleCopy, f1CoverBoxes);
|
|
|
|
|
if (intRes.isInt)
|
|
|
|
|
{
|
|
|
|
|
this.SmoothFace.add(f1);
|
|
|
|
@ -116,7 +127,7 @@ class SetSmoothEdgeFaces extends BoardGetFace
|
|
|
|
|
else
|
|
|
|
|
this._CoveredWidthFaceMap.set(f1, intRes.coverBoxesList);
|
|
|
|
|
|
|
|
|
|
intRes = f2.IsIntersect(f1, scale, f2CoverBoxes);
|
|
|
|
|
intRes = f2.IsIntersect(f1, scaleCopy, f2CoverBoxes);
|
|
|
|
|
if (intRes.isInt)
|
|
|
|
|
{
|
|
|
|
|
bg.SmoothFace.add(f2);
|
|
|
|
@ -127,7 +138,7 @@ class SetSmoothEdgeFaces extends BoardGetFace
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
let intRes = f1.IsIntersect(f2, scale, f1.type === BoardFaceType.Side ? f1CoverBoxes : f2CoverBoxes);
|
|
|
|
|
let intRes = f1.IsIntersect(f2, scaleCopy, f1.type === BoardFaceType.Side ? f1CoverBoxes : f2CoverBoxes);
|
|
|
|
|
if (intRes.isInt)
|
|
|
|
|
{
|
|
|
|
|
if (f1.type === BoardFaceType.Side)
|
|
|
|
@ -183,6 +194,32 @@ class SetSmoothEdgeFaces extends BoardGetFace
|
|
|
|
|
SetBoardTopDownLeftRightSealData(this.Board, this.highSealingData, this.sealCus);
|
|
|
|
|
this.Board.BoardProcessOption.highSealed = this.highSealingData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WriteArcBoardSealingData(option: ISmoothEdgeOption)
|
|
|
|
|
{
|
|
|
|
|
let useIndex = new Set<number>();
|
|
|
|
|
|
|
|
|
|
for (let f of this.Faces)
|
|
|
|
|
{
|
|
|
|
|
if (f.type === BoardFaceType.Side && this.SmoothFace.has(f))
|
|
|
|
|
{
|
|
|
|
|
let index = this.FaceSealingDataMap.get(f);
|
|
|
|
|
if (index !== undefined)
|
|
|
|
|
{
|
|
|
|
|
this.highSealingData[index].size = option.edge;
|
|
|
|
|
useIndex.add(index);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (let i = 0; i < this.highSealingData.length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (!useIndex.has(i))
|
|
|
|
|
this.highSealingData[i].size = option.smoothEdge;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetBoardTopDownLeftRightSealData(this.Board, this.highSealingData, this.sealCus);
|
|
|
|
|
this.Board.BoardProcessOption.highSealed = this.highSealingData;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function SetSmoothEdges(brs: Board[], option: ISmoothEdgeOption)
|
|
|
|
@ -220,6 +257,9 @@ export function SetSmoothEdges(brs: Board[], option: ISmoothEdgeOption)
|
|
|
|
|
|
|
|
|
|
for (let brGe of BoardGeList)
|
|
|
|
|
{
|
|
|
|
|
if (brGe.Board.IsArcBoard)
|
|
|
|
|
brGe.WriteArcBoardSealingData(option);
|
|
|
|
|
else
|
|
|
|
|
brGe.WriteSealingData(option);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|