Grasshopper

algorithmic modeling for Rhino

Hi,

One last question for the night.  I have a grid on a surface (like using the divide surface component) and thus I have the normal and the frame at that point.  The frame is tangent to the surface at that point, but it looks like the "X" on the frame is aligned with the surface U direction.

In order to get the "down" direction, I need to find the projection of the normal vector at the point onto the surface in the Z direction.  I have tried several ways and do have a method that works more or less with about 10 components, but I have to think there's a better way...  Problem is at the edge of the surface where the projections "fall off" the surface mostly...

Is there an easy way I'm missing...?

Thanks,  --Mitch

Views: 535

Replies to This Discussion

Mitch, you can use the Flip Direction Vector, so if it goes Up, this will make it go in the appositive direction... 

 

Hope this helps!

 

Andres

It's less than ten components if you get rid of the gratuitous vector displays and bring the expression inside the rotation component.

Chris
Attachments:

Here's a cheap method. Lower the point ever so slightly, then project back onto the surface.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

Hi all,

Thanks for the ideas and help!

 

@ David - as always, you come up with the simple elegant solutions...

As soon as I left the computer for the night I came up with another method - get the normal vector, and make a 3 point plane with the origin as the surface point, the X axis as the end of the normal vector and a 3rd point that is the same as the second but a bit lower in Z (I just added an inverted unit Z vector).  The Y axis of that plane is the downhill vector.  It's still 10 components, though...  :)  Interesting thing is if you use a positive unit Z vector, you get the uphill direction...

I guess another observation is that all the methods except David's depend on the surface direction being "up", David's is surface direction independent.

Ciao,  --Mitch

 

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service