Jump to content

Delete points close to surface edge


coljwood

Recommended Posts

Hi guys,

I've poked my head into the Houdini rabbit hole and now I can't seem to get it back out. I've taken an old project for me to do some experiments with and i've come across a stumbling block for a new user such as I. I won't go into to too much detail about the entire scope of the project just yet as i'm quite confident with everything else at the moment, it's only this one minor issue that seems to be the stumbling block at the moment (although i'm sure something else will come up).

Essentially, i've brought some artwork in as a DXF (Houdini was very temperamental with my Illustrator 8 artwork, which i may have questions about later) and turned it into a primitive (the letter 'P' shown in the screenshot).

I've scattered points across the primitive and relaxed them within the same node. The results are very, very close to what I want, but ideally I want to remove all points close to/along the edges of the primitive. I'm guessing this is fairly easy to do, but with me picking up things as I go a long i'm lost at where to start. Ideally, I would remove the points from the edges, then relax so that I get a nicer distribution of points inset from the primitive.

I've tried a couple of things like insetting with a PolyExtrude and scattering the points across that, but the shape isn't as perfect. I also tried the PolyExtrude2D which got decent results but not perfect.

The bridge that Houdini creates between the border of the 'P' and the hole at the center also causes problems, but I guess this is essential for the geomtry? I've used the Hole node on the imported DXF file.

Any help would be appreciated. I'm unable to share the artwork i'm using itself unfortunately, but you should be able to demonstrate on any primitive. Let me know if I haven't explained anything clear and will be happy to explain a little further about what i'm trying to achieve.

Many thanks,

Colin

 

59b78616a20ad_PScatter.png.dbf40d4a7578ba35044ca7ca90fe1da4.png

Link to comment
Share on other sites

I use this in most cases now (VEX attrib wrangle code):

if(xyzdist(1, v@P) < chf("maxDist"))
    removepoint(0, @ptnum);

//just press on the small button with the slider and the plus on the right of the snippet field to create the controlling parameter
//you may need to use an ends sop, set to "unroll" to get the edge detection instead of surface detection on the 2nd input.

Link to comment
Share on other sites

22 hours ago, acey195 said:

I use this in most cases now (VEX attrib wrangle code):

if(xyzdist(1, v@P) < chf("maxDist"))
    removepoint(0, @ptnum);

//just press on the small button with the slider and the plus on the right of the snippet field to create the controlling parameter
//you may need to use an ends sop, set to "unroll" to get the edge detection instead of surface detection on the 2nd input.

Thanks Acey. I'll give this one a try as i'd like to play around with the VEX stuff. I have to admit though, even with your great explanation it's a bit lost on me.

Can you advise on what the inputs are intended to be?

p_scatter_02.png

Edited by coljwood
Link to comment
Share on other sites

1 hour ago, coljwood said:

Thanks Acey. I'll give this one a try as i'd like to play around with the VEX stuff. I have to admit though, even with your great explanation it's a bit lost on me.

Can you advise on what the inputs are intended to be?

It looks like you did it correctly. I am not sure if the "Group Type: Edges" could be a problem (I don't think it should though)

I do notice that due to the way your letters are built, this method will remove some of the points between the stem and the ring of the P (where the edge is inside the primitive)
you may to also remove edges like those after "unrolling" in the ends1 SOP.

If it still does not work, make sure that the parameter name of the "maxDist" matches between the code and the interface, you can check by hovering over or using the gearwheel in the top-right.
Here you can also adjust the range of the slider, for if you are working with large-scale letters. (you can also type numbers to test into the parameter, or drag while holding the middlemouse button)

Kind regards,

Twan
 

Link to comment
Share on other sites

I tried Acey195 wrangle in mine and it works straightaway...with my setup I have a referenced copy so that there's one with and one without 'holes'...naturally the one with holes you use for scatter as you don't want the points in there...the other one without holes, you use for Unrolling...this method you don't get points disappearing where the joints are...

So the ref'ed one should be exactly the same as the other in all aspects except for the 'holiness'...

DeleteNearBorder_Acey.hipnc

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

It looks like Acey's method was working all along, and the Maxdist just needed to be very small (due the scene scale?).

The result below was pretty much what I was looking for - now onto the next challenge!

In fact, I intend to copy geometry onto each of those points, so it may be a neat challenge to use the scale of the geometry to drive the Maxdist attribute!

Thanks guys!

p_scatter_03.png

Edited by coljwood
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...