2D curve outline preserving round corners

   2636   8   4
User Avatar
Member
25 posts
Joined: May 2023
Offline
Hi. I'm trying to create a thick 2D outline of an arbitrary Bezier curve. Sweep (ribbon) node doesn't fly because it creates overlapping and otherwise messed up geometry around sharp corners. PolyExpand2D and PolyExtrude (inset) don't create overlaps but also can't correctly offset rounded corner curve path in the same way any vector editor app can. Instead the inner side of expanded rounded corner turns into a sharp corner. Please see the attached screenshot for comparison.

Any ideas how to expand the curve preserving round corners intact?

Thanks for any ideas!

Attachments:
HoudiniPolyExpand.png (521.3 KB)

User Avatar
Member
802 posts
Joined: Feb. 2017
Offline
I would create sharp edges and use a bevel node afterward to make the roundness.

Cheers
CYTE
User Avatar
Member
25 posts
Joined: May 2023
Offline
Thanks CYTE! But how would you judge by how much to bevel to visually match the corresponding outer angle on the original curve.

I suppose I was hoping for some well hidden built-in Houdini method to stroke an arbitrary curve. Same as classic curve stroke in any vector editor tool out there. Sounds like such a basic must have vector op to me.
Edited by voidcoder - Sept. 25, 2024 15:40:28
User Avatar
Member
392 posts
Joined: Aug. 2018
Offline
If you sweep with a line SOP fed into the second input of the sweep SOP, you can position that line relative to the curve you are sweeping it along. That should give you the type of sweep geo you want.
User Avatar
Member
25 posts
Joined: May 2023
Offline
Not quite sure what you mean Mike. Sweep's second input is just the cross section. You can achieve curve outline by setting sweep mode to "ribbon", it will auto-generate cross section.

But as I explained in the original post, Sweep can't handle thick geo and will mess the corners. It lacks the "Limit insetting" option that PolyExpand2D / PolyExtrude have and will produce degenerate / overlapping geo. See the attached screen and project.

Attachments:
Screenshot 2024-09-25 at 23.28.57.png (1.1 MB)
curve_stroke_test_01.hipnc (111.2 KB)

User Avatar
Member
9380 posts
Joined: July 2007
Offline
your image is deceiving, there is clearly a larger outer arc on the right image than left so it can handle thicker geo before collapsing to the point, if you would continue inwards that too would collapse to sharp edge and either limit or inversion, otherwise you wouldn't be visually matching as you put it

so both Sweep and Poly Expand should work well for that purpose, however if the stroke is thicker than the arc allows then Poly Expand is better as it doesn't invert, you will get sharp corner simply because there is no matching arc that can fit in there anymore
However if you want to keep it a Bezier then Sweep should be the choice as it is not limited to Polys and will keep the surface as Bezier
Edited by tamte - Sept. 25, 2024 19:40:06
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
392 posts
Joined: Aug. 2018
Offline
The point I was making was that if you use the built in 'ribbon' mode that ribbon is centered on your swept curve. If you use a line as a second input you can adjust the position of that line which will offset the sweep relative to your curve. That may or may not help, depending on the nature of your curve of course.
Edited by Mike_A - Sept. 26, 2024 04:52:39
User Avatar
Member
447 posts
Joined: April 2018
Offline
CYTE
I would create sharp edges and use a bevel node afterward to make the roundness.

Cheers
CYTE
PolyBevel does not create perfect arcs, so I would not recommend this approach.
User Avatar
Member
25 posts
Joined: May 2023
Offline
You are right Tomas. If I try super thick outline in other vector tools the inner corners getting squared similar to Houdini nodes. When the corner radius getting close to zero.

However you can still round these new square corners with a basic round corner post-process step without visually distorting the shape too much. See the screenshot below. I need to play with CYTE's bevel idea.

Thanks for your input guys!

Attachments:
PhVI4.png (54.2 KB)

  • Quick Links