Grasshopper

algorithmic modeling for Rhino

Hello,

i have a comprehension queastion regarding the function of vectors.
Why is the median of the vector x and the vector y = vector Z?
For my understanding it must be 45° degree between x and y, but it issnt.

I need to compute the vector which is the median of two suface vectors which i already evaluated with the evaluate surface tool. When I combine the two vectors with "cross product" the resulting vector shows additionaly in to the third dimension ("Z")

Can someone explain me why?

Is cross product the right tool for my intention?

Greetings,

Johannes.

Views: 5119

Replies to This Discussion

I think what you are looking for is the average (mean):

(cross product is something else entirely)

thank you for the tip but it does not work as I expected.
This tool gives me two vectors, in one point and in two directions!? and they have the same orientation like the two surface vectors which i loaded before.
Can you (or someone else) help me to find the average vector from two surface vectors in my exsample file?

Greetings,

Jo.

Attachments:

One of your sliders is set to -10, meaning your line segment actually points in the opposite direction of the vector. The average vector is thus weird as both input vectors are almost entirely anti-parallel. I'd use a Vector Display component (perhaps with a V*10 expression in the V input if your vectors are too short to see):

Also note I flipped one of the surfaces so that the normal is pointing in the right direction.

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

If you use [Interpolate Data] instead of [Average], then you can smoothly change the position and direction of the points and vectors using a slider:

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

ah, thank you! i will try this later. Please ignor my thread below!

I wasnt able to try your definition but when I take a longer look to it, it seams to be that you create a vector which changes its direction depending to his position between the two other vectors, is that right? If yes, then I'm looking for something different. Namely I would like to extrude a new surface (on the bordered edge of both surfaces) which tooks the exactly the middle direction (half of the angle). Therefor i need the "summtion" of both vectors which has the same orientation in every point, independand from the distance to the two vectors.
Hope you can catch my meaning.
But i will check your definition anyway.

Hello David,

i was wrong, your definition works quite good for me when I do this for only one pair of surface. Thank you for that.


The prolem was, and still is, the fliped surface. For a unknown reason, some of the surfaces in my whole geometry are fliped, even though they all were made within the same process.
Therefor I can not use the fliped tool here in generell, when i would like to serve more than one paire odf surfaces, because GH doesnt know what is right or wrong.
Is it possible to flip a bunch of surfaces with variable orientations into one equal direction?

The only way to do that is to join them together into a single polysurface. Rhino doesn't expose the normal flipping logic on its own. Problem with joining/exploding them is that the order will get messed up. So you have some options:

  • Join/Explode, then sort and redistribute the surfaces again. This may be easy, this may be impossibly difficult depending on how the surfaces were distributed.
  • Fix the input by hand before you even get to Grasshopper. Could be the least amount of work, but it also means you cannot fully automate the process.
  • Perform the flipping yourself based on some algorithm. Again, this could be easy or very difficult depending on how your surfaces are organised.

If you know all your surfaces must face away from a central point somewhere, then you can just evaluate the normal somewhere on the surface, figure out whether it pointing towards or away from a fixed point and then flip accordingly.

--

David Rutten

david@mcneel.com

Tirol, Austria

ok. I have to try out which points fits to my requirements.
Thank You for your help once again!

Wait, could it be made that way,  so that each surface in a list flips in the same direction (or not) as the surface before/above? doesnt sound that difficult. I will try what I can get..

..maybe somebody knows a much easier way to find the bisector surfaces/plane between two (bordering) surfaces/planes???

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service