Skip to main content

arrange

Function arrange 

Source
pub fn arrange(
    points: &mut ExactPoints,
    segments: &[Segment],
    budget: &mut PairBudget,
    declared_bytes: usize,
    options: &ExecutionOptions,
) -> GeomResult<Arrangement>
Expand description

Cut segments into pieces.

Every examined pair of segments counts against budget. Every crossing and every T-junction split is charged: refused with BudgetExceeded for memory when declared_bytes, plus CROSSING_SCRATCH_BYTES for each crossing (the next one included), plus SPLIT_SCRATCH_BYTES for each split, exceeds options.memory_budget_bytes(). declared_bytes is what the caller has declared per element of its own input. Cancellation is checked per segment.

Input contract: the ends are points of points, a segment may repeat no end and may not be empty, and segments may cross, touch, share an end or overlap in any way. Two segments that share a PointId and lie on one line are cut where one’s other end lies strictly inside the other. Two identical segments yield one piece with both as carriers.