!746 优化多段线求交时的参数返回

pull/746/MERGE
ChenX 5 years ago
parent 4a1a56d038
commit bd26153954

@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`布尔_误差共线_误差交点 1`] = `739590.0297771678`; exports[`布尔_误差共线_误差交点 1`] = `739590.0293744556`;
exports[`布尔_误差共线_误差交点 2`] = `739582.752529773`; exports[`布尔_误差共线_误差交点 2`] = `739582.752084238`;

@ -204,7 +204,7 @@ exports[`极限刀半径#I11UDE: 曲线长度 3`] = `10.71238898038469`;
exports[`极限刀半径#I11UDE: 曲线长度 4`] = `10.71238898038469`; exports[`极限刀半径#I11UDE: 曲线长度 4`] = `10.71238898038469`;
exports[`极限刀半径#I11UDE: 曲线长度 5`] = `10.71238898038521`; exports[`极限刀半径#I11UDE: 曲线长度 5`] = `10.71238898038469`;
exports[`极限刀半径#I11UDE: 曲线长度 6`] = `10.712388980384734`; exports[`极限刀半径#I11UDE: 曲线长度 6`] = `10.712388980384734`;
@ -442,7 +442,7 @@ exports[`造型的外框和内框厚度等于刀直径: 曲线长度 2`] = `1468
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 3`] = `10.71238898038469`; exports[`造型的外框和内框厚度等于刀直径: 曲线长度 3`] = `10.71238898038469`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 4`] = `10.712388980384869`; exports[`造型的外框和内框厚度等于刀直径: 曲线长度 4`] = `10.71238898038469`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 5`] = `10.71238898038469`; exports[`造型的外框和内框厚度等于刀直径: 曲线长度 5`] = `10.71238898038469`;

@ -65,11 +65,11 @@ function CheckPointOnCurve(intRes: IntersectResult[], c1: Curve, c2: Curve, extT
return intRes.filter(r => return intRes.filter(r =>
{ {
if (!(extType & IntersectOption.ExtendThis)) if (!(extType & IntersectOption.ExtendThis))
if (!c1.PtOnCurve3(r.pt, tolerance)) if (!c1.ParamOnCurve(r.thisParam, tolerance))
return false; return false;
if (!(extType & IntersectOption.ExtendArg)) if (!(extType & IntersectOption.ExtendArg))
if (!c2.PtOnCurve3(r.pt, tolerance)) if (!c2.ParamOnCurve(r.argParam, tolerance))
return false; return false;
return true; return true;
}); });
@ -428,14 +428,12 @@ export function IntersectPolylineAndCurve(pl: Polyline, cu: Curve, extType: Inte
{ {
return { return {
pt: r.pt, pt: r.pt,
thisParam: pl.GetParamAtPoint(r.pt), thisParam: i + r.thisParam,
argParam: cu.GetParamAtPoint(r.pt), argParam: j + r.argParam,
}; };
})); }));
} }
} }
intRes.sort((r1, r2) => comparePoint("xyz")(r1.pt, r2.pt));
arrayRemoveDuplicateBySort(intRes, (r1, r2) => equalv3(r1.pt, r2.pt));
return intRes; return intRes;
} }

Loading…
Cancel
Save