-
Notifications
You must be signed in to change notification settings - Fork 10
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
Wish: Calculate centroid #36
Comments
Computing the centroid is trivial: The centroid size can be computed by |
Thanks for looking into this! I'm sorry I wasn't precise. I meant the center of mass. For meshes with varying vertex density, the centroid will be drawn to regions with higher density. I've encountered meshes with higher vertex density in high-curvature regions. It would be nice to get the center of mass - CGAL is weighting the individual contributions by triangle size, the reference given by libigl is "Calculating the volume and centroid of a polyhedron in 3d" [Nuernberg 2013]". Many thanks in advance! |
Rvcg is an interface to vcglib. I am not sure if this is included. |
Center of mass calculation is very similar to volume calculation. Again, my C++ is weak, but I think VCG is doing the weighting in this function (note that function Thanks in advance! |
First of all, many thanks for developing Rvcg! It proves extremely useful in radiation oncology where comparison of target structures as contoured by AI vs. experts is currently an important issue. Would it be possible to add a function to obtain the centroid of a mesh, similar to the
vcgVolume()
function? Example calculations based on other libraries are here:https://github.com/CGAL/cgal/blob/40fdc6c6bc48eec140353fca3e930f578745f18b/Principal_component_analysis_LGPL/include/CGAL/centroid.h#L516
https://github.com/libigl/libigl/blob/574ab1a3a819b3798cf452fa44bcb47704a529c6/include/igl/centroid.cpp#L11
Thanks in advance for considering!
The text was updated successfully, but these errors were encountered: