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

c33385e5cee84e697959bdd0c292d11
cd52ee995668cfac0e9d0e547ad7baa

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

https://discourse.mcneel.com/t/how-to-use-python-to-obtain-the-centerline-of-a-curved-cylinder/167171/3

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.

Code_Cylinder_Path_Fake.gh (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.

-Kevin

Using Python


unnamed.gh (4.2 KB)

Could you please take a look at the message I just sent

unnamed.gh (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).

unnamed_RE.gh (7.8 KB)

2 Likes

Thank you. I also came up with this method