Mesh Skeleton

Dear @laurent_delrieu

I would like to ask about this old script of yours about mesh curve offset:

I found its use by computing medial axis similar to this post:

Do you think there is a faster method to compute curve offset or somehow optimize your script?
Currently it takes a few seconds to compute:) Any ideas would be very helpful.
Also maybe you C# version instead of VB?

MedialAxis.gh (44.1 KB)

2 Likes

Hey Petras
first it is not really offset but geodesic distance calculation. The values are geodesic distances from one or many points.
It is based on these papers


http://hhoppe.com/geodesics.pdf

Yes the script could be faster but I never implemented it. As it works with exact geodesic distances it works with “windows” and windows could be merged if an error is accepted. So it becomes faster. You could also use heat method developped by Keenan Crane
https://www.cs.cmu.edu/~kmcrane/Projects/HeatMethod/
I didn’t implement it.

Offset of 3d volume could also be used to calculate sort of skeletton, see this :


Here my script in CS. But I didn’t get too much into it as I have not much use of it at the moment.
MedialAxis_petras_CS.gh (46.8 KB)

Hope it helps
Best regards
Laurent Delrieu

4 Likes

Have a look at the Skeletonization component in https://www.food4rhino.com/app/capybara :slight_smile:
You can also find a family of geodesics (and their conjugates) to remap your mesh into a quad mesh.

All the algos come from libigl and CGAL, you can find more info by right-click->help on some of its components. The library is a C# wrapper to C++ functions, therefore it should be pretty fast.

Let me know had you any questions!
Lorenzo

5 Likes

I should buy beer for that. Thank you.

I hadn’t realised this was in there - nice one @lorenzogreco !

Happy you guys like it :slight_smile:

Is this skeletonization component still available?

You are looking at how to compute the Distance Transform, one algo that I like is called Jump Flooding Algorithm or JFA, the paper is online and it is easy to implement

Skeletonization is also ported to Cockroach plugin from the CGAL

It is important to mention that all credits of original code goes to the initial implementation of this package. It is the result of the work of Xiang Gao during the 2013 season of the Google Summer of Code mentored by Andrea Tagliasacchi and Sébastien Loriot. It was finalized by Andreas Fabri and Sébastien Loriot.

https://doc.cgal.org/latest/Surface_mesh_skeletonization/index.html

4 Likes