Warn more about NaN
This commit is contained in:
parent
b67e8acca5
commit
8baf9518da
2 changed files with 5 additions and 0 deletions
|
@ -50,6 +50,9 @@ class ContourGeometry extends GeometryBase {
|
|||
return !this.m_points.length;
|
||||
}
|
||||
measureComplexity() {
|
||||
for (const z of this.m_points) {
|
||||
if (!isFinite(z.x) || !isFinite(z.y)) return 0xffff;
|
||||
}
|
||||
return this.m_points.length;
|
||||
}
|
||||
toShapeStringOrNull() {
|
||||
|
|
|
@ -157,10 +157,12 @@ class SpiroExpansionContext2 {
|
|||
if (this.nKnotsProcessed === 1) {
|
||||
const angle = computeNormalAngle(this.gizmo, arc.deriveX0, arc.deriveY0);
|
||||
if (isFinite(angle)) this.controlKnots[0].normalAngle = angle;
|
||||
else throw new Error("NaN angle detected.");
|
||||
}
|
||||
{
|
||||
const angle = computeNormalAngle(this.gizmo, arc.deriveX1, arc.deriveY1);
|
||||
if (isFinite(angle)) this.controlKnots[this.nKnotsProcessed].normalAngle = angle;
|
||||
else throw new Error("NaN angle detected.");
|
||||
}
|
||||
this.nKnotsProcessed += 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue