Grasshopper

algorithmic modeling for Rhino

Hi,

I have small issue with planes.

I have 4 planes perpendicular to curves.

I want to change one of their axis to central plane axis like image below.

When I write:

     plane.YAxis = centerPlane.ZAxis; //plane is perpedicular plane, centerPlane is central one

I get null plane.

How to solve this?

Views: 1171

Replies to This Discussion

Found those magic lines:

double y;
double x;
plane.ClosestParameter(plane.Origin + (Vector3d)centerPlane.ZAxis, out y, out x);
double num = System.Math.Atan2(y, x);
plane.Rotate(-num + 1.5707963267948966, plane.ZAxis, plane.Origin);

This does not minimize rotation but is a single line:

plane = New plane(plane.Origin, vector3d.CrossProduct(centerPlane.ZAxis, Plane.XAxis), centerPlane.ZAxis)

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service