Combining multiple Beizier/NURBS Curves

   9869   7   3
User Avatar
Member
9 posts
Joined: Dec. 2015
Offline


I'm trying to find a procedural way to combine multiple curves in Houdini.
And for the first step, I tried to combine multiple circles as below, but couldn't make it happen..
(image above is done by Adobe Illustrator)



Here's a process i've been through.

At firt, I made a simillar state in Houdini. Still not combining.(#01)


Next, I tested combining only two circles. And It worked well.(#02)


And I tried to merge two states above using for-loop. (#01 and #02)

It works like combining curves one by one. Seemed it worked, but after 5 times of iteration, whole curve broke. This is because curvesect SOP's Keep Even/Keep Odd settings need to be changed depending on curves' positions or shapes. And I couldn't control this in any ways…


After a while, I came up with another method.
Which is to convert and combine as polygons first, then convert them again as NURBS.

Even though curves have to be resampled, worked well than the previous way.
(Boolean SOP is used for self-intersections, so I used left input only)


But when iteration comes to the end, center area gets filled with polygon.I tried Hole SOP couldn't resolve this.

If possible, I want to avoid converting/resampling as polygons or VDBs, and keep them as curves during operation.
(so the shapes won't change and keep accuracy)
Curvesect SOP was really nice but couldn't determine EVEN/ODD settings…

Sorry I'm new to Houdini, and my English is poor.
It would be really appreciated if you could give me any advice. Thank you.
Edited by gupon - Dec. 25, 2017 02:35:26

Attachments:
combine_curves.hipnc (120.0 KB)

User Avatar
Member
1743 posts
Joined: March 2012
Offline
For polygons to have holes, there need to be “bridge” edges to the hole. What's shown in that last screenshot is a polygon for the outer boundary and a separate, overlapping polygon, wound the opposite way, for the inner boundary.

The Hole SOP should be able to bridge the hole, and it seems to work in this case, though it's not always the most stable in its choice of bridge. Alternatively, you can use a Group Create SOP to group unshared edges, then use a Dissolve SOP set to Delete Non-Selected to delete shared edges, with the option on to bridge the polygons with holes. (See Attached)

Of course, if you have to use NURBS for some reason, that introduces a huge pain, because either you need to use trim curves, (which are a mess to work with; I tried just now and spent maybe 40 minutes before giving up, but maybe you can figure something with the Project and Trim SOPs), or you need to insert duplicate vertices to preserve the sharp transition for the bridge. If you can avoid using NURBS, I always try to recommend that people do, because they fundamentally aren't what people expect in a lot of cases, leading to a lot of confusion.

Attachments:
combine_curves_2.hipnc (124.2 KB)

Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
If you don't mind wrangling, you can get quit a bit of various combinations.

Attachments:
Nurb Circle Intersection.hiplc (186.2 KB)

User Avatar
Member
9 posts
Joined: Dec. 2015
Offline
Thank you ndickson for the great help.
I understood about Hole SOP and the bridge, not to get errors in inner boundary.

And thanks for the long try with NURBS.. didn't know about trim SOP yet, so I'll try dealing with it.
Also will try to avoid NURBS too. All I want is to keep the vector shape as it is.
It is fine using either bezier curves or polygons.
Edited by gupon - Dec. 25, 2017 01:22:17
User Avatar
Member
9 posts
Joined: Dec. 2015
Offline
Thank you BabaJ for the great example, it teaches me a lot. (I love wrangling)
I didn't know a usage of functions like intersect_all().
Now I'll start dealing with about how to make these methods work in any shapes or numbers of curves…
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
here's my hillbilly non-scripting way…

Attachments:
vu_combineshapes.hipnc (79.5 KB)
vu_combineshapes1.jpg (127.6 KB)

User Avatar
Member
9 posts
Joined: Dec. 2015
Offline
Thank you vusta! This is simple and solid.
I've recieved some advices on twitter when using boolean in this situation, so I will share it here later.
Edited by gupon - Dec. 26, 2017 03:51:18
User Avatar
Member
9 posts
Joined: Dec. 2015
Offline
I gathered two ways of merging shapes in hip.
Method A is an idea from yone80 (https://twitter.com/yone80).
Thank you for all the help.

Edited by gupon - Dec. 26, 2017 05:54:59

Attachments:
combining_shapes_171226-2.hipnc (102.4 KB)

  • Quick Links