Skip to main content

Module sew

Module sew 

Source
Expand description

Joining loose topology: ordering a bag of edges into a wire, and sewing free faces into a shell.

Both exist because geometry arrives disconnected. An imported file gives a pile of faces that touch but share nothing; a sketch gives edges in whatever order they were drawn. Topologically these are unrelated pieces, and every algorithm that walks a boundary treats them that way: a shell of faces that merely abut has a free edge everywhere two of them meet, encloses no volume, and cannot be classified against.

§Sewing is a topological operation, not a geometric one

It does not move anything. Two edges within tolerance of each other are decided to be one edge, and every face that used either uses that one, so the shell closes because the topology says so, not because the geometry was nudged until it did. A version that moved geometry to close gaps would be a repair, would need to decide which of two positions is right, and would quietly invalidate every tolerance in the neighbourhood.

What it will not do is claim a closure it did not achieve. Faces that do not meet within tolerance stay in separate shells, and the result says how many there are.

Modules§

roles
Roles sewing assigns.

Structs§

Agreement
How faces turn so that every edge two of them walk is walked once each way, and the runs of faces that edges join.
Sewn
What sewing produced.

Functions§

agreeing_orientation
Which of faces to turn so that every edge two of them share is walked once each way, or None where no turning does (a band with a half twist).
make_wire_unordered
Build a wire from edges in any order.
order_edges
Put a bag of edges into an order that walks them end to end.
sew
Sew free faces into shells by finding the edges they share.
sew_around
Sew faces of which some already share their edges and vertices with every neighbour and are to be passed through as they stand.
sew_around_within
Sew faces of which some are settled, as sew_around, across a gap of up to gap as sew_within sews: the edge kept, and the vertices it ends on, widen to reach the edge they replace.
sew_within
Sew faces whose edges meet across a gap of up to gap.