1 minute read
image sampler in gh
4. We can do a similar operation using Image Sampler tool in Grasshopper.
Advertisement
Image Sampler in GH
5. Select a boundary curve for your landform. Use DivideSurface component to create a grid of points that approximate the surface. Specify the U and V Count.
Image Sampler in GH
6. Bring up the Image Sampler component. Double clicking the component will display a dialogue box.
7. Set the file path to your image.
8. Set the X Domain and Y Domain to match the dimensions of the boundary curve. In this case, my boundary curve is 500m x 500m, so the X and Y Doimain is set at 0 to 500, respectively.
9. Connect output Parameters from Divide Surface to the input node of the Image Sampler component.
Image Sampler in GH
10. Connect a panel to the Image Sampler component’s output, to see the list of points that are moved in Z-direction, using the image as an approximate height value.
11. We’re going to use RemapNumbers component to control the range of these values generated from Image Sampler component.
12. Construct a domain using Construct Domain component, set the bottom and top value. Connect the output to input Target of RemapNumbers component.
13. Using Bounds component, extract the domain of the list of numbers generated from Image Sampler. Connect the output to input Source of RemapNumbers component.
14. Connect the output of Image Sampler to input Value of RemapNumbers component.
15. Use the output of RemapNumbers component as a Factor for Unit Z component.
16. Using Move component, move the surface division points (output Points of DivideSurface component).