From 9e7901aa7c3d27fce55af632541c73abbf166e39 Mon Sep 17 00:00:00 2001 From: Chlumsky Date: Fri, 20 Jun 2025 16:40:02 +0200 Subject: [PATCH] Partial revert of cubic curve distance --- core/edge-segments.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/edge-segments.cpp b/core/edge-segments.cpp index 169837a..9935cdd 100644 --- a/core/edge-segments.cpp +++ b/core/edge-segments.cpp @@ -255,11 +255,11 @@ SignedDistance CubicSegment::signedDistance(Point2 origin, double ¶m) const break; qe = qa+3*t*ab+3*t*t*br+t*t*t*as; d1 = 3*ab+6*t*br+3*t*t*as; - } - double distance = qe.length(); - if (distance < fabs(minDistance)) { - minDistance = nonZeroSign(crossProduct(d1, qe))*distance; - param = t; + double distance = qe.length(); + if (distance < fabs(minDistance)) { + minDistance = nonZeroSign(crossProduct(d1, qe))*distance; + param = t; + } } }