Alexey Vanzhula Posted June 24, 2014 Share Posted June 24, 2014 (edited) I use PointWrangleSOP to place my geo on the floor via selected polygon. Code is: vector center() { float xx[]; float yy[]; float zz[]; for (int i = 0; i < primvertexcount(geoself(), PRIM_NUMBER); i++) { int pt = vertexpoint( geoself(), vertexindex(geoself(),PRIM_NUMBER, i) ); vector pt_pos = point(geoself(), "P", pt); xx[i] = pt_pos.x; yy[i] = pt_pos.y; zz[i] = pt_pos.z; } return set( avg(xx), avg(yy), avg(zz) ); } vector prim_normal = prim_normal(geoself(), PRIM_NUMBER, 0, 0); vector to_vector = { 0, -1, 0 }; matrix3 mat = dihedral(prim_normal, to_vector); vector pos = @P - center(); @P = pos * mat; Is it good to place user function that get static polygon center at runtime ? Whether function will be defined on each iteration (through each point) or once ? Or maybe i need to add this center via expression to spare parm ? Edited June 24, 2014 by Alexey Vanzhula Quote Link to comment Share on other sites More sharing options...
magneto Posted June 24, 2014 Share Posted June 24, 2014 I think it will be evaluated once every 1024 points, so the expression should be faster. But SESI knows best 1 Quote Link to comment Share on other sites More sharing options...
Alexey Vanzhula Posted June 24, 2014 Author Share Posted June 24, 2014 thanx. Where did you find info about "once per 1024 points" ? Quote Link to comment Share on other sites More sharing options...
magneto Posted June 24, 2014 Share Posted June 24, 2014 SESI support if I didn't interpret it incorrectly. Quote Link to comment Share on other sites More sharing options...
Alexey Vanzhula Posted June 24, 2014 Author Share Posted June 24, 2014 (edited) while I decided to use AttrbibWrangleSOP with details class to run calculation just once. Edited June 24, 2014 by Alexey Vanzhula Quote Link to comment Share on other sites More sharing options...
magneto Posted June 24, 2014 Share Posted June 24, 2014 I think that would be slower for large data sets, but just my guess 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.