how to best find overlapping pts on differing prims?

   846   3   0
User Avatar
Member
63 posts
Joined:
Offline
Hello Houdini community,

I have a problem where I am trying to find a good method of procedurally find points that overlap in space, but are not connected and belong to different primitives.

Specifically, I am cutting a circle (polyline) into sections with the labs boolean curve tool, but due to how the circle is scaled, oriented etc. as well as it being an open polyline curve I am ending up with one or more places with overlapping, unconnected points in places where I do not want the points to be unconnected. The attached image should give you a better idea of what I mean.

I need to find these points so that I can fuse them before I then can use something like the convert line node to create a single primitive per section. I have found a way to do this under certain conditions, but my way only finds one instance and it turns out that there could be multiple instances of this happening and at that point my current method fails.

Do you have any idea as to what would be the best method for doing this?

Thanks,

Dag

Attachments:
unconnected_pts_on_diff_prims_issue.png (118.8 KB)

User Avatar
Member
242 posts
Joined: Jan. 2008
Offline
You should be able to do this with the fuse node.
1. create a s@name for each prim
2. Set it to only get unequal attributes.
3. output groups

Attachments:
snap.png (84.4 KB)

User Avatar
Member
4520 posts
Joined: Feb. 2012
Online
Hi,

You can do this in VEX easily:

int pts [ ] = pcfind ( 0, "P", @P, ch("radius"), chi("maxpts") );
removevalue ( pts, @ptnum );

if ( len ( pts ) > 0 )
{
    int primid = pointprims ( 0, pts [ 0 ] ) [ 0 ];
    if ( primid != @primnum )
        i@group_overlap = 1;
}

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
User Avatar
Member
63 posts
Joined:
Offline
@mawi and animatrix: Thanks for your suggestions! I'll give both of those a try as soon as I can
  • Quick Links