Extract a center line from a tube

   7663   5   1
User Avatar
Member
52 posts
Joined: Aug. 2015
Offline
Hello, any ideas on how to extract a centerline from a tube. More specifically a tube with curvature and taper. Not sure the best approach for something like this.

First thought I have is maybe extract an edge running the length of the tube. For each point along the edge, find the vectors of connected edges, do a cross product to get a vector facing towards the opposite side of the tube. Ray the points across and then divide the distance of the ray in half for center points. Seems a bit overcomplicated. Wondering if there's something simpler? Thanks in advance.
User Avatar
Member
1850 posts
Joined: May 2006
Offline
Labs straight skeleton is general purpose but slow.

Aslak posted a faster method for tubes here:

https://youtu.be/F86-TDRzjnc [youtu.be]
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
52 posts
Joined: Aug. 2015
Offline
Oh this is great. Way easier than what I was thinking. Thanks so very much.
User Avatar
Member
5090 posts
Joined: Feb. 2012
Offline
This video also have a lot of interesting solutions:

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
52 posts
Joined: Aug. 2015
Offline
Oh wow, this is great. Love seeing this and different solutions. Very clever stuff there.
User Avatar
Member
19 posts
Joined: Aug. 2020
Offline
The Laplacian can also be used to produce a straight skeleton, with similar results to Labs Straight Skeleton but much faster:

https://www.sidefx.com/forum/topic/101499/ [www.sidefx.com]

Edited by Hallam Roberts - Sept. 25, 2025 20:12:55

Attachments:
Enter_a_filename.png (779.4 KB)

  • Quick Links