Grasshopper

algorithmic modeling for Rhino

Hello,

Does anyone know how to invert a list of true and false so that true becomes false an false true. Hopefully you can help me.

Greetings Robert

Views: 11224

Replies to This Discussion

You can use the Not component, it inverts boolean values.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I'm not 100% sure but it looks like all boolean parameters have an "invert" option.

there occurred a new problem. If i want to test multiple Breps for inclusion it does not work

it works only for one Brep. Grafting the geometry component doesn't work also.

There's some more complex thinking involved.

For each point you need to check for containment in one of the BReps.

So we graft the points and get a list of booleans. If one of the Breps contains the point, it will return true, all others return false.

We need to combine all booleans to get one boolean that indicates "insied at least one Brep". Here's the trick: a boolean false converts to integer 0, true is 1. Now if we add up all booleans and all were false, the result is still 0, which converts back to false. If there were one or more trues, the result will be larger than 0, which conveniently converts back to true...

Attachments:

This is tricky, though. I think i wouldn't get it at my own. Thank you very much.

But what about just using the multiple inclusion component, It also will maintain original tree structure.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service