Depthmap to Object

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:

  1. Create an XY grid that matches the image resolution (width × height).
  2. Build a grid of points.
  3. Associate each brightness value as Z to its corresponding (X,Y).
  4. 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!

What have you tried so far? The pixel data from the image should be structured. That’s what you need to match. The dimensions would also match that structure and tell you how to create your point array. If you can get to that point you should be able to figure the rest out.