# Curve perpendicular frame orientation

**URL:** <https://discourse.mcneel.com/t/curve-perpendicular-frame-orientation/114857>\
**Category:** Grasshopper\
**Tags:** windows\
**Created:** [December 20, 2020, 12:07pm UTC](https://discourse.mcneel.com/t/curve-perpendicular-frame-orientation/114857 "2020-12-20T12:07:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndrewAhn](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/andrewahn/32/538780_2.png) [@AndrewAhn](https://discourse.mcneel.com/u/AndrewAhn)\
**Post date:** [December 20, 2020, 12:07pm UTC](https://discourse.mcneel.com/t/curve-perpendicular-frame-orientation/114857/1 "2020-12-20T12:07:50Z")

</div>

![Canvas at 20;56;55](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/0/e/70e8ecc87b7235ba6cf05cf46e99299d48a24735.jpeg)

Attached image shows perpendicular frames along the non-planar curve with aligned options set to false. I have two questions regarding curve perpendicular frames.

1. I understand curve perpendicular frame have its Z-Axis vector aligned with tangent vector of curve but I was wondering how its X and Y axis are being determined.

2. When the ‘aligned’ option is off, its continuity is not total random but instead they keep their continuity within the segmented domains of curve that seems to be random in both size and count. Exactly what is going on?

---

<div class="post-metadata">

**Author:** ![diff-arch](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/diff-arch/32/528268_2.png) [@diff-arch](https://discourse.mcneel.com/u/diff-arch)\
**Post date:** [December 20, 2020, 9:28pm UTC](https://discourse.mcneel.com/t/curve-perpendicular-frame-orientation/114857/2 "2020-12-20T21:28:41Z")

</div>

Hi,

Yes, the plane normal vector corresponds to the tangent at the current parameter of the curve. To understand the rest, you should know that perpendicular curve frames are also referred to by **zero-twist frames**.

Two algorithms are usually implemented to make this work.  
The first one calculates an indefinite integral of the curve’s [torsion](https://en.wikipedia.org/wiki/Torsion_of_a_curve) to get the total rotation of its [Frenet](https://en.wikipedia.org/wiki/Frenet%E2%80%93Serret_formulas) frame around the tangent while moving from the curve start point to any other point. However, it is not possible to correctly calculate the Frenet frame of the curve at a point where it has zero curvature, and that’s where the second algorithm comes into play.  
It takes the normal direction at the start point and “tracks” it along the curve, by projecting the previous normal direction on the plane that is perpendicular to curve tangent at the next curve point/parameter. The frame is then calculated by quaternion linear interpolation or something, and is supposed to work with whatever curve, especially straight sections.

I guess this should answer both your questions. Nothing is probably random! 😉

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [December 20, 2020, 9:48pm UTC](https://discourse.mcneel.com/t/curve-perpendicular-frame-orientation/114857/3 "2020-12-20T21:48:29Z")

</div>

> [@AndrewAhn](#):
>
> Exactly what is going on?

Perhaps a more practical question is what can I do about it?

What has worked for me in most cases is the Align Plane component _(‘Vector | Plane | Align Plane’)_ using the unit Z vector on the ‘D’ _(Direction)_ input.

 ![pFrame_2020Dec20a](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/2/4/7244340c3f5fc87a8ee6a391ad40cd3adf7d9450.png)

The white lines _(Y axis of each pFrame)_ are all horizontal.

 ![pFrame_2020Dec20a2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/9/7/9977a6c520dc69e2c517b07df71a55358fd3014d.jpeg)

---

<div class="post-metadata">

**Author:** ![technostark](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/technostark/32/766047_2.png) [@technostark](https://discourse.mcneel.com/u/technostark)\
**Post date:** [May 13, 2024, 7:28am UTC](https://discourse.mcneel.com/t/curve-perpendicular-frame-orientation/114857/4 "2024-05-13T07:28:20Z")

</div>

Is there any way to ‘align’ the perp frames of the curve itself?

By that I mean, can we remove the twist of an existing curve or even modify it?

---

<div class="post-metadata">

**Author:** ![Hassan\_Nawaz](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/hassan_nawaz/32/650783_2.png) [@Hassan\_Nawaz](https://discourse.mcneel.com/u/Hassan_Nawaz)\
**Post date:** [August 14, 2025, 12:33pm UTC](https://discourse.mcneel.com/t/curve-perpendicular-frame-orientation/114857/5 "2025-08-14T12:33:26Z")

</div>

That also solved my problem as well. I was looking for that. Thanks
