Grasshopper

algorithmic modeling for Rhino

Hi I need to select negative vectors from a list and reverse them.
How can I do it?
THank you very much
Maurice

Views: 2193

Replies to This Discussion

What is a negative vector?

If you have a method of determining whether a vector is "negative" or not, all you need to do then is convert that True/False value into an integer (true = 1, false = -1). When you multiple all your vectors with this list of numbers, all the ones that have been marked false will be inverted.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
One very stupid question for David (I ask to you because I’ve post in this discussion).
Sorry but I’m a beginner.If I insert the the vector data in the Graft Tree and then in the vector component again (because I tried to have every vector in a single branch) I have a different result if I flow the data directly from the vector component than the panel component, why this happens?
Attachments:
Hi Paolo,

the Text Panel can only handle Text, thus when you plug a bunch of vectors into a TextPanel, they get converted into a textual representation. This text then flows into the Graft component, and it doesn't get converted back into vectors until you plug it into a Vector Parameter again, at which point Grasshopper attempts to parse the text.

It seems to be a bug in the conversion that the text is incorrectly parsed. If I had to guess I'd say that Grasshopper thinks the text represents a Point coordinate (which is a fair guess, points and vectors look the same when written down), but then it proceeds to convert the point into a horizontal plane (which is a bug) and the final step is where it converts the plane z-axis into a vector. It seems the order of automatic conversions is screwed up.

Which version of Grasshopper are you using?

Can you duplicate this network and see if it fails on your machine:



--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi David
Grasshopper 0.6.0019 on Rhino 4.0 SR 6.
I tried your test but it fails, probably in the manner that you explain in your post.
Look at the picture.
Attachments:
Hi David,
How can I convert a True into 1 and a False into -1 ?

Thanks
Maurice
Hi Maurice,

I recently had to identify negative vectors in a recent definition. Try this discussion for the image. http://www.grasshopper3d.com/forum/topics/is-there-a-more-elegant-way The solution that was suggested looked promising but I had to resort back to mine as it only worked when the reference plane was Z = 0.
I've try to find a solution with the indication of the other two post.
I used only 3 vectors, please Maurice, can you make some tests and tell me if it works for you?
Attachments:

How do I convert all of the negative values into positives???

Pass the values through an Absolute component.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service