Grasshopper

generative modeling for Rhino

# Perpendicular frames along a curve in VB

Hi,

I am trying to make perpendicular frames along a curve using the following syntax:

Dim t as Double = 0.5

Dim nFrame as New OnPlane

Curve.fameAt(t,nFrame)

However the frames that it produces are aligned to the WorldXY Coordinates and not perpendicular to the curve. Is there any nifty way of doing this?

Cheers,

Eric

Tags: VB, a, along, curve, frames, perp

Views: 458

### Replies to This Discussion

The frames that are produced by that function are organized in a slightly different form than the perpendicular frames. Those frames are still useful as you can juggle them around and get a perpendicular one that you're looking for. Using your code as a stepping off point...

`Dim pFrame As New OnPlane(nFrame.origin, nFrame.yaxis, nFrame.zaxis)`
Note that this will not align the frames as is typically done with the perp frame component, so the resulting frame will be oriented in relationship to the curve. If you want them aligned, you must find a system that aligns them in a way that works for you.
Hi Damien,

Thanks for your reply, I was thinking I might be able to get the Perpendicular rotation by using Curve.tangentAt(t) to get the new normal direction of the plane. Having a go at it now.
Eric
The Plane from the FrameAt function represents the full orientation of the curve at that point, of which, the tangent vector is a part of it. The X direction will be the tangent vector, the Y direction will be the normal (the vector pointing from the sample point(the origin) to the center of the radius of curvature), and the Z direction will be the bi-normal (which is the vector that points perpendicular to the plane created by the X and Y vectors... ie the cross product of the X and Y vectors).

All that one line of code is essentially doing is flipping the plane so that the tangent vector, which was the X vector, will become the Z vector of the plane and it will be perpendicular to the curve at that point.

You can certainly grab the tangent vector of the curve and create a plane from that normal. However, you'll still have the same issue with plane orientation, as the plane normal function will rotate the plane around based on which quadrant the vector is pointing in.

• View All