renderfan Posted April 11, 2014 Share Posted April 11, 2014 Hello all!How can I find all connected primitives to given prim in big polygon mesh? For example if I have prim number 10 and want find surrounding prims.Thank you very much!!! Quote Link to comment Share on other sites More sharing options...
eetu Posted April 11, 2014 Share Posted April 11, 2014 (edited) Here's one idea, use a Connectivity SOP and then group all primitives that have the same $CLASS attribute value: ee_select_brothers.hip Edited April 11, 2014 by eetu Quote Link to comment Share on other sites More sharing options...
eetu Posted April 11, 2014 Share Posted April 11, 2014 Oh, or did you mean just the immediate connected neighbours? In that case use the primneighbours() expression like this. If you only want ones that share an edge and not just a point, use 2 as the third argument. ee_select_neighbors.hip 1 Quote Link to comment Share on other sites More sharing options...
renderfan Posted April 12, 2014 Author Share Posted April 12, 2014 Thank you very much eetu, this is what I was looking for. Quote Link to comment Share on other sites More sharing options...
renderfan Posted April 12, 2014 Author Share Posted April 12, 2014 The file provided by eetu work very good but if I use expression `primneighbours(opinputpath(".", 0), $PR, 2)` in AttribCreate-Sop it is very slow for big mesh. Is there other way to find neighbour primitives for every primitive in mesh?Thank you very much!! Quote Link to comment Share on other sites More sharing options...
petz Posted April 12, 2014 Share Posted April 12, 2014 attached is a vex based solution which should be much faster... hth. petz get_neighbours.hip 8 1 Quote Link to comment Share on other sites More sharing options...
eetu Posted April 13, 2014 Share Posted April 13, 2014 Hey that's nice! I didn't even know all these hedge_ functions existed! They are not even listed in the vex functions help page - seems they are buried in the page on half-edges.. Quote Link to comment Share on other sites More sharing options...
renderfan Posted April 15, 2014 Author Share Posted April 15, 2014 Thank you very much petz! You are right, VEX solution is a lot faster as expression. On my computer it is around 5000 times faster ! Quote Link to comment Share on other sites More sharing options...
kgoossens Posted November 14, 2014 Share Posted November 14, 2014 There is also an in between solution if you are not so much into writing vex code. It is about 50% slower than the vex written function but it is easier to set up. get_neighbours-otherMethod.hipnc Quote Link to comment Share on other sites More sharing options...
magneto Posted November 14, 2014 Share Posted November 14, 2014 I think Group Edge Depth is the fastest method of all. You have to convert from points to primitives first though which shouldn't be bad. 1 Quote Link to comment Share on other sites More sharing options...
freaq Posted November 15, 2014 Share Posted November 15, 2014 you can also use a connectivity sop,delete everything but the primitive you are after.and then have another delete sop that looks at that attribute and delete everything that does not have the same value. 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.