Extract centerlines from this surfaces?

Hello all. I do need to extract the centerlines from this surfaced and I do get to a dead end as I can’t find any working solution in this case.

How I can extract the centerlines from this surfaces?


Centerline.gh (620.8 KB)

Your question is not clear. Do you mean the X, Y, Z centerlines of the bounding box? Do you mean the midpoints of the curves? Can you do a rough sketch of the output you’re expecting?

PS: Your gh file has no internalised geometry, just nulls, so it’s hard to know what we’re dealing with!

Updated the .gh file with internalized surfaces.

I do need to extract the centerline of each thin surface (the blue curves from the bellow picture).

This is a hard problem to solve. The boundary curves do not have consistent start points, so we have to determine the “ends” of each skinny region. Because these ends might be pointed in any direction (some of them are J shaped) and some intermediate parts are just as sharp, there is no reliable way to detect them even by stepping through 1000s of points on each curve.

Also at least two of the curves have sharp discontinuities/self intersections which would also trip up the detection process:


The source looks like the output of some vectorisation process. Did this start life as a bitmap that has been automatically converted to vector? If so, I would see if the convertor can output lines instead of regions.

1 Like

Hello
with a tool like thinner 2 (Nautilus) you can extract center line but will be zig zag curves. You fist need an image (greyscale or black and white) of pattern. I just used Rhino to make an image.


then with smooth polyline (join curve is long so put a dam before)

2 Likes

Actually it is from an SVG file. And I do have a bunch of them with different patterns that I do want to use them in Rhino as curves instead of surfaces.

Fixed by tracing the Inkscape center-line straight in Inkscape.

Since Inkscape 1.0 the Autotrace library including the CenterlineTrace feature is integrated. That should obsolete this extension. Find an entry in the new Path -> Trace Bitmap dialog.

This method gives the centerline of the strokes and not the edges of the stroke.

4 Likes