Skip to content

SurfacePoint::inEdge: fix reversed tEdge for Vertex-typed points#248

Open
designbynumbers wants to merge 1 commit into
nmwsharp:masterfrom
designbynumbers:fix/surfacepoint-inedge-245
Open

SurfacePoint::inEdge: fix reversed tEdge for Vertex-typed points#248
designbynumbers wants to merge 1 commit into
nmwsharp:masterfrom
designbynumbers:fix/surfacepoint-inedge-245

Conversation

@designbynumbers
Copy link
Copy Markdown

Minimal two-line fix for #245.

SurfacePoint::inEdge on a Vertex-typed point returns the reflected edge
parameter — tEdge=1 for edge.halfedge().tailVertex(), 0 for the tip —
which contradicts the rest of surface_point.ipp (interpolate, the
SurfacePoint(Edge, double) ctor, nearestVertex), where tEdge=0 is the tail
and tEdge=1 is the tip. Downstream this mis-places every shared-edge
insertVertex(SurfacePoint(edge, t)) at parameter (1 - t) instead of t,
producing visible Steiner drift in an intrinsic-triangulation pipeline.

The fix swaps the two return values so the Vertex-typed branch matches the
documented convention.

Full writeup + single-triangle MWE: #245.

Note: I noticed the (unmerged) int-tri-updates branch reworks inEdge more
broadly — happy to defer to that approach if you'd rather pick it back up; this
is just the minimal correctness fix against current master.

Fixes #245.

The Vertex-typed branch returned the reflected edge parameter (tEdge=1 for the
tail vertex, 0 for the tip), contradicting SurfacePoint::interpolate's
convention (tEdge=0 at edge.halfedge().tailVertex(), 1 at the tip). This drove
an off-by-reflection placement in
IntegerCoordinatesIntrinsicTriangulation::computeEdgeSplitData's shared-edge
(normalCoordinates < 0) branch, so every insertVertex on a shared intrinsic
edge landed at parameter (1-t) instead of t.

Upstream report: nmwsharp#245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SurfacePoint::inEdge Vertex-typed returns reflected tEdge (master); int-tri-updates has a fix

1 participant