Grasshopper

algorithmic modeling for Rhino

Hey,

I have been playing around with the image sampler tool and for the most part I get the results I am looking for with simple grasshopper scripts.  Occasionally I get these strange scaling anomalies that I have no idea where they come from.

Has anyone else noticed these?

And I dont know if they are related, my computer slows down significantly when working with these short scripts.  Perhaps there are endless scaling calcs going on...

Views: 2155

Attachments:

Replies to This Discussion

hello

you are creating far more circles than needed (check the number of output circles)hence the delay, because the points from the grid are in tree structure. you can start by flattening the points output in grid component.

cheers

alex

Hm...What exactly should I be flattening?  Shouldn't the tree structure work fine with the image sampler?  In my script in the attached .jpg, I have added some extra commands, flip and dispatch.  I did this so I could isolate the columns and use one column to trim out the adjacent column.  This way I didn't have to worry as much about the circles getting so big they overlap their neighbor.  

I recreated the simple image sampler script without flipping the tree structure or dispatching the branches, and it worked fine.  The circle output matched the total grid points.  This would imply that its in this step it creates excessive amounts of circles.  I think it is because the tree structure of the grid no longer matches that tree structure for the circle locations.  

When I use the one of the dispatched items the image sampler worked fine.

I used the same logic for a more complicated script where there are groups of three objects copied onto the subdivided grid rather than just circles.  My goal was to have the squares scale consistently within the group per the image sample.  However, even with the same logic that worked on the circles, I get more strange duplicated results.  Note the xy domain of the image sample matches the grid output, which worked perfectly for the circle example.

Attachments:

hello again. the points output after whatever flip matrix or dispatch operation you are doing.

i cannot recreate your definition from a jpeg (where the whole definition does not show up) . so uploading it would help you get help.

The unwanted and duplicated results are in most cases because of wrong data matching and management.

the longest list behavior of grasshopper creates more than needed if not proper care is given to data structure.

It is because you are giving the image sampler x amount of points. Then you seem to dispatch those points essentially splitting them into a and b, yet you are still feeding each the original amount of image sample values when using the circle. So say you have originally 50 points. You plugged those 50 into image sample to get 50 values. Now you dispatched the 50 points into lets say 25 points each. Yet you are giving the original 50 to the new dispatched list of 25. 

Dispatch your image sample data as well then use it for the circle component matching values a with a and b with b, or don't dispatch your points. (I am not sure why you dispatched in the first place) 

Edit: this is in response to your first image. 

Thanks for the help!

So the logic makes total sense, and I feel like I should have thought of this before, but in testing the theory, I still ran into the same problem.

I attached two images with the script modified as you suggested.  I simply attached the points of the grid to the image sample and dispatched that in order to match the image sample points to the circle points.  

It worked initially, but I believe that is because the grid had equal parts in U and V.  As I manipulated this relationship the multiplied circles came back, even though the image sample points matched the circle points.

One thing that is different however, is that the each branch prior to dispatching has 13 items, while afterwards it has 12.  Perhaps this is where the problem is?

P.S. I am using dispatch because that is the easiest way I know of to select every other column.  This would allow my to take one set of columns and trim the other, making it possible to have more flexibility in the circle size without worrying about overlapping.  If there is a better way to handle that I am all ears!

Attachments:

Well why do you need to use flip matrix? I would do it like his. If you use flip matrix you need to also use the flip matrix into the image sample or the data will not match. 

Also, a better way to not intersect? sure, use math :). The minimum component (highlighted in purple in the screenshot) will only output the lower of two numbers. So by setting it as half of your grid cell size (in this case grid cell is 1 so half is .5) minimum will only let you have a radius of .5, thus no intersection. 

Attachments:

good one!

Michael descibes the problem more clear than my attempt.

please check screenshot and file.

My strategy is to cull any unwanted point and then flatten the points to one single list and feed them to image sampler. if i understood correct the only reason to dispatch was to remove the unwanted points.

hope that helps.

alex

Attachments:

Sorry guys, I guess I wasn't very clear. 

I actually want the circles to overlap, I just want to be able to control what is trimming what.  The end result will hopefully look like there are overlapping objects.  

I wanted each adjacent object in a row to trim one another, so this meant I had to select out the columns.  Since the UV naturally would allow me to select out the rows when using dispatch, I used flip matrix to get control of the columns rather than rows.  

Unfortunately, it looks like this step is causing my duplicated scaled objects.

use the flip matrix in dispatch as well as image sample ;)

Duh!! wow...good call.  

Don't know why I didn't try that one, but thank you!

Flip matrix gives you access to rows not columns. it looks like you have columns because you use the true false pattern in dispatch, but still your points, in branches, are organized in rows since you flipped them.

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