Grasshopper

algorithmic modeling for Rhino

Hi everyone,



I'm trying to get my head around the transformation used by the Adjust Plane (PAdjust) component, which matches the plane to a new normal vector.
I've tried to replicate it's result by combining the other transform components, trying to understand how to create the correct matrix, but it's a bit over my head and I can't seem to get it right.

The goal is to use it in a VB script component to use as a sort of joystick to tilt the XY-plane. I got the bit of getting the right new normal vector working, now I'd like to incorporate the Adjust Plane transformation.
I did reread the Essential Mathematics for Computational Design, chapter 2, and some other publications but I still can't figure out how to replicate the Adjust Plane behaviour.

Can somebody help me with that please?

I've attached a sketchy definition with some of my failed attempts (plus the UO I'm now trying to code), but it may illustrate my question.


B.t.w.: minor bug: I found that the vector notation is missing spaces after the comma's, which makes them hard to read. (though it's not so bad in the example I'm showing here...)

Views: 804

Attachments:

Replies to This Discussion

I think it uses uses Rotation from base vector to target vector. 

--

David Rutten

david@mcneel.com

Hi David,
thanks for the hint. Didn't you create that component? Or could you tell me what that rotate method looks like? I can't find it in the Plane Methods.

I can get the plane "tilting direction" like I want, but what eludes me is the rotation about it's z-axis (like in the PAdjust component).

It's not a method on Plane, it's a method on Transform. You create a rotational transform around the plane origin from the plane z-axis to the new vector, then apply the transform to the plane.

I did make the component, can't access the code right now though.

--

David Rutten

david@mcneel.com

Thank you! I was looking in the wrong place.
Transform.Rotation method (Vector3d, Vector3d, Point3d) does what I wanted, thanks David.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service