Grasshopper

algorithmic modeling for Rhino

Hello

I don t understand what I do wrong with the -similar-command. I am comparing the coordinates of some points, which are exactly equal, and even with a 5%tolerance I get too many false results.

The tree and the list of points that I am comparing are attached.

I extracted from the tree a list to check the results. I should get -true- the points n 0,1,4,18. But I am missing the point n18.

I suppose that I did a stupid error, but no idea which ...

Thank you!!

Views: 1996

Attachments:

Replies to This Discussion

jpg

Attachments:

Ciao Valentina.

You are doing 2 errors.

1- Points aren't just numbers.

As you can see "Similar" component works with numbers.

If you move the mouse cursor over the letter "A" in the component, it will pop-up a message saying what it's happening inside that "A" slot, as i'm doing in the screenshot above.

"Similar" component is automatically converting his inputs into numbers (if it wasn't able to do it, it would be displayed an error).

If you compare the lists, you can see that the conversion from point to number is not very helpful at this moment (this specific conversion is the distance from the point to the world 0, or the length of the vector equivalent to the point, same thing).

2- Grasshopper lists-components managing.

A generic component in grasshopper behave different to what you are expecting.

What is happening here is somehow like this:

The component "Similar" (but it work like this in a lot of other components, if not all) take the first element in list "A" and combine it with the first element in list "B",

the second element in list "A" and combine it with the second element in list "B",

the third element in list "A" and combine it with the third element in list "B",

4th in A with 4th in B,

then, as the list B is shorter then list A (4vs33 elements), grasshopper repeat the last element in list B until the end of list A.

What you want to do after with that true/false list?

And how can you compare point with a 5% tolerance? Depending of their coordinates?

Or you want to remove every point in list A that is similar to at least one point in list B... ?

These are simple operations, and there are so many way to achieve any result.

If you can explain to what you are aiming for, it will be the best to help you.

:D

I made a mess! Thank you! So I should decompose the points and compare each of the values, perform 3 cull patterns (for x, y, z numbers) and then put them together with one of those special Boolean operations, is not it?

This is what I finally want and how I plan to do it:

In the starting tree, points are listed accordingly to the (11) 4-side-panels they belong to. I need to do a tree where each of the 11 lists contains not the points composing the panels but the points code of the points composing the panels. the point code is the number in the flattened list that refers to the points (like, panel 1 is made of points  n 0,1,4,18, and so on). To do this, I suppose that I will use my tree of 11 lists of 33 true-false values, and apply it to cull 11 times a series of numbers from 0 to 32. I ll post it if it works!

For comparing points, you could do 1 test for each coordinate (3 booleans: x,y,z) and then combining them eachother with mass addition or mass multiplication (the same logic as AND/OR gates), then finally use the resulting boolean to do a cull.

But if you just need to re-find the same points you already own, you can use "Member index" component, it does exactly what you need.

It works with generic data, no conversions here.

Take a look to the attached definition.

Added some extra.

Feel free to ask for further help... :D

Attachments:

I knew neither about mass addition nor Member index; now it is fast and clear! Grazie tante!

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