Hi everyone,
I am a rookie in dynamo, and I am approaching it to generate a 3D surface (or sculptural mesh) in Dynamo starting from a depthmap image (grayscale PNG). Each pixel’s brightness represents a depth value, and I’d like to convert that into elevation in Z.
I loaded the image using Image.ReadFromFile
and I extracted the pixel values with Image.Pixels
; then I used Color.Brightness
to compute grayscale values (which would become my Z-coordinates).
Then, here’s what I wanted to do but that I’m having trouble with:
- Create an XY grid that matches the image resolution (width × height).
- Build a grid of points.
- Associate each brightness value as Z to its corresponding (X,Y).
- Use those points to generate a
NurbsSurface.ByPointsGrid
.
What’s unclear to me is:
- How to pair brightness values correctly with the corresponding XY coordinates.
- How to chop the point list properly to form rows for the surface grid.
I’d love help on:
- Building the correct logic for steps 1–4 above.
- Any example graph that shows this kind of “depthmap to surface” pipeline.
- Suggestions for performance optimization or best practices.
Thank you so much in advance!