Find and process distance between fracture primitive/pieces


#1

I’m currently doing a crumble sim with the typical voronoi – RBD fracture workflow. My main method involves deleting everything, but the “inside” primitive geo. I then use another delete sop to have only pieces greater than a velocity value show up, which are then sourced for dust and debris. However the problem is that the piece primitives that do not separate also end up being sources. I’m hoping to also emit when each and every edge/surface separates.

This is the method I’m trying to work out: measure the distance between each of the pieces “inside” primitives. If the primitive pieces get to a minimum distance, then they would show up to be sourced. What kind of workflow would be recommended for this? Is a vopsop or a for-each node recommended?

Pseudocode:

Bring in “name” attributes/every “piece” geo
Find distance between “piece” prim and the closest neighboring piece
if distance > value;
output “piece”
if distance == 0;
delete/don’t output “piece”


#2

I wrote once a plugin to do this.

[VIMEO]74576571[/VIMEO]

The way it works is,

1st for each primitive, I find the opposite primitive.
then over time, check if the distance between those 2 primitive is bigger than a given value, if yes, I change an attribute to 1


#3

Thanks for the reply, Ruben! Awesome video! Is that plug-in available?

1st for each primitive, I find the opposite primitive.
then over time, check if the distance between those 2 primitive is bigger than a given value, if yes, I change an attribute to 1

I think I understand how you went about the method for the most part except for the first part. What nodes did you use to find each primitive’s neighboring/opposite primitive?


#4

No that plugin is unfortunately not available.
I didn’t use any nodes, I used the HDK to write mine, but it could be done with python as well.

BTW if you re using H13, you can use the new Debris Source SOP to do the same :wink:


#5

Didn’t know about the debris source sop until now. Thanks it’s working perfectly now!


#6

Cool

you’re welcome :thumbsup:


#7

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.