3D point grid based of image brightness

when you have a 2d grid of points and you want to give it different heights based on the brightness of an image, how do stop your program from crashing all the time? The only way that it doesn’t crash is by making the image x and y so small but then you don’t get the “image”


anyone know what i can do to make this work? (pretty new to dynamo)

Obviously there’s going to be some limit on what your machine can handle, but the immediate issue I can see is that you’re using cross-product for the Point.ByCoordinates node. That works for the x and y inputs to get the full array that you want, but when you include the z offset that’s now applying that whole array to every instance in your list of z values. You really want to use list levels, specifically to match the structure and order (x-y vs y-x), of the pixel array.

I’m with @Nick_Boyts chances are at a minimum 32 x 32 x 32 x 32 points created. Also the way images read pixels 0, 0 is top left and reads down to bottom right. You could use List.CartesianProduct but that’s messy. Use a UV.ByCoordinates node set to cross product of your sequence then pull out U & V as X & Y, finally matching to the brightness list with a Point.ByCoordinates node set to shortest. Use a Math.MapTo to stretch the max and min brightness across the height range.


2 Likes

This seems to work way better, i’ve tried the same image and i become the same outcome. The only thing i now want to do is make a surface from it but when i try it with NurbsSurface.ByPoints and i link the Point.ByCoordinates it gives an error (see screenshot) what can i link with the uDegree and vDegree so this works?


Already a big thanks for the help and fast reply!

The data structure for the points needs to be a list of lists of points (order by row or column). If you have a flat list or a list of lists of lists of points you’ll get this error.