Jump to content

curvect & foreach


Recommended Posts

Hi,

I have several curves intersecting and I want to get the intersection points.

It sounds easy and I'm quitte sure there's something to do with curvesect and foreach SOP, but I can't get it to work.

post-5378-127314690848_thumb.jpg

I'm really stuck with this and any help would be really appreciated.

Thanks

Edited by ben
Link to comment
Share on other sites

  • 2 years later...

Hi,

I have several curves intersecting and I want to get the intersection points.

It sounds easy and I'm quitte sure there's something to do with curvesect and foreach SOP, but I can't get it to work.

post-5378-127314690848_thumb.jpg

I'm really stuck with this and any help would be really appreciated.

Thanks

I have the same problem.

Any suggestions?

Thanks in advance.

Pablo.

Edited by homeless3d
Link to comment
Share on other sites

If your curves share points, then you could do pointneighbours() and see if there are more than 2 neighbors.

If there are no points in the intersection points it'll be more hairy. Maybe extrude the curves a bit, and then intersect with something, maybe inside a foreach if needed?

Link to comment
Share on other sites

Straightforward task if you know the Curvesect SOP and the ins and outs of the Foreach SOP.

Curvesect SOP takes two inputs. Left input is the curves to cut and the right is the cutter. See the first Curvesect SOP set-up in the attached file.

Once you get that, it's time to bring that in to a ForEach SOP. The tricky bit is culling the recycled cut curves from the previous step from the lot prior to cutting with the next original curve in the network. This is easily done by adding a "parent" primitive attribute to the original curves based on $PR then loop through by iteration number of primitives and cut away.

This all happens inside the ForEach SOP in the attached file and is a good example of when you would use iteration by number and Merge Results off which isn't too frequently done.

This being Houdini, you can mix and match the curve primitive types as Curvesect SOP doesn't care: polys, beziers, NURBs curves are all fair game.

cut_m_by_n_curve_network.hip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...