Search This Blog

Blog Archive

Tuesday, November 18, 2008

Remove Lonely Verts

this entry contains a little bit of VOP-SOP fun as well as outlining the
process of making a digital asset in Houdini.

my friend Rob Kelly initially nutted this out - then i found that i needed
it, so i set about making one for myself which turned out to be easier than i thought.

my first attept was in H8 and i remember getting frustrated with for loops not working as i expected - but now with H9's Vop Sop - a truly versatile SOP. {i have since removed my sheep joke from this entry :D }

the main application for finding lonely verts ( verts that have less than 3 neighbors )
is to delete them so they dont interupt the subdivision process
Lonlely verts are often left behind in the modeling process - whenever several connecting edges are dissolved.

I added a VOP SOP - then after mucking around with the for each VOP - i realised every op in the VOP SOP was going to be applied to every point in the incoming geometry anyway - so i didnt need a for loop at all.

in the VOP SOP i simply have the point number from the global parameters (fom the incoming geometry) going into a neighbor sop - which counts how many neighboring points the current point has - and then decides if it should be coloured or not.

The trick here is to get the neighbor count to either zero or one which will act like a switch.
i noticed that a lonely vert has only 2 edges coming out of it - where as a 'healthy' vert has usually four - or three depending where it is on the model. There are exceptions however ! ie - the corners of a grid also only have two neighbors !

The only way ive though of so far to deal with these is to explicity ignore them by putting them into a group, before the asset does its job. We can streamline this process a little by some sort of edge detection or at the very least providing a field with the group name to ignore, as part of the asset.

The coloured points are grouped by their colour and the option is there in the asset to delete them or not. Having a toggle is a good way to see what the bleep is happening.

1 comment:

AndyN said...

Hi Dan, great site. Always interested to see what stuff you come up with.

Had an idea about this one. You could use a Divide SOP with "Remove Shared Edges" enabled. You could then use a AttributeTransfer using a temporary attribute to signal back to the original mesh which points occur on the edge of the mesh. That way you can automatically create a group to ignore for the vert detection.

Cheers

Andy