cgal icon indicating copy to clipboard operation
cgal copied to clipboard

[PMP] Approximate convex decomposition

Open soesau opened this issue 7 months ago • 29 comments

Summary of Changes

Reimplementation of https://github.com/kmammou/v-hacd Performs approximate convex decomposition of an input mesh based on a voxelization and hierarchical decomposition.

~~Although it could have added to the package Convex Decomposition of Polyhedra it was decided to add it to the package Polygon Mesh Processing.~~ Finally we decided that it gets added to Convex Decomposition of Polyhedra

Release Management

TODO

  • [x] cite: Khaled Mamou. “Volumetric Hierarchical Approximate Convex Decomposition”. In Game Engine Gems 3, A K Peters, 2016, pp. 141–158. (It would be usefull if you find a pdf of it)
  • [ ] Eventually cite: https://arxiv.org/pdf/2205.02961 (optional, it's a possible improvement)
  • [x] Produce a plugin for the demo
  • [x] Produce a postprocess to refine the convex hull to avoid an offset compare to the original mesh (optional)

soesau avatar Jun 13 '25 13:06 soesau

The dependency to Surface_mesh will be removed later.

soesau avatar Jun 13 '25 14:06 soesau

/build:v0

soesau avatar Jul 07 '25 11:07 soesau

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8935/v0/Manual/index.html

github-actions[bot] avatar Jul 07 '25 11:07 github-actions[bot]

/force-build:v0

soesau avatar Jul 07 '25 13:07 soesau

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8935/v0/Manual/index.html

github-actions[bot] avatar Jul 07 '25 13:07 github-actions[bot]

depends on #8954 to eliminate the package dependency on Surface_mesh

soesau avatar Jul 07 '25 13:07 soesau

Warnings in PMP tests/exs in CGAL-6.1-Ic-191

sloriot avatar Jul 08 '25 05:07 sloriot

Error here

sloriot avatar Aug 19 '25 16:08 sloriot

This is the output I get for the elephant. Is it expected? image

sloriot avatar Aug 20 '25 12:08 sloriot

Error here

is this fixed also?

sloriot avatar Sep 10 '25 14:09 sloriot

Successfully tested in CGAL-6.2-Ic-4

sloriot avatar Sep 23 '25 17:09 sloriot

Review on the feature results:

  • cite: Khaled Mamou. “Volumetric Hierarchical Approximate Convex Decomposition”. In Game Engine Gems 3, A K Peters, 2016, pp. 141–158. (It would be usefull if you find a pdf of it)
  • Eventually cite: https://arxiv.org/pdf/2205.02961
  • Produce a plugin for the demo
  • Produce a postprocess to refine the convex hull to avoid an offset compare to the original mesh. Example:
component_present_an_offset
  • Some components are mostly outside of the original mesh and lead to bad approximation. An example of the decomposition in 100 convexes:

Input mesh: input_mesh The decomposition: decompose_in_100parts

-Another example of a component mostly outisde the mesh. The input mesh input_mesh The decomposition in 8 parts: decomposition_in_16_parts The outside part alone: The problematic part alone

-The decomposition are done with axis-aligned plane leading to unsatisfying result on feature non-axis aligned (This default is shared by all existing methods):

Three beams at 45°: convex7 Decompose in 3 parts: convex6

LeoValque avatar Oct 31 '25 13:10 LeoValque

This pull-request was previously marked with the label Tested, but has been modified with new commits. That label has been removed.

github-actions[bot] avatar Nov 12 '25 16:11 github-actions[bot]

/build:v0

soesau avatar Nov 20 '25 13:11 soesau

There was an error while building the doc:

/home/runner/work/cgal/cgal/Polygon_mesh_processing/doc/Polygon_mesh_processing/examples.txt:60: warning: included file Polygon_mesh_processing/approximate_convex_decomposition.cpp is not found. Check your EXAMPLE_PATH

https://github.com/CGAL/cgal/actions/runs/19538932467

github-actions[bot] avatar Nov 20 '25 13:11 github-actions[bot]

/build:v0

soesau avatar Nov 20 '25 14:11 soesau

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8935/v0/Manual/index.html

github-actions[bot] avatar Nov 20 '25 14:11 github-actions[bot]

/build:v0

soesau avatar Nov 20 '25 14:11 soesau

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8935/v0/Manual/index.html

github-actions[bot] avatar Nov 20 '25 14:11 github-actions[bot]

/build:v0

soesau avatar Nov 21 '25 13:11 soesau

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8935/v0/Manual/index.html

github-actions[bot] avatar Nov 21 '25 13:11 github-actions[bot]

/build:v0

soesau avatar Nov 21 '25 13:11 soesau

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8935/v0/Manual/index.html

github-actions[bot] avatar Nov 21 '25 13:11 github-actions[bot]

/build:v0

soesau avatar Nov 21 '25 13:11 soesau

The documentation is built. It will be available, after a few minutes, here: https://cgal.github.io/8935/v0/Manual/index.html

github-actions[bot] avatar Nov 21 '25 14:11 github-actions[bot]

I had thought that the vertices of the decomposition are all input vertices. Is the current solution (intersection points between voxels and triangles) also what is done in the original paper?

afabri avatar Dec 02 '25 07:12 afabri

The voxels are entirely from the voxel grid or optionally from vertices or mesh with box intersections when the refitting option is chosen. In the reference implementation, they do optionally a shrink wrap at the end. If this is not done, the vertices are entirely from the voxel grid.

soesau avatar Dec 02 '25 08:12 soesau

So when using Epick things can go wrong with intersection points computed. Do you make sanity checks, .e.g. the intersection point is inside the dilated voxel ?

afabri avatar Dec 02 '25 08:12 afabri

I use the AABB_tree for collecting all intersections inside an Iso_cuboid_3. I do some simple checks for which corners of the voxel grid I also have to include for the ch3.

soesau avatar Dec 02 '25 09:12 soesau

/build:v0

soesau avatar Dec 15 '25 14:12 soesau