This page looks best with JavaScript enabled

Building a Custom Dice Model with OpenSCAD

 ·   ·  ☕ 1 min read

OpenSCAD is a tool that can compile programs into 3D models allowing you to code your own CAD designs instead of building them inside of a WYSIWYG type editor like Fusion 360, SketchUp etc.

The module we created for a basic dice looks like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
module CreateDice(size = 16) {
    textSize = size * 0.75;
    textLocation = size / 2 - 1;
    textExtrusionSize = 2;
    difference() {
        cube([size, size, size], center = true);
        translate([0,0,textLocation]) linear_extrude(textExtrusionSize) text("1", size=textSize, halign="center", valign="center");
        rotate([180, 0, 0]) translate([0,0,textLocation]) linear_extrude(textExtrusionSize) text("6", size=textSize, halign="center", valign="center");
        rotate([0, 90, 0]) translate([0,0,textLocation]) linear_extrude(textExtrusionSize) text("2", size=textSize, halign="center", valign="center");
        rotate([0, 270, 0]) translate([0,0,textLocation]) linear_extrude(textExtrusionSize) text("5", size=textSize, halign="center", valign="center");
        rotate([90, 0, 0]) translate([0,0,textLocation]) linear_extrude(textExtrusionSize) text("3", size=textSize, halign="center", valign="center");
        rotate([270, 0, 0]) translate([0,0,textLocation]) linear_extrude(textExtrusionSize) text("4", size=textSize, halign="center", valign="center");
    }
}

Get OpenSCAD: https://openscad.org/index.html
OpenSCAD’s documentation: https://openscad.org/documentation.html
OpenSCAD on GitHub: https://github.com/openscad/openscad/

You can get a copy of my models and the SCAD files that generate them here: https://github.com/runewake2/scad-examples

Join the World of Zero Discord Server: https://discord.gg/hU5Kq2u


Sam Wronski
WRITTEN BY
Sam Wronski
Maker of things and professional software engineer. Lets make something awesome together!