P2.5.7 package-private curve DCEL (Option C, OV-P2 / Bar 2) - #38
Open
grootstebozewolf wants to merge 6 commits into
Open
P2.5.7 package-private curve DCEL (Option C, OV-P2 / Bar 2)#38grootstebozewolf wants to merge 6 commits into
grootstebozewolf wants to merge 6 commits into
Conversation
Half-edges, twins, next/prev, and incident faces on CurveSegmentString members. Faces assemble Geometry from the DCEL. Stamp coincident leave-angles and MIXED-hides-crossing. Not a noder, not OverlayNG-for-circles, not a public API. Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
atan2-sorted outgoing is CCW; the next slot after the twin is a right turn. Wire the previous slot so interiors sit on the left. Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
…cationtech#1226) Order outgoing halves by endpoint quadrant and orientation, not atan2 of subtracted direction vectors. Stamp TANGENT_LEAVE_ANGLE when that order ties, so distinct direction points do not collapse. Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
Chord coincidence stays on endpoint quadrant + orientation so locationtech#1224 distinct direction points do not collapse. Arc leaves still use the 1e-8 window: a rebuilt circumcircle can put an on-axis tangent in either adjacent quadrant. Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
Arc and chord membership compare dx²+dy² to R² / the projection with tolerance eps². Supersedes the hypot rewrite HOLD. leaveAngle and compareLeave are untouched. Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
eps² can sit below 1 ulp of R² (N=3 stadium nodes). Floor the squared compare at the representable gap of the two squares so hypot-exact nodes still sew. Still no hypot, no sagitta quotient. Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
This was referenced Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #37 (
cursor/p256-mixed-overlay-17ab@ bb566aa). OV-P2 / Bar 2. Option C only. Do not stack on #27 (OverlayNG-for-circles / publicSegmentKindis a dead-end draft). Do not merge this into #7. Does not merge #12 / #13 / #15 / #16 / #17 / #18 / #19 / #20 / #23 / #24 / #25 / #37 / #7. Does not push tofeature/sfa-curve-rgror master. Does not rebase #7 onto locationtech. Does not pick coreHalfEdge.java/Quadrant.java.Sentence
Curve DCEL for PLG/COV. Not a noder. Not OverlayNG-for-circles. Not public. Not a merge into #7.
PLG and COV do not need a noder (public or curve). They need an arrangement structure: half-edges, twins, next/prev, incident face, on
CurveSegmentStringmembers (an arc stays an arc).CurveSegmentNoderalready names leftover edges for overlay kits. That is a different product. This PR is the DCEL.SIGN retip (this tip)
CurveSegmentDcel.onStringstays in R². Supersedes the HOLD on the hypot rewrite. Not a new rung. Not full curve noding. No public noder. Option C HOLDS (package-private in jts-curve).(dx²+dy²)toR²with toleranceeps², floored at 1 ulp of the two squares so a representable on-circle node is not rejected. Nothypot(d) − R. Not a lengthepsond². Do not takesqrt(R). Do not divide by sagitta for the decision.dx²+dy² ≤ eps²).CurveSegmentDcelTestpins extreme sagittas in R²: flat sagitta → 0, and a high-sagitta case.leaveAngle/compareLeaveHOLD (endpoint quadrant +Orientation.index;atan2only 1e-8 window / sweep sense). Untouched.Tip:
2ef0bc6b.What this is
Package-private
CurveSegmentDcelinjts-curve. Built fromCurveSegmentStringmembers plus the P2.5.2 node set and already-named MIXED / shared-edge ends. Cycle order is the Faces left-most / next-outgoing walk, persisted as links (left face, CCW interiors).CurveSegmentFacesnow assembles Geometry from the DCEL's bounded faces; it is a consumer, not this product.Leave-angle robustness (locationtech locationtech#1224 / locationtech#1226)
This DCEL does not use core
HalfEdgeorQuadrant. It sorts its ownHalfleave direction and stampsTANGENT_LEAVE_ANGLE. Those locationtech fixes are ported into that walk only:atan2/==those deltas (Make HalfEdge.compareAngularDirection more robust locationtech/jts#1224).dx/dy(Improve Quadrant computation robustness by using vector endpoints locationtech/jts#1226).Orientation.index.TANGENT_LEAVE_ANGLEfires when that compare ties, or when an arc leave is inside the 1e-8 window (P2.5.4). Chord coincidence stays on the robust compare so Make HalfEdge.compareAngularDirection more robust locationtech/jts#1224-style distinct direction points do not collapse.DEVELOPING.mdand version history are untouched. CoreHalfEdge.java/Quadrant.javaare untouched.Honesty lock
Generic walk-on-
nodes==nullis unsafe: a MIXED abort can hide a real crossing (HALF_DISC × HALF_CROSSING_UPPER). That pair stampsMIXED_HIDES_CROSSINGand stops. A coincident leave-angle is snap-rounding (TANGENT_LEAVE_ANGLE). Pinch / kiss / holed Geometry-level staynull. No invented noder. No densify-then-snap flagged exact. No coreSegmentString/HotPixel/noding.snapround.Cells
TANGENT_LEAVE_ANGLEMIXED_HIDES_CROSSINGnulleps²); hypot HOLD supersededWhat this is not
CurveSegmentNoderstays nodes + named leftover edges for overlay kits.SegmentKind.org.locationtech.jts.operation.overlayng.curve.feature/sfa-curve-rgr/ PR SFA/SQL-MM curve awareness: Curve rename, arc-aware operations, OverlayNGCurve ratchet (#1195 RGR series) #7 / locationtech master.HalfEdge.java/Quadrant.java.Pins
CurveSegmentString(arc stays arc, chord stays chord).AvoidBranchingStatementAsLastInLoop).Verify
All green after this revision (
2ef0bc6b):CurveSegmentDcelTest10 / 0 (twins / next / face; P2.5.4 stamp; Make HalfEdge.compareAngularDirection more robust locationtech/jts#1224 leave-compare pin; extreme sagittas in R²)CurveSegmentStringTest24 / 0CompoundCurveShellOverlayTest28 / 0CircularArcOverlayTest11 / 0CircularDiscOverlayTest12 / 0CircularDiscPolygonOverlayTest7 / 0CircularLineOverlayTest7 / 0OverlayNGCurvePhase0Test19 / 0OverlayNGCurveRatchetTest50 / 0OverlayNGCurvePerfGateTest84 / 0 at 15% slackbash dev/check-no-curved.shOKjts-curve