fix #IKKTZ 修改真假交点判断

pull/68/head
Zoe 6 years ago
parent a96e55a20f
commit ed5b68c11c

@ -35,5 +35,5 @@ test('IKKGK圆与直线补圆弧', () =>
//圆丢失的问题 //圆丢失的问题
cus = pl.GetOffsetCurves(-1.926388985025112); cus = pl.GetOffsetCurves(-1.926388985025112);
expect(cus.length).toBe(2); expect(cus.length).toBe(1);
}); });

@ -257,17 +257,11 @@ export class PolyOffestUtil
else else
{ {
iPts = frontLine.IntersectWith(laterLine, IntersectOption.ExtendBoth); iPts = frontLine.IntersectWith(laterLine, IntersectOption.ExtendBoth);
//过滤掉交点为laterline终点的交点
tPts = iPts.filter(p => tPts = iPts.filter(p =>
(frontLine instanceof Arc || frontLine.GetParamAtPoint(p) > 0) frontLine.PtOnCurve(p)
&& (laterLine instanceof Arc || laterLine.GetParamAtPoint(p) < 1) && laterLine.PtOnCurve(p)
); );
// iPts = frontLine.IntersectWith(laterLine, IntersectOption.ExtendBoth);
// //过滤掉交点为laterline终点的交点
// tPts = iPts.filter(p =>
// frontLine.PtOnCurve(p)
// && laterLine.PtOnCurve(p)
// );
} }
if (tPts.length > 0)//存在真交点情况下直接修剪 if (tPts.length > 0)//存在真交点情况下直接修剪
@ -364,6 +358,10 @@ export class PolyOffestUtil
{ {
this.appendNewCuAndContour(frontLine, nextPt, intPt, startIndex); this.appendNewCuAndContour(frontLine, nextPt, intPt, startIndex);
} }
else if (frontLine instanceof Arc && par1 < 0 && par2 < 1)
{
this.appendNewCuAndContour(frontLine, nextPt, intPt, startIndex);
}
else if (frontLine instanceof Arc) else if (frontLine instanceof Arc)
{ {
this.fillArc(endIndex - 1, endIndex, nextPt, frontLine, laterLine); this.fillArc(endIndex - 1, endIndex, nextPt, frontLine, laterLine);

Loading…
Cancel
Save