Jump to content
Apurba Haldar

How do I delete outer pieces from voronoi fracture?

Recommended Posts

Hi, I want to select the outer pieces and delete them, I tried to use the delete node and set the Group to ‘outside’ but this only deletes the outer faces rather than the whole piece.
To do this, I tried to create a group of outer pieces selecting manually the primitives (faces). If I do it manually it'll work. for that just need to drop a group node and start selecting primitives from outside. In this way, it'll take forever to select outer pieces of a large scale model. I did not find any other sufficient way to do this!
also I found this file from sidefx which works exactly what I want but did not get how it is working!

Problem_Voronoi Frac_pieces.gif

Problem_Voronoi Frac_pieces2.gif

Deleting Outside Pieces.hip

Share this post


Link to post
Share on other sites

Ah, yes I could see how that could be difficult to understand.

The foreach loop is running on each named piece, that is the pieces that separate when we use a exploded view SOP. Look in the spreadsheet under the primitive attribute "name". All of those with the same name are processed together at once.

The loop merges each iteration with the gather method. This means that all the outputs are put together at the end instead of just the last one.

Inside that loop is a single switch. That switch asks (with the nprimsgroup function) if there are any primitives in the group called "outside". If there are at least one then that currently processed piece is swapped for the null. That "-1" and the spare Input 0 is really weird to me. I would just use opinputpath(".",0), but I can see how that would be a little less procedural.

The compile block just makes the whole thing run faster and for demonstration purposes so we can ignore it here. But it is necessary if we're actually dealing with a lot of geometry, and shattered objects can get really big.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you so much! :lol:

All my doubts about that code are now cleared! 

 

I was trying to delete the outer pieces using pack node and to some extent it worked but some of the pieces on top are NOT getting deleted at all! 

I don't know if I'm doing right or wrong with the pack node or the delete node.

Any suggestion would be really helpful.

 

Problem_Voronoi Frac_top not getting deleted.gif

Share this post


Link to post
Share on other sites
Posted (edited)

Or is there any better/ intuitive  way to do this? 

 

Edited by Apurba Haldar

Share this post


Link to post
Share on other sites

you can create attribute from outside group

then promote that to pieces by name

then delete primitives with outside attribute 1, which will be full outside pieces

 

DeletingOutsidePieces_alt.hip

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

In the 3d viewport, there is a "Select Whole Geometry" "Connected Geometry" option after you press the mouse looking icon to enable the menu.  Then you can just click the pieces you want to delete without the need of packing.

Edited by bubblepins

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×