[geos-commits] [SCM] GEOS branch main updated. e8d427e4f8d323b68a8f1f6d2c99e68522ec16d2
git at osgeo.org
git at osgeo.org
Fri Oct 2 05:51:19 PDT 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, main has been updated
via e8d427e4f8d323b68a8f1f6d2c99e68522ec16d2 (commit)
from cc9a3cc95d160c58a68ded58fb6b83935ca856fe (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e8d427e4f8d323b68a8f1f6d2c99e68522ec16d2
Author: Daniel Baston <dbaston at gmail.com>
Date: Fri Oct 2 08:50:38 2026 -0400
CircularArcIntersector: Avoid incorrectly classifying intersection as cocircular (#1549)
diff --git a/src/algorithm/CircularArcIntersector.cpp b/src/algorithm/CircularArcIntersector.cpp
index f08bafa54..d503fb384 100644
--- a/src/algorithm/CircularArcIntersector.cpp
+++ b/src/algorithm/CircularArcIntersector.cpp
@@ -229,16 +229,16 @@ CircularArcIntersector::intersects(const CircularArc& arc1, const CircularArc& a
return;
}
- // a: the distance from c1 to the "radical line", which connects the two intersection points
- // Expression rewritten by Herbie, https://herbie.uwplse.org/demo/
- // const double a = (d*d + r1*r1 - r2*r2) / (2*d);
- const double a = std::fma(r1-r2, (r1 + r2) / (d+d), d*0.5);
-
// TODO because the circle center calculation is inexact we need some kind of tolerance here.
// Take a PrecisionModel like LineIntersector?
- if (a == 0 || (d == 0 && r1 == r2)) {
+ if (d == 0 && r1 == r2) {
computeCocircularIntersection(arc1, arc2);
} else {
+ // a: the distance from c1 to the "radical line", which connects the two intersection points
+ // Expression rewritten by Herbie, https://herbie.uwplse.org/demo/
+ // const double a = (d*d + r1*r1 - r2*r2) / (2*d);
+ const double a = std::fma(r1-r2, (r1 + r2) / (d+d), d*0.5);
+
// Compute interior intersection points.
const double dx = c2.x-c1.x;
const double dy = c2.y-c1.y;
diff --git a/tests/unit/algorithm/CircularArcIntersectorTest.cpp b/tests/unit/algorithm/CircularArcIntersectorTest.cpp
index 6e5805b08..63695fb9b 100644
--- a/tests/unit/algorithm/CircularArcIntersectorTest.cpp
+++ b/tests/unit/algorithm/CircularArcIntersectorTest.cpp
@@ -1811,6 +1811,18 @@ void object::test<90>()
XY{208, 22});
}
+template<>
+template<>
+void object::test<91>()
+{
+ set_test_name("two arcs with interior intersection at control point");
+
+ checkIntersection(XY{-5, 0}, XY{0, 5}, XY{5, 0},
+ XY{-7, 0}, XY{-3, 4}, XY{1, 0},
+ CircularArcIntersector::ONE_POINT_INTERSECTION,
+ XY{-3, 4});
+}
+
// TODO: check Z values of arc result centerpoints
// TODO: add tests for seg/seg
-----------------------------------------------------------------------
Summary of changes:
src/algorithm/CircularArcIntersector.cpp | 12 ++++++------
tests/unit/algorithm/CircularArcIntersectorTest.cpp | 12 ++++++++++++
2 files changed, 18 insertions(+), 6 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list