2D skeletonization

Bonjour, comment c’est va? Votre plugin a fière allure, heureux d’en acheter une copie lorsqu’il sera disponible. Merci encore

1 Like

Hello
that was not so difficult but I didn’t put great effort to finish it.
I decided to make it with the same logic as some other components. So it generate alone the region (contour and holes)


Medial axis is outputted as polyline so it could be possible to filter short parts,

… but it works not perfectly, it depends on the tolerance chosen here 0.001 and the curve division


here 0.005 curve division 0.2

here 0.005 curve division 0.5

I have thinks to tweak things (ratio tolerance curve division …)

It works on whatever planes

Circles could be sorted so it is possible to have the biggest in-circle for labeling

C’est Magnifique!

Hello - thanks for the update! I have tried the new version and it is very nice (unfortunately in Rhino 8 I get an error but in Rhino 7 it works).

What I think would be a super useful next step is if “all” circles (some already seem to do so) walk along the inside of the outer curve while “trying” to be as big as possible, until they cannot expand further without loosing tangent to the current position at the outer curve or crossing other parts of its own or other curves.

I have a screenshot for what I mean (actually taken unmodified just colored output from your component):

The green circles do exactly what I mean - the red ones dont. That leads to a smooth straight medial axis on the left while resulting in a jagged line on the right. The image is the upper part of the letter A taken from Roboto Condensed Thin font - modified to have proper closed curves.

What is the error in Rh 8 ?

I don’t see that ? But the B is strange

Here is the gh and 3dm file for your reference:
medial_axis_test_v1.gh.3dm (205.4 KB)
medial_axis_script_v1.gh (5.5 KB)

The error message in RH8 is:
1. Solution exception:Method not found: System.Tuple6<Grasshopper.DataTree1<Rhino.Geometry.Polyline>,Grasshopper.DataTree1<Rhino.Geometry.Plane>,Grasshopper.DataTree1<Rhino.Geometry.Polyline>,Grasshopper.DataTree1<Rhino.Geometry.Circle>,Grasshopper.DataTree1<Rhino.Geometry.Line>,Grasshopper.DataTree1<Rhino.Geometry.Polyline>> VoronoiLib.DelaunayUtils.MedialAxisFromCurves(System.Collections.Generic.List1<Rhino.Geometry.Curve>, Boolean, Double, Double)'.

Hello
thanks for the report.
I am looking to this problem that is due to the method used. If you look at the Voronoi cells, I think you will understand.
At the moment you could do that. But I have to find a better way


medial_axis_script_v1.gh (9.0 KB)

For Rh8 it is surely because it looks at an old LDLIB.dll. Everything is on the library.
If you click on LDLIB.dll , you’ll see the version it must be 0.9.8

Thanks for your time and feedback. I have checked on my computer I have that DLL 3 times:

grafik

The first two are Version 0.9.8.0 as you mentioned. But the third one is 1.0.0.0

grafik

Maybe it creates trouble that the older version has a higher version number?

I have installed for both, Rhino 7 and Rhino 8 using package manager.

I have corrected the active one, and now it also works in Rhino 8. Thanks a lot!

Hello
I updated Medial Axis in Nautilus version 0.9.9, I made some simplification that must bring better curves. I still have sometimes duplicates curves on medial axis.
If you choose to not use automatic tool tolerance is better if less than Di/100.

A nice medial axis is when all end points are on connections between curves


And here some errors
image
I will have to work on a tool to cure this type of errors. It is not simple as it is not duplicate.

Automatic tool seems quite good thought




1 Like

Medial axis of the hiragana letter “a” extracted by thresholding second derivatives of the distance to the boundary. Left: fast marching. Right: Heat method.

Interesting how to extract medial axis from meshes with heat method.

Hello
thanks for the link, I never noticed that heat method could also be used for that. But I think the result will be very similar, but I can’t find the font. Here a test

And Image thinner will give that



2 Likes

nice tools and good approximation @laurent_delrieu!
Since this is a mesh I think could be countouring. probably @DanielPiker could adjust his heat method tool.
this example is a bit different because uses 2 open curves…