Creating planes using C# component in grasshopper


I am trying to create planes along a sine curve using the C# component, but some of the planes are not oriented as the others. I am new to coding . the .gh (5.7 KB)

Curves are one-dimensional objects, they have no sense of orientation (it should in my opinion, although it is a heuristic and not explicitly mathematical). You have two options, either create the planes from the rhino methods and align them later (rotating, fliping or whatever), or create the planes on your own using the position and the tangent (the other vectors of the planes you calculate as you want them to be aligned), for example your case one axis could be the tangent and the other the Y axis of the world.

I created the plane with points and tangents ina forloop, but the orientation of some planes are different.

The methods you used to create planes were with “freedom”, not totally defined.
Origin+NormalVector doesn’t define only 1 plane, but infinite.

To create a specific plane please use this overload:
Plane pln = new Rhino.Geometry.Plane(Origin, VectX, VectY);

As your curve is on XZ plane, use vector Y “Rhino.Geometry.Vector3d.YAxis” with your tangent vector as the two vector inputs of the function.

1 Like

See attached: is an entry level C# exercise for controlling planes (for placing profiles and then do things). Includes another challenge as well (play with the rail options and spot the odd handrail Brep). (129.6 KB)

1 Like