I need to rotate or re-orient breps following the direction of a surface normal. What I have been doing is inputting a surface and dividing it into vertical rectangular pipes.
By default they all face the same direction.
Ideally, I would like each of these rectangles to be oriented towards the surface normal of the surface they correspond to, like this:
Any idea how I can do this with GH? Here’s the script:
orientwithsurfacenormal.gh (35.5 KB)
Thank you all
hello, the solution is very simple just try the following steps in sequence.
Convert that base surface to an untrimmed surface if it’s a trimmed surface. (Very Important) Hint - use Sweep2 Component.
Use Evaluate Surface and that will give you a normal Vector (N), and Plane (frame).
Now, Deconstruct (frame) and use normal Vector (N) for creating a new Plane.
and done use those new Planes to orient your geometry.
You can orient your rectangles like this:
You have to cull 2 of the planes because they overlap. You can use a Point List component to display the location of the plane origins so you can determine which ones you want to cull.
orientwithsurfacenormal_re.gh (17.8 KB)
Hi Kevin and Jay, thanks so much for your help, this is all I need!