Thingiverse
Texture Mapping in OpenScad!
63
Downloads
55
Likes
0
Makes
Recently on the OpenScad discussion alias, I was trying to explain how I could do my own lighting calculations if given half a chance. Altough it's not really a possibility for the current OpenScad renderer, I got to thinking. Even though I can't print in multiple colors (yet), I can certainly liven up my OpenScad renderings a bit.
This thing is a set of imaging routines for OpenScad.
The general principle is fairly straight forward. First you need an image to be converted to a format that OpenScad can understand. In the included .zip file, there is such an executable. Just run:
ImageConverter.exe imagename > name.scad
This will generate something that looks like:
imagename_triplets_array = [0,0,0, 1,2,3, 255,255,255];
imagename = image(width, height, imagename_triplets_array)
There is a new function here: image() which takes parameters necessary to just package up some stuff for later usage in functions.
The crux of the routines is actually: image_getpixel(i
This thing is a set of imaging routines for OpenScad.
The general principle is fairly straight forward. First you need an image to be converted to a format that OpenScad can understand. In the included .zip file, there is such an executable. Just run:
ImageConverter.exe imagename > name.scad
This will generate something that looks like:
imagename_triplets_array = [0,0,0, 1,2,3, 255,255,255];
imagename = image(width, height, imagename_triplets_array)
There is a new function here: image() which takes parameters necessary to just package up some stuff for later usage in functions.
The crux of the routines is actually: image_getpixel(i
Did you print this model? Sign in and share your make!
Sign in to leave a comment
Sign inNo comments yet – be the first!