Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSoC2023 - ACVD for Simplification & Remeshing #7837

Open
wants to merge 116 commits into
base: master
Choose a base branch
from

Conversation

hoskillua
Copy link
Member

@hoskillua hoskillua commented Oct 31, 2023

Release Management

TODO

  • remove commit introducing interpolated_corrected_curvatures.h after the merge of the gsoc2022 branch
  • remove qem_metrics.h and types.h from history (for @sloriot)
  • check branch size (for @sloriot)
  • handle interpolated curvature update (for @sloriot)
  • debug the QEM minimization implementation (for @hoskillua)
  • test the other versions as possibly some cases produce bad results (for @hoskillua)
  • code cleanup (especially the logic for computing energy difference on edge and moving an element for @hoskillua )
  • recompute the energy after each convergence (for @hoskillua)
  • add concurrency flag (optional @sloriot)
  • better initialisation
  • get rid of duplicated implementation (keep only qem one)

)
{
typedef typename boost::graph_traits<PolygonMesh>::face_descriptor Face_descriptor;
typedef typename boost::graph_traits<PolygonMesh>::vertex_descriptor Vertex_descriptor;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means that the dependency on Eigen in the CMakeLists.txt can be removed.

@sloriot

This comment was marked as outdated.

This comment was marked as outdated.

@sloriot

This comment was marked as outdated.

This comment was marked as outdated.

@sloriot

This comment was marked as outdated.

This comment was marked as outdated.

@sloriot

This comment was marked as outdated.

This comment was marked as outdated.

Comment on lines 171 to 185
This method is a vertex clustering based remeshing algorithm. It is based on
\cgalCite{cgal:vc-acvdupmc-04} and extended in \cgalCite{cgal:audette2011approach} and \cgalCite{cgal:vcp-grtmmdvd-08}.

The function `CGAL::Polygon_mesh_processing::approximated_centroidal_Voronoi_diagram_remeshing()` takes as input a triangle mesh and
the expected number of output vertices, and it updates the mesh with the remeshed version.
The number of vertices in the output mesh might be larger than the input parameters if the input is not closed
or if the budget of points provided is too low to generate a manifold output mesh.
Note that providing an initial low number of vertices will affect the uniformity of the output triangles
in case some extra points are added to make the output manifold. The algorithm is similar to Lloyd's algorithm
(or k-means) where some random input vertices are picked to initialize clusters of vertices, and then clusters
are grown to minimize a particular energy, until convergence. Upon convergence, output vertices are computed
from the vertices of each cluster. If the input mesh contains some sharp features or corners, it is possible
to use the quadric error metrics to either move output vertices (fast but can produce bad looking triangles),
of to use the quadric error metrics directly in the energy formulation of each cluster (slower but produces
better quality triangles). It is also possible to use an adaptive remeshing based on curvature.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This method is a vertex clustering based remeshing algorithm. It is based on
\cgalCite{cgal:vc-acvdupmc-04} and extended in \cgalCite{cgal:audette2011approach} and \cgalCite{cgal:vcp-grtmmdvd-08}.
The function `CGAL::Polygon_mesh_processing::approximated_centroidal_Voronoi_diagram_remeshing()` takes as input a triangle mesh and
the expected number of output vertices, and it updates the mesh with the remeshed version.
The number of vertices in the output mesh might be larger than the input parameters if the input is not closed
or if the budget of points provided is too low to generate a manifold output mesh.
Note that providing an initial low number of vertices will affect the uniformity of the output triangles
in case some extra points are added to make the output manifold. The algorithm is similar to Lloyd's algorithm
(or k-means) where some random input vertices are picked to initialize clusters of vertices, and then clusters
are grown to minimize a particular energy, until convergence. Upon convergence, output vertices are computed
from the vertices of each cluster. If the input mesh contains some sharp features or corners, it is possible
to use the quadric error metrics to either move output vertices (fast but can produce bad looking triangles),
of to use the quadric error metrics directly in the energy formulation of each cluster (slower but produces
better quality triangles). It is also possible to use an adaptive remeshing based on curvature.
This remeshing algorithm uses clustering on polygonal meshes as to approximate a Centroidal Voronoi Diagram construction.
It is inspired by the method presented in \cgalCite{cgal:vc-acvdupmc-04} and further developed in \cgalCite{cgal:audette2011approach} and \cgalCite{cgal:vcp-grtmmdvd-08}.
The algorithm is similar to Lloyd's algorithm (or k-means) where random input vertices are picked to initialize clusters of vertices, which are then grown to minimize a particular energy, until convergence.
Upon convergence, output vertices are computed from the vertices of each cluster.
The function `CGAL::Polygon_mesh_processing::approximated_centroidal_Voronoi_diagram_remeshing()` takes as input a triangle mesh and an expected number of output vertices, and updates the mesh with the remeshed version.
Note that the final vertex count may exceed the input parameter if the input mesh is not closed, or if the specified vertex budget was insufficient to generate a manifold mesh.
In this case, the uniformity of the output triangles may be affected.
If the input mesh contains sharp features or corners, it is possible to use quadric error metrics to either move output vertices (fast but can produce bad looking triangles), of to use quadric error metrics directly into the energy formulation of each cluster (slower but produces better quality triangles).
Additionally, adaptive remeshing based on surface curvature is possible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the fact that topology can change should be highlighted as it is a significant difference with other methods.


/// Construct new Mesh
std::vector<std::size_t> valid_cluster_map(nb_clusters, -1);
std::vector<typename GT::Point_3> points;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and at other places, the type should be VPM's value type, not GT::Point_3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are the same or I'm missing your point.

@sloriot

This comment was marked as outdated.

This comment was marked as outdated.

@sloriot
Copy link
Member

sloriot commented Feb 14, 2025

/force-build:v2

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants