Reintroduce improved logic for mesh interior region fill determination (#4464)

This commit is contained in:
Keavon Chambers
2026-09-15 22:56:38 +02:00
committed by Dennis Kobert
parent 1420ba799a
commit 50cda6b134
6 changed files with 649 additions and 59 deletions

View File

@@ -23,6 +23,10 @@ fn path_modify<'e>(
modification.apply(&mut element);
}
// Users draw subpaths in arbitrary winding directions, so normalize them here rather than
// letting the drawn direction decide fill insideness downstream
element.normalize_winding_directions();
// Set the path to the encapsulating subgraph (drop our own trailing entry from `node_path`),
// matching the `path_of_subgraph` proto so editor tools can route data back to the parent layer.
let path = match existing.is_empty() {

View File

@@ -1475,9 +1475,11 @@ pub(crate) fn replace_with_polygons(vector: &mut Vector, polygons: Vec<Vec<DVec2
if start == end {
continue;
}
// Emit shared walls in index-canonical direction: a cycle can't be monotone in point index,
// so no cell's boundary can wind coherently and read as deliberate negative space
let edge = if start < end { (start, end) } else { (end, start) };
if seen_edges.insert(edge) {
segment_domain.push(next_segment.next_id(), start, end, BezierHandles::Linear);
segment_domain.push(next_segment.next_id(), edge.0, edge.1, BezierHandles::Linear);
}
}
}