Skip to main content

ring_touches

Function ring_touches 

Source
pub fn ring_touches(rings: &Rings) -> GeomResult<Vec<RingTouch>>
Expand description

Every vertex lying inside another edge of rings, decided by the same exact orient2d tests with which triangulate_with under PinchPolicy::Accept inserts it into that edge (#265).

The triangulation then splits that edge at the vertex, so its ring edges are no longer the rings’ edges. A caller whose rings share their edges with neighbouring patches (the faces of a closed shell) splits the neighbour’s copy of each such edge at the same vertex, or the patches meet at a T-junction. Validation runs as in triangulate_with and in the same order, so the touches come in a deterministic order, each vertex and edge pair once; nothing is triangulated.

A ring with a seam run both ways (a keyhole, #270) is validated as triangulate_with validates it, without its seams: the touches are those of the loops the seams join, on their edges, which are the ring’s other edges. No vertex lies inside a seam, and a seam’s ends, where the ring meets itself, are shared vertices, not touches.

§Errors

As triangulate_with under PinchPolicy::Accept for rings that do not bound a region: too few, non-finite or repeated vertices, a ring folding back, rings that cross or overlap along an edge, a seam that is not one.