|
|
|
@ -1055,12 +1055,13 @@ export class PolyOffestUtil3
|
|
|
|
|
{
|
|
|
|
|
private m_Polyline: Polyline;
|
|
|
|
|
private m_OffestDist: number;
|
|
|
|
|
offDir: number;
|
|
|
|
|
private m_OffDir: number;
|
|
|
|
|
private IsKeepAllCurves = false;
|
|
|
|
|
constructor(pl: Polyline, offest: number)
|
|
|
|
|
{
|
|
|
|
|
this.m_Polyline = pl;
|
|
|
|
|
this.m_OffestDist = offest;
|
|
|
|
|
this.offDir = Math.sign(this.m_OffestDist) * Math.sign(this.m_Polyline.Area2);
|
|
|
|
|
this.m_OffDir = Math.sign(this.m_OffestDist) * Math.sign(this.m_Polyline.Area2);
|
|
|
|
|
}
|
|
|
|
|
//偏移
|
|
|
|
|
GetOffsetCurves(): Curve[]
|
|
|
|
@ -1083,12 +1084,18 @@ export class PolyOffestUtil3
|
|
|
|
|
let cus = this.trimByContours(newPls, contours);
|
|
|
|
|
|
|
|
|
|
// return cus;
|
|
|
|
|
if (this.m_Polyline.IsClose && this.offDir < 0)
|
|
|
|
|
if (this.m_Polyline.IsClose && this.m_OffDir < 0)
|
|
|
|
|
{
|
|
|
|
|
cus = cus.filter(pl => isTargetCurInSourceCur(this.m_Polyline, pl))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this.linkSelfingCurves(cus);
|
|
|
|
|
if (this.IsKeepAllCurves)
|
|
|
|
|
{
|
|
|
|
|
return this.linkSelfingCurves(cus);
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
return this.linkSelfingCurves(cus);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//偏移曲线
|
|
|
|
@ -1286,6 +1293,7 @@ export class PolyOffestUtil3
|
|
|
|
|
buildArcJoinList(cir2, laterLine.StartPoint);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 补完圆弧直接退出函数
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1427,9 +1435,9 @@ export class PolyOffestUtil3
|
|
|
|
|
|
|
|
|
|
if (equaln(parForFront, 0))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//理论应该把该段移除出来
|
|
|
|
|
}
|
|
|
|
|
else if (equaln(parForFront, 1))
|
|
|
|
|
else if (equaln(parForFront, 1, 1e-6))
|
|
|
|
|
{
|
|
|
|
|
pl.Join(frontLine);
|
|
|
|
|
}
|
|
|
|
@ -1440,7 +1448,7 @@ export class PolyOffestUtil3
|
|
|
|
|
cus.unshift(spliteCusForFront[1]);
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
if (equaln(parForLater, 0))
|
|
|
|
|
if (equaln(parForLater, 0, 1e-6))
|
|
|
|
|
frontLine = cus.splice(j, 1)[0];
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|