Jump to content

Check mesh for holes


FromHell

Recommended Posts

or Divide SOP with Remove Shared Edges option

then nprims("../divide1") will give you exact number of holes in your mesh

and since the divide will already contain caps for the holes you can just merge it with original mesh and fuse to close those holes (you will need to use reverse right after divide and before merge though to get correct result)

  • Like 4
Link to comment
Share on other sites

or Divide SOP with Remove Shared Edges option

then nprims("../divide1") will give you exact number of holes in your mesh

and since the divide will already contain caps for the holes you can just merge it with original mesh and fuse to close those holes (you will need to use reverse right after divide and before merge though to get correct result)

Very neat trick.

Link to comment
Share on other sites

or Divide SOP with Remove Shared Edges option

then nprims("../divide1") will give you exact number of holes in your mesh

and since the divide will already contain caps for the holes you can just merge it with original mesh and fuse to close those holes (you will need to use reverse right after divide and before merge though to get correct result)

thanks for the tip !

just one note ; if the geometry isnt 'self-enclosed' ( sorry cant find the word in english ) an extra polygon remains . the big silhouete ..

so , it works as you described over a torus , but not exactly over a grid .

.cheers

Link to comment
Share on other sites

...

Tomas, where do I have to put the nprims("../divide1") expression?

...

anywhere you want

you need to put correct path to divide node, or branch containing primitives created by divide, this expression will simply count them

so for example put it is the switch sop input parameter as a condition like:

nprims("path/to/geo") > 0

it's up to you what you want to do with that information, it will simply tell you if that geo has holes or not and how many if you want. and be careful about what zarti said about open geometries like grid

@zarti: sure, but you cannot consider grid as watertight geometry, so essentially outside border is a hole, you just need to keep in mind how it works

Edited by anim
  • Thanks 1
Link to comment
Share on other sites

  • 11 years later...
Posted (edited)

Just to contribute to the conversation, here's another neat way:

- SOP Group with 'Unshared edges' checked

- Loop over connected or named primitive

-Detail wrangle:

int count = 0;

for(int i = 0; i < nprimitives(0); i++)
{
    if(inprimgroup(0, 'edge', i) == 1) count ++;
}

f@count = count;

if(count > 0.0)
{
    for(int p = 0; p< nprimitives(0); p++)
    {
        setprimgroup(0, 'open', p, 1, 'set');
    }
}

 

Cheers!

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