Skip to main content

Module intersection_graph

Module intersection_graph 

Source

Structs§

IntersectionGraph
Everything classification and assembly need.
Piece
One output fragment: a sub-triangle of an arranged input triangle, or an untouched whole triangle. v is wound to match the input mesh’s outward orientation; vi are the interned ids of the same three vertices.
VertInterner
Exact-point interner: one id per distinct point, with two disjoint key spaces. f64-representable points (all input vertices, and any constructed point that rounds exactly) key on their coordinate bits — no rational hashing, so untouched input triangles intern for the cost of a HashMap probe. Only genuinely non-representable constructed points use the rational map. verts_f64 caches the correctly rounded approximation of every id (exact for bit-keyed points), which downstream float filters and output assembly reuse instead of re-rounding. Order invariance: both maps are probe-only (get/entry, never iterated); ids come from verts.len() at insertion time, so they depend only on the sequential call order, not on the hasher.

Functions§

build_graph
Build the intersection graph for soups p and q (each triangle wound outward; degenerate triangles are dropped here, paper §5).
build_graph_with_progress
build_graph_with_token that also reports its five phases to progress (see crate::progress). None is exactly build_graph_with_token: no counter is touched and no branch is taken inside any inner loop.
build_graph_with_token
build_graph with cooperative cancellation. Returns None when the token fires. Checks run per triangle in every phase and inside the arrangement sweeps — heavily self-intersecting inputs spend minutes in per-triangle quadratic loops, and a cancel that only top-level phases notice can overshoot its deadline by that much (Thingi10K #42211 ran 565 s past a 60 s cancel before this plumbing).
edge_key

Type Aliases§

EdgeKey
Canonical (sorted) edge between two interned vertex ids. Downstream stages (classify rings, propagate flood fill) key their maps on these integers instead of exact rational point pairs — vertex interning at piece-emission time makes id equality coincide with exact geometric identity.