Extracting the centerline of a 2D plane

   593   5   1
User Avatar
Member
13 posts
Joined: July 2021
Offline
Hello everyone,

I am a beginner with Houdini, and I have encountered a problem. I want to batch extract the centerlines of several 2D planes. After looking at other answers, I used the Labs Straight Skeleton 2D node to perform the extraction, but the result is not smooth enough, and the lines are not straight enough. What methods can I use to make the lines straighter?

User Avatar
Member
708 posts
Joined: Feb. 2017
Offline
Hey J-Pam,

you can project a straight line onto your planes using the ray sop.

Cheers
CYTE
User Avatar
Member
13 posts
Joined: July 2021
Offline
细胞因子
Hey J-Pam,

you can project a straight line onto your planes using the ray sop.

Cheers
CYTE
Thank you for your response. I just realized I forgot to include my image. The result I want is like what's shown in the image. How should I place the line to achieve that?

Attachments:
what I want.jpg (190.3 KB)

User Avatar
Member
708 posts
Joined: Feb. 2017
Offline
Ah ok, I see.
Ok, that is not a trivial problem. Are the planes modeled with an edge connecting the corner points?
If so you could use a polysplit sop. If not I don't think there is a clear solution other than the straight skeleton node.
Can't the planes be created with a center line in the first place?
Could you share an example of these planes?

btw: why did you start a second thread on this issue? please, keep it to one and delete the other.
Cheers
CYTE
Edited by CYTE - Aug. 30, 2024 05:11:07
User Avatar
Member
13 posts
Joined: July 2021
Offline
细胞因子
Ah ok, I see.
Ok, that is not a trivial problem. Are the planes modeled with an edge connecting the corner points?
If so you could use a polysplit sop. If not I don't think there is a clear solution other than the straight skeleton node.
Can't the planes be created with a center line in the first place?
Could you share an example of these planes?

btw: why did you start a second thread on this issue? please, keep it to one and delete the other.
Cheers
CYTE
This 2D plane was directly created by me using the Labs Regions From Image node to recognize specific colors in the image, rather than by drawing straight lines. Ideally, when the image changes, the same colors would be recognized, and the centerline would be calculated accordingly. So it's indeed a bit tricky.
User Avatar
Member
144 posts
Joined: Aug. 2012
Online
PolyExpand2D > Clean points not on skeleton > Extend endpoints (Ray?)
  • Quick Links