Grasshopper

algorithmic modeling for Rhino

Hi all,

I reach the point where i desperately need your help...

(I am new on grasshopper so my action are not as optimize as they could be...yet)

I am trying to obtain a pattern based on the grey scale of an image.

It combine an IMAGE SAMPLER with a GRID

The IMAGE SAMPLER gives me radius and GRID gives me the point.

I put on each intersection a circle with the radius given by image sampler. (for this example, I replace the circle by a square, but the problem with radius is the same)

MY PROBLEM :

I didn't manage to choose or parameter the size of the radius,

at the end, i would only need 5 different radius : 0 (i'll delete the point), 5; 7,5; 10 and 12,5.

In the image below, I tried to divide the list of radius in 5 parts, but then couldn't reconnect it with the intersection points.

Views: 1873

Attachments:

Replies to This Discussion

Hm, yeah its real strange. If I open the original file its there. I copy/paste it to the new file and save. When I reopen its gone again!? Could it be, that this happens when copy/pasting an image sampler between documents?

So I have placed a fresh one and saved and now it seems to be working. Not the first time this happend though.

Attachments:

It's not a copy/paste problem.  Modifying and saving the original file loses the Image Sampler.  Have seen this for awhile now on Image Sampler code posted here.

Copy/Paste and Save/Open are the exact same operation under the hood though. So I'd expect the problem to show up in both.

Yeah I have not found any apparent logic to it. I have a big file I have been working on for several months and constantly updating, which uses an image sampler.

A few times it has dissappeared and I have just placed one again, but recently it has been behaving and staying where it should.

If I find any recurring cause I will report back. Still having some issues with image sampler loading images from network shares, which freezes GH for a few minutes before finally loading the image, but I don't want to keep hassling you about that.

Ok, just found a solution. Using the Firefly Image Sampler works great with network files! No slow-down at all and no special UI for loading the file, I can just input any file path.

Animated image sampler texture here I come!

That look super helpfull, I am gonna try it right now, thanks a lot already!!!

I'll tell you how it goes.... suspense...

Thanks Armin Seltz for your help, your solution worked perfectly fine and is very efficient! Exactly the result I was looking for

(the little shape resulting will be laser-cuted on metal panel to create a facade!!!)

Glad I could help. I am actually doing a lot of work with laser cut panels myself and will be able to share some of the work of the last year soon. Luckily we have our own large laser cutter here at work that I can play with any time I like! So feel free to get in touch about anything and make sure to post some images of the finished thing in the Photos section on the right.

Hi again, 

I am almost done with what I want but i found a weird "bug".

Sometimes (it appears to be random) Instead of having one shape for one point of intersection, I have four included in each other. (see image)

It appeared when I chose from my all list some area (points in curves) and excluded some other,

Do you see what the problem might be?

Thanks

Hello.

Yes, that was quite quick to find. So let me walk you through how I troubleshoot something like that.

So when you get something copied in place a few times it usually means that you have 2 data inputs with different number of items. It will then place something in one point multiple times. Its something that happens a lot, so you get used to it.

When you have have a component that has 2 inputs that are grafted and have some sort of data structure, like that rotate component right at the end, you always have to make sure the data matches (unless you know exactly what you are doing ;). So taking a look at the list length, we see that they are different:

You just flatten the input of List Length to see the total number of items.

Now we have to work our way back to find where the discrepancy starts by just hovering over the outputs of all the nodes. They all start from the same thing (that data input right at the beginning), so there must be something. Sure enough its the Cull Pattern that is doing it:

You always have to be careful with things like Cull Pattern, Sort, Dispatch, etc. Basically anything that changes the data structure. If you have 2 data streams that at some point are reconnected (like in the rotate right at the end), then you need to maintain the structure. So we can just duplicate the Cull Pattern (You can just Alt-Drag it, and it will even have the connections still attached) and cull the same points in the data from the image sampler. Then we have the same number of items:

Now we can go back to the end and check if it is the same amount of data and we see it is the same everywhere :)

I wont reupload the file, because its an easy fix and the file is quite large.

Happy grasshopping!

Actually, just looking at this again, you should just place the Cull before the image sampler, so we dont even sample the culled points and also have the component just once, but its basically the same thing, though it is twice as fast and the Cull Pattern takes quite a lot of time to calculate.

Like this:

Not sure the attachements files followed

Attachments:

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