Created
February 25, 2026 14:51
-
-
Save rquackenbush/6881742e558dea7d6d568fa8fd349d0b to your computer and use it in GitHub Desktop.
Hello world in OpenSCAD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $cubeSize=10; | |
| $cubeCountX=3; | |
| $cubeCountY=3; | |
| $cubeCountZ=5; | |
| for(x = [1:1:$cubeCountX]) | |
| for(y = [1:1:$cubeCountY]) | |
| for(z = [1:1:$cubeCountZ]) | |
| color([x / $cubeCountX, y / $cubeCountY, z / $cubeCountZ]) | |
| translate([x * $cubeSize, y * $cubeSize, z * $cubeSize]) | |
| cube([$cubeSize, $cubeSize, $cubeSize]); | |
| * color("red") | |
| cube([$cubeSize, $cubeSize, $cubeSize]); | |
| * color("blue") | |
| translate([0,0,$cubeSize]) | |
| cube([$cubeSize,$cubeSize,$cubeSize]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment