Jump to content

Recommended Posts

Hi,

For a tool I've been working on, I need to have a way of finding adjacent faces between the inside of fractured pieces. I want to store this as a primitive attribute, that gives the number of the adjacent primitive.

The way I have done it is by calculating the centroid of each primitive (using getbbox_center) and then iterating through the primitives in a for-each loop, finding the other primitive with the same centroid. (it turned out that the centroids were different by a tiny amount, so I introduced an accuracy value that you can set, and it finds the adjacent primitive within that distance). It then stores this as a primitive attribute.

All seems to be working fine on simple fractures, but as soon as you sent the number of fractures higher than 22, it seems to bug out and all the adjacent faces are incorrect. I have visualized this in the HIP file by having a subnet that draws lines between adjacent faces.

Attached is my HIP file. If anyone has any idea what could be causing this issue, I would be very grateful!

I have also noticed that it seems to be a bit slow to calculate the adjacent faces, so if anyone knows a more efficient way of doing this, I'd also be pleased to hear it.

Best,

Stephen

 

FindingAdjacentFace.hipnc

Edited by Stephen Moroz

Share this post


Link to post
Share on other sites

not exactly what you need, but this might give you some ideas ..

Edited by MENOZ

Share this post


Link to post
Share on other sites
4 hours ago, MENOZ said:

not exactly what you need, but this might give you some ideas ..

Ahh very interesting! I had no idea that you could enable those attributes in the voronoi fracture node. I'll take a look into this, although ideally I would like this to work with boolean shattered geometry as well, which wouldn't have them attributes. Thanks for the link though, it's useful to know! :)

Share this post


Link to post
Share on other sites

I tried with the idea of using centroids as you suggested and it seems it works.

I've stored the number of the coplanar face on each primitive.

faces.hipnc

Share this post


Link to post
Share on other sites
Quote

 I would like this to work with boolean shattered geometry as well, which wouldn't have them attributes.

You can create a primitive attribute on the cutters and the new pieces will inherit that id

boolnea_ids_v001.hipnc

Share this post


Link to post
Share on other sites
On 12/24/2017 at 12:16 PM, MENOZ said:

I tried with the idea of using centroids as you suggested and it seems it works.

I've stored the number of the coplanar face on each primitive.

faces.hipnc

Perfect! Conceptually this is the same as what I did, but you've done it in a much simpler way. Exactly what I needed, thanks!

On 12/24/2017 at 2:34 PM, Shinjipierre said:

You can create a primitive attribute on the cutters and the new pieces will inherit that id

boolnea_ids_v001.hipnc

That's a really good idea, I hadn't thought of that. This will certainly come in useful, thanks!

Share this post


Link to post
Share on other sites

If it's of any interest, here's a link to the tool I needed this for. Any crit / ideas would be appreciated!

 

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

×