Rotation of Concrete Block based on Image Sampler

Hi, I’m trying to achieve a rotation based on image sampler for a typical concrete block wall. I have created the the wall using blocks. But nothing is happening when i attach the image sampler. Please help. TIA. :slightly_smiling_face:
I have also attached the reference image for the same.

concrete block 1.3dm (115.6 KB) (327.4 KB)

Haven´t opened your definition but I guess that the values from the image sampler must be remapped.
They come out from 0 to 255 and these are values that don´t work well with turns…

Take a look at the attachment. Best. (17.3 KB)


@HS_Kim Thanks Kim this is exactly what i hoped for. Thanks a lot.

Thanks for your input Miguel. I’ll keep this in mind for future projects.

1 Like

Hi Kim,
I was trying the image sampler script.
Why is the output not reading the image.
Am I doing some mistake here?

Thank you for your time in advance.


Block by image (335.2 KB)

The ‘uvP’ points for the reparameterized surface have X/Y values in the range (domain) 0 to 1, so the Image Sampler domain must be set to match that (the Image Sampler default):

Some caveats about Image Sampler:

  1. When I modify someone else’s GH file that has an Image Sampler, that component (and image) will disappear from my saved file. It must be copy/pasted from the original file to see my changes.
  2. Aspect ratio and resolution matter!
  3. Work at low resolution until you are certain about your code.

Adding Scale after the fact, as below, can be done differently, as each box is created, but I didn’t change that much. You didn’t internalize your surface so I created one. (22.9 KB)

1 Like

Thanks a lot Joseph.
It worked.
Thank you for explaining it to me so well, and for your time :slight_smile:

In case you missed it, you might want to check out this treatment of Image Sampler from a week ago, addressing aspect ratio and resolution: