Flipped Perp Frame

Hi!

I need the Perp Frames component to work on a set of curves, but they are always oriented in a random way. I tried to use a guide curve to align them with one axis, ending with a flipped last plane which is also not usable in my case. Is there a fast way to ensure that all the x axes are pointing upwards or downwards?

I have read this post: Perpendicular Frames flip axis randomly - Grasshopper - is there no solution for this yet, or am I using the component in the wrong way?

I have attached the file with an example.
Thanks a lot for your help!

Best
Pia
Perpframes_bug.gh (6.3 KB)

Not a “bug”, your expectations are misguided.


Perpframes_2023Nov23a.gh (7.9 KB)

Thanks for your reply, but this is not what I need to achieve. I need all planes to point in the same direction because I want to use them to place blocks.

the Perp Frames component outputs planes that are correctly perpendicular to the input Curve

“Perpendicular to the input curve” only means that Plane Normal (Z) is parallel to the tangent vector at that very same curve parameter t, so I see no bug there :slight_smile:

the way X (and so Y) axis of that perpendicular frame are oriented, you can decide by using Align Plane, but need to give a reference Vector that is somehow “consistent” for all your frames

I assume this might be closer to what you are looking for?


Perpframes_for_sure_not_a_bug.gh (10.6 KB)

[edited example]

1 Like

It looks like you’re using a planar curve as your starting point - will the curve always be planar?


perpframes - possible solution.gh (13.0 KB)

This is probably over-thinking it, but here’s one solution:

  1. If the curve is planar, find the plane it’s on, then find the Z-vector of that plane.
  2. Do a cross product of the curve tangent with that z-vector, this gets you the “y” vector of your aligned planes
  3. Do a cross product of the y-vector with the curve tangent vector, that gets your “x” vector
  4. Create a plane using the points, x vector, and y vector.

If it’s not planar, well…back to the drawing board…

Hi Scott!

luckily I’ve just changed them to be all planar. This solution works great, thanks a lot!

Best
Pia

1 Like

Hi Inno!

I knew how the perp Frames work, I just hoped that they would have a more consistant orientation when you use them on a sinle curve.
Thanks for your easy solution I also used the align plane but just with one vector, using 3 makes definately more sense! :wink:

Thank you!

Best Pia