Add an algorithm to convert a surface mesh to a polyhedralsurface which preserves the topology

Description

At the moment, there are two algorithms which generate a polyhedralsurface from a cgal surface mesh:

  • extrude straight skeleton
  • split3D

The current mesh to polyhedral surface converter is quite simple: it converts each face into a patch. It works reliably, however, it has 2 side effects:

  • the resulted phs is triangulated: each patch is a triangle
  • the topology is not preserved. The phs does not contain any holes. The holes are visible but the polyhedralsurface is triangulated aroud the holes

This new algorithm preserves the tolopogy:

  • the output is not triangulated
  • the patches contain the holes

its implementation is quite simple:

  • perform a deep search to extract all the coplanar surfaces of the mesh. Each coplanar surface will be a patch
  • for each coplanar surface, extract the boundary cycles with PMP::extract_boundary_cycles:
    • if there is only one cycle, this is the exterior ring of the patch
    • if there are more than one hole, sort them by area. The largest one is the exterior ring. The other ones are the inner rings.

straight skeleton example

current algo

Capture_d_écran_du_2026-05-04_19-41-24

Capture_d_écran_du_2026-05-04_19-42-25

new algo

Capture_d_écran_du_2026-05-04_19-42-07

Capture_d_écran_du_2026-05-04_19-42-52

CI GitHub Status

  • MSYS2: MSYS2
  • VCPKG: Build with vcpkg
  • BSD: CI

Tests

  • Unit
  • C api

Merge request reports

Loading