logix1390 Posted January 13, 2017 Share Posted January 13, 2017 Hello, I have a square consisting of several points on each side. I want the Normals to face outwards on each point. I used the expression $BBX-$BBZ in a point sop and got two of the sides doing exactly what I want, But I need it for the other two sides. I have attached my scene file. Any help would be greatly appreciated. Thanks Normal_Direction_On_Square.hip Quote Link to comment Share on other sites More sharing options...
Atom Posted January 13, 2017 Share Posted January 13, 2017 (edited) We know we can get the type of normals you are looking for from a Facet following a box. But you only want a single square. So you can attribute transfer the normals from the box to the square after deleting all those extra box vertices. ap_normals_attrib_transfer.hipnc Edited January 13, 2017 by Atom Quote Link to comment Share on other sites More sharing options...
logix1390 Posted January 13, 2017 Author Share Posted January 13, 2017 This is perfect. Thank you Atom !! Quote Link to comment Share on other sites More sharing options...
michael Posted January 13, 2017 Share Posted January 13, 2017 or just use a point wrangle with this: v@center = set(0,0,0); v@N = v@center - v@P; Quote Link to comment Share on other sites More sharing options...
rreno Posted January 13, 2017 Share Posted January 13, 2017 Hi Michael, the code you shared gives a vector which points inwards to the origin at every point. Here's my point wrangle code that gives normals at any point on the surface of a unit box. Given all the conditionals, I assume there is probably a much more succinct solution. vector onSurface1; vector onSurface2; if (@P.z == 0.5 || @P.z == -0.5) { onSurface1 = set(-@P.y,@P.x,0); onSurface2 = set(@P.y,@P.x,0); @N = abs(normalize(cross(onSurface1,onSurface2))); if(@P.z < 0) { @N *= -1.0; } } else if (@P.y == 0.5 || @P.y == -0.5) { onSurface1 = set(-@P.z,0,@P.x); onSurface2 = set(@P.z,0,@P.x); @N = abs(normalize(cross(onSurface1,onSurface2))); if(@P.y < 0) { @N *= -1.0; } } else { onSurface1 = set(0,-@P.z,@P.x); onSurface2 = set(0,@P.z,@P.x); @N = abs(normalize(cross(onSurface1,onSurface2))); if(@P.x < 0) { @N *= -1.0; } } Quote Link to comment Share on other sites More sharing options...
michael Posted January 13, 2017 Share Posted January 13, 2017 @rreno mine was just for the OP specific case Quote Link to comment Share on other sites More sharing options...
rreno Posted January 13, 2017 Share Posted January 13, 2017 Oops I read square and thought box. Mine is totally useless for this situation then. Quote Link to comment Share on other sites More sharing options...
logix1390 Posted January 17, 2017 Author Share Posted January 17, 2017 Thank you all for the help ! 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.