Stephen Moroz Posted December 23, 2017 Share Posted December 23, 2017 (edited) 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 December 23, 2017 by Stephen Moroz Quote Link to comment Share on other sites More sharing options...
MENOZ Posted December 23, 2017 Share Posted December 23, 2017 (edited) not exactly what you need, but this might give you some ideas .. Edited December 23, 2017 by MENOZ Quote Link to comment Share on other sites More sharing options...
Stephen Moroz Posted December 23, 2017 Author Share Posted December 23, 2017 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! Quote Link to comment Share on other sites More sharing options...
MENOZ Posted December 24, 2017 Share Posted December 24, 2017 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 Quote Link to comment Share on other sites More sharing options...
Shinjipierre Posted December 24, 2017 Share Posted December 24, 2017 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 Quote Link to comment Share on other sites More sharing options...
Stephen Moroz Posted December 27, 2017 Author Share Posted December 27, 2017 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! Quote Link to comment Share on other sites More sharing options...
Stephen Moroz Posted January 5, 2018 Author Share Posted January 5, 2018 If it's of any interest, here's a link to the tool I needed this for. Any crit / ideas would be appreciated! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.