!761 修复差集问题

pull/761/MERGE
ZoeLeeFZ 5 years ago committed by ChenX
parent 6c1dddd57d
commit 50710f1342

@ -273,7 +273,6 @@ export class Shape
//如果完全被减掉,就返回0个.其他的返回1个或者n个
SubstactBoolOperation(targetShape: Shape): Shape[]
{
let resOutlines = this._Outline.SubstactBoolOperation(targetShape._Outline);
let shapes: Shape[] = [];
//如果相减,则需要取出被减面域和减数面域的洞的交集,结果还需减去被减面域的全部孔洞
targetShape._Holes.forEach(cu =>
@ -283,8 +282,11 @@ export class Shape
shapes.push(...Shape.pairHoleAndOutline(this.targetOutlineSubHoleOutline(tmpInterList, this._Holes)));
});
let fCus = this.targetOutlineSubHoleOutline(resOutlines, Shape.mergeContours([...this._Holes, ...targetShape._Holes]));
let fCus: Contour[];
if (this.Holes.length > 0)
fCus = this.targetOutlineSubHoleOutline([this._Outline], Shape.mergeContours([targetShape._Outline, ...this._Holes]));
else
fCus = this._Outline.SubstactBoolOperation(targetShape._Outline);
shapes.push(...Shape.pairHoleAndOutline(fCus));
return shapes;
}

Loading…
Cancel
Save