Skip to main content

order_edges

Function order_edges 

Source
pub fn order_edges(
    model: &Model,
    edges: &[Shape],
    tol: Tolerances,
) -> OgeomResult<Vec<Shape>>
Expand description

Put a bag of edges into an order that walks them end to end.

Reverses an edge where the chain reaches its far end first, so the result is a path rather than a set. make_wire then accepts it: it checks that consecutive edges meet, and a bag in the order it happened to be built in almost never does.

Follows the chain from one end. Where an end meets more than two edges the path is genuinely ambiguous (that is a branching network, not a wire), and this refuses rather than picking one, because picking one silently discards the branch nobody asked it to drop.

ยงErrors

OgeomError::Construction if the list is empty, an edge is unbounded, the edges do not form a single connected path, or a vertex joins three or more of them.