Extract Pipe Center Curve Script?

Great, thanks, I’ll have a look.

-Pascal

Any news? Thanks! :relaxed:

Hi All,
if anyone can help about running issue, here you can find a sample wich shows the plug-in works well on torus, cones, but non with cylinders.
Thanks!extract_centerline_test.3dm (2.0 MB)

@f.corradini I’m checking this now - I see where the problem lies - thanks.

@f.corradini fixed for cylinders: ExtractCenterline.py (5.4 KB)

@hannesgrebin, @f.corradini the ExtractCenterline script and compiled plug-in (way above) are updated to work better with cylinders.

-Pascal

Great!
Thanks!

HI Pascal

I would like to embed ExtractCenterline.py script in to a toolbar but i am not able to get it to run when i click the icon.

I embedded the script in a a new button , the script is closed between parentesis as shown below

-_RunPythonScript (
…your script …
)

when i click the button the _RunPythonScript command should be supposed to run i guess, point is that nothing happens, i just the see whole script text running through command bar but the script is not working.

would you please tell me the correct procedure to embed it ? thanks in advance

In the script above change the last lines from this:

if( __name__ == "__main__" ):
    ExtractCenterline()

to this

ExtractCenterline()

(remove the if name==main line and out-dent the Extract…)

This should make it work in a button.

it works :slight_smile:

thanks , i really appreciate !!!

Thanks, Pascal! This script works wonderfully. :space_invader: :smiling_face_with_three_hearts:

PS: While extracting a centerline from a pipe whose both ends were trimmed in a complex way, I noticed that the extracted centerline is about 3-5 mm shorter than the original pipe before its splitting. Is there a way to extract a centerline whose length is equal to the untrimmed pipe?

Hm - it looks like I am shrinking the faces - not sure why that is, at the moment - I commented that out here -

ExtractCenterline.py (6.5 KB)

-Pascal

Pascal, I just tested the new version of your script and this time it extracts the full length of the centerline. Thanks again! :slight_smile:

@pascal thanks for your script.It worked great for almost all pipes. But for some pipes i get ‘extrusion’ object has no attribute ‘Face’. How can i fix this. sorry i am new to rhino.

Hi Karki -

The version of that script that is found in this thread doesn’t support Extrusion objects.
You can find an updated version in the following post:

-wim

thank you Wim. Updated version worked magic for me

Continuing the discussion from Extract Pipe Center Curve Script?:

Is it possible to extract center curves in single click?

Hi Pascal, I was just testing out the python script for extracting pipe centerlines. It is something that would be very useful for some of the workflows I use from time to time. One question, is there a way that it can batch extract the centerlines to save having to select one by one?

Cheers,
Michael

Hi, I needed that plugin but seems like it does not run R7. should i install something to make it work?