How to use Python to obtain the centerline of a curved cylinder


circle = P.ToBrep().Edges[1]
I can only get to the edge like this

Duplicate topic. Can a moderator please merge them or close this here?

Can you help me solve this problem

Do you know how to do this with native Grasshopper components?

If this extrusion has already be converted to a Brep. Then I’m afraid it would be hard to trace back to its true path curve.

But if the curved cylinder is perfect, it would be easy to get a fake one. (32.4 KB)

Thank you very much for wanting this effect

I will study your ideas

I seem to be in some trouble. Can you help me take a look

I have discovered a problem where the centerline of such fine graphics cannot be obtained. May I ask how to solve it

How to use Python to obtain the centerline of the pipeline for native plugins

It woul d be better if you can upload a file containing this element.

You want python? or native components?

Upload a file if you want help.


Using Python (4.2 KB)

Could you please take a look at the message I just sent (4.2 KB)
Could you please take a look at this

Look at what I just posted

Try this

I’ll put both the GH and python methods.

The idea would be find 2 perimeter curves instead, and then make a tween curve.
Also works for 3d path, as long as the domain of the pipe surface is set to [(0,0), (1,1)] (parameterized). (7.8 KB)


Thank you. I also came up with this method