Closed r03ert0 closed 4 years ago
I tried running the individual steps of extract_mean_curvature_flow_skeleton
one after the other: contract_geometry
, collapse_edges
, split_faces
and detect_degeneracies
. It's the contract_geometry
step that throws the error. I also tried starting by running collapse_edges
, split_faces
and detect_degeneracies
in a loop until there's no more collapses, splits or degeneracies. But even then contract_geometry
will throw an error.
Skeleton skeleton;
Skeletonization mcs(poly);
std::size_t ncol, nsplit, ndeg;
do {
ncol = mcs.collapse_edges();
nsplit = mcs.split_faces();
ndeg = mcs.detect_degeneracies();
std::cout<<"#col:"<<ncol<<" #split:"<<nsplit<<" #deg:"<<ndeg<<std::endl;
} while(ncol + nsplit + ndeg > 0);
mcs.contract_geometry();
All my meshes are produced by the same algorithm (remove regions, extrusion). I can't figure out what's that makes that skeletonization doesn't work in some of them...
The two red points (20.8867 25.077 34.0597 and 20.8379 25.2667 33.9117) have been duplicated to handle a non-manifold edge in your mesh. This cause an issue when computing poles in the current code. I'll see if I can easily find a workaround but in any case, the skeleton will not cross the non-manifold edge.
thank you @sloriot!
You can try the patch in #5088
i works beautifully! 🎉 Thank you very much for the patch. I hope it'll be merged soon 😄
It was merged today in master and release branches starting from 5.0
Hi @r03ert0 Does the mean curvature flow have something to do with http://neuroanatomy.github.io/ ? If so what should we link on the page Projects Using CGAL.
Hi @afabri! https://neuroanatomy.github.io is the website of my lab. The project where we use the mean curvature flow is this one: https://github.com/r03ert0/foldgraph (as soon as we have a more stable version, we'll move it from my personal repo to the lab's repo). Here's an image showing the workflow we implement with Foldgraph:
And now, we also use the distance information to be able to measure the "width" of each brain fold. We're very excited about the possibilities!
hi@r03ert0, I want to ask, how do you display the extracted skeleton?I can use this function to generate .cgal
file, but I don't know how to display
hi @SY524044272-python ! I get 2 cgal files from the skeleton sample code: "skel-poly.cgal" and "correspondance-poly.cgal". For getting the skeleton/wireframe U use the skel-poly file. Each row is one curve, the first value is the number of vertices in the curve, and then follow the 3d coordinates of the vertices. After that, the "correspondance-poly" file links each point in the skeleton curve with its corresponding point in the original mesh. For plotting in 3d I used custom code, but it should be possible to convert the curves to PLY format or something, and render in Blender (you can get some very cool renders and animations!). For the flat plots, I used some custom code for the flattening (which is quite specific to our brain imaging pipeline), and then just plotted using Matplotlib : ). In a previous experiment, I used t-SNE for flattening the graphs, and it works more or less :P
hello Roberto Toro. I'm sorry to see your reply very late. I already know how to use these two files。 But I still have a few questions to ask you. I use SolidWorks to design a chain tooth structure and output it as STL file, then write Python code to convert the STL file into the off file. When I use extract mean curvature flow Skeleton, there was an error in the program. It's like the picture below.I searched GitHub for this problem and found that there were also people who ran into it.
This is the solution, but I didn't understand what he said
My chain tooth file is in the attachment. Can you help me see what the problem is? thank you very much!!!!!!
I'm sorry to see your reply very late
At 2020-12-10 17:58:13, "Roberto Toro" @.***> wrote:
hi @SY524044272-python ! I get 2 cgal files from the skeleton sample code: "skel-poly.cgal" and "correspondance-poly.cgal". For getting the skeleton/wireframe U use the skel-poly file. Each row is one curve, the first value is the number of vertices in the curve, and then follow the 3d coordinates of the vertices. After that, the "correspondance-poly" file links each point in the skeleton curve with its corresponding point in the original mesh. For plotting in 3d I used custom code, but it should be possible to convert the curves to PLY format or something, and render in Blender (you can get some very cool renders and animations!). For the flat plots, I used some custom code for the flattening (which is quite specific to our brain imaging pipeline), and then just plotted using Matplotlib : ). In a previous experiment, I used t-SNE for flattening the graphs, and it works more or less :P
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
both_holesVol.off.zip
Issue Details
I'm trying to extract the skeleton of a series of meshes (example attached) [these are brain meshes where all negative curvature regions have been removed, and the result converted to a volume by extrusion along the normal].
extract_mean_curvature_flow_skeleton
fails withBus error: 10
, however, the mesh has a single component, only triangles, and no borders.Source Code
Environment