algorithmic modeling for Rhino
So I am trying to create some planes that are on a curve and perpendicular to a line between it and a point on a second line above it.
So far so good, I create a line and use Plane Normal to get planes that have their Z-Axes pointing towards the corresponding point on the top curve. I then rotate the planes so they are following the tangent of the bottom curve. Now I need to rotate the planes, so they are parrallel to the line connecting the 2 points, but perpendicular to the bottom curve (see image).
Problem is that the Plane Normal component flips U and V in some cases, so some end up perpendicular to the bottom curve and some are parallel.
Any ideas how to correct this? Or maybe even a totally easier method of getting what I am trying to achieve?
This is the patch (also attached):
Maybe you just lost while building the definition (?)
(I haven't even looked at you "Rotation" group... as I can't understand its use...
rebuild your definition :P )
To manage planes I suggest to always:
- create a starting plane from origin, vector x (tangent of the curve), vector y (vector A to B);
- deconstruct and reconstruct your plane with rearranged XYZ components (by shuffling and inverting vectors) to achieve the plane you want.
(This can be solved faster and lighter by working with vectors, like with vector cross product etc.... and creating directly the final plane... but somehow I fond easier to follow with this method)
Thank you, its almost what I want.
Yes, I know I should be using vectors more directly, but you know, I only did A-Level Maths, so I never really used vector calculations.
Anyways. Your solution seems simple, but its not what I need. Have a look at the images below.
My (buggy) solution:
The plane needs to be tilted to its "pointing" towards the top point.
Used cross product now:
In case you don't know (1 month ago, I didn't) the resulting vector of a cross product is a vector that is normal to both input vector (A & B)... and its length is equal to the area of the parallelogram formed by A+B (except you set unitize to true, then length is set to 1)
Damn, ok your solution is even simpler ;)
You can make it even simpler by using DivideCurve to replace the PFrames and Eval Components by one (actually two) component(s).