Solid Pipe Centerline

unhandled

(David S. Mavrov) #1

Is there a way to extract the centerlines of solid pipes? See attached geometry.

Solid Pipe Centerline.gh (1.5 MB)


(Radovan Grmusa) #2

This will work only when outside surface of pipe consists of two breps, almost like half-cylinder (as it is in your case), otherwise result may be unexpected or none.
Solid Pipe Centerline_2.gh (1.5 MB)


(David S. Mavrov) #3

This is what I did. Works if the pipes are straight.

Solid Pipe Centerline.gh (7.6 KB)


(Radovan Grmusa) #4

Generally, your approach is OK.
But in case when pipe is short and “thick” it will fail - see below.
Workaround is to check which face has smaller curvature and assume that it is cap-face. But this will fail in case if cap is not single-surface-brep.

Solid Pipe Centerline_3.gh (17.1 KB)


(David S. Mavrov) #5

Yeah, I know. And it will only work if the profile is straight. But it is a cool little problem. Maybe there is a way to create an almost universal solution.


#6

When I got it right and if the pipe is made like in Radovans example this could also work:


File:Solid Pipe CenterlineSrfClosed.gh (1.5 MB)