Extract a center line from a tube

   7050   5   1
User Avatar
Member
52 posts
Joined: 8月 2015
オフライン
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: 5月 2006
オフライン
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: 8月 2015
オフライン
Oh this is great. Way easier than what I was thinking. Thanks so very much.
User Avatar
Member
5044 posts
Joined: 2月 2012
オフライン
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: 8月 2015
オフライン
Oh wow, this is great. Love seeing this and different solutions. Very clever stuff there.
User Avatar
Member
18 posts
Joined: 8月 2020
オフライン
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 - 2025年9月25日 20:12:55

Attachments:
Enter_a_filename.png (779.4 KB)

  • Quick Links