Skip to main content

merge_coplanar_polygons

Function merge_coplanar_polygons 

Source
pub fn merge_coplanar_polygons<T: Number>(
    polygons: Vec<Polygon<T, 3>>,
) -> Vec<Polygon<T, 3>>
Expand description

Merge coplanar adjacent polygons that share edges.

Algorithm:

  1. Group polygons by quantised plane.
  2. For each coplanar group, build a directed-edge map.
  3. Greedily merge polygon pairs that share an edge (opposing directions).
  4. Repeat until no more merges are possible in that group.