Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
ThatPainter
3D modeling

How to Design Custom Game Dice with OpenSCAD

Create a parameterized OpenSCAD d6 with rounded edges and reusable pip cutters, then render, export, and test it before moving on to polyhedral dice.

By ThatPainter Team 11 min read
Worth Installing

Crashes, No Sound, or Screen Glitches?

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Outbyte Driver Updater · freeRandom freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteFind the Right Drivers →

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ThatPainter is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Learn More

OpenSCAD is a good fit for custom dice when you want dimensions, markings, and variations controlled by code. Start with a six-sided die: build a rounded body, subtract reusable pip or number cutters from each face, render the finished solid, and export it as an STL. This guide includes a parameterized d6 script and explains how to adapt the approach for other shapes. A printable model is not automatically a fair die; markings, print defects, and material distribution can affect how it rolls.

Choose the kind of custom die you want

“Custom die” can mean changing the markings, the shape, or both. A d6 is the easiest first project: its faces are simple planes, traditional pip patterns are familiar, and it demonstrates OpenSCAD’s core tools. A numbered polyhedral die such as a d8 or d20 is a bigger step because each face needs its own orientation and the underlying polyhedron must be valid. A themed die might use a logo, custom symbols, raised marks, or a nonstandard set of outcomes.

OpenSCAD is a script-based, parametric solid modeller. It suits rigid geometric objects and repeatable designs: change a parameter and regenerate the model, or use loops and arrays to make variants. It is less suited to sculpting organic shapes or positioning details by eye than an interactive modelling tool. See the OpenSCAD manual and cheat sheet for the language and built-in modules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you need

  • OpenSCAD: Install the stable release unless you specifically need a development-build feature. As of August 18, 2026, the official downloads page identifies 2021.01 as stable and lists 2026 builds separately as development snapshots. Labels and rendering behavior may differ in development builds.
  • A slicer and printer, or a print service: The slicer turns the STL into printer instructions. You can also export the STL and have it printed.
  • Optional: BOSL2: The BOSL2 library offers reusable geometry and polyhedron tools. It requires OpenSCAD 2021.01 or later and describes itself as beta code. You do not need it for the d6 below.

Build a parameterized rounded d6

OpenSCAD does not enforce a unit system. Millimeters are a practical convention for 3D printing. Keep dimensions in named variables so you can tune the model without hunting for scattered numbers. The following complete example makes a rounded d6 with conventional opposing totals (1 and 6, 2 and 5, 3 and 4). Its pips are spherical cutters subtracted from the body.

#1 Best Overall
Bambu Lab P1S Combo, P1S 3D Printer and AMS, Multi-Color 3D Printing
  • Up to 16 Colors: Bring your designs to life with vibrant multi-color/multi-material printing capabilities, perfect for showcasing your creativity. Note: Connecting Bambu Lab AMS is required.
  • 500mm/s and 20000 mm/s² Acceleration True High Speed: Don't wait around for your masterpieces. Lightning-fast printing speed lets you focus on creating, not waiting.
  • Enclosed Design: Fully enclosed body improves print performance for advanced filaments. Automatic Bed Leveling: Say hello to high-quality, successful prints. Auto bed leveling makes 3D printing such an easy thing.
  • Set Up in 15 Minutes: Spend more time printing and less time setting up. User-friendly design ensures a hassle-free assembly experience for all skill levels.
  • Supported Filament: Ideal: PLA, PETG, TPU, PVA, PET ABS, ASA; Capable : PA, PC; Not Recommended: Carbon/Glass Fiber Reinforced Polymer.
// Custom rounded d6 in OpenSCAD; dimensions are in millimeters

die_size    = 20;
edge_radius = 2;
pip_radius  = 1.45;
pip_depth   = 0.9;   // intended recess depth; tune pip placement below
pip_spacing = 4.2;
$fn = 40;

module rounded_cube(size, radius) {
    minkowski() {
        cube([size - 2*radius,
              size - 2*radius,
              size - 2*radius], center = true);
        sphere(r = radius);
    }
}

module pip(x, y, z) {
    translate([x, y, z]) sphere(r = pip_radius);
}

module pips_for_face(number, z = die_size/2 + pip_radius - pip_depth) {
    if (number == 1) pip(0, 0, z);
    if (number == 2) {
        pip(-pip_spacing, -pip_spacing, z);
        pip( pip_spacing,  pip_spacing, z);
    }
    if (number == 3) {
        pip(-pip_spacing, -pip_spacing, z); pip(0, 0, z);
        pip( pip_spacing,  pip_spacing, z);
    }
    if (number == 4) {
        pip(-pip_spacing, -pip_spacing, z); pip(-pip_spacing,  pip_spacing, z);
        pip( pip_spacing, -pip_spacing, z); pip( pip_spacing,  pip_spacing, z);
    }
    if (number == 5) {
        pip(-pip_spacing, -pip_spacing, z); pip(-pip_spacing,  pip_spacing, z);
        pip(0, 0, z);
        pip( pip_spacing, -pip_spacing, z); pip( pip_spacing,  pip_spacing, z);
    }
    if (number == 6) {
        pip(-pip_spacing, -pip_spacing, z); pip(-pip_spacing, 0, z);
        pip(-pip_spacing,  pip_spacing, z);
        pip( pip_spacing, -pip_spacing, z); pip( pip_spacing, 0, z);
        pip( pip_spacing,  pip_spacing, z);
    }
}

module all_pips() {
    // Local face plane is +Z; rotate it onto each cube face.
    pips_for_face(1); // top, +Z
    rotate([180, 0, 0]) pips_for_face(6); // bottom, -Z
    rotate([90, 0, 0])  pips_for_face(2); // front, +Y
    rotate([-90, 0, 0]) pips_for_face(5); // back, -Y
    rotate([0, 90, 0])  pips_for_face(3); // right, +X
    rotate([0, -90, 0]) pips_for_face(4); // left, -X
}

difference() {
    rounded_cube(die_size, edge_radius);
    all_pips();
}

The default cutter center places each sphere so it intersects the face and forms a shallow dish. The exact resulting shape and depth depend on the sphere radius and how far it enters the body; adjust the parameters, render, and inspect before printing. If a pip is only a shallow mark or does not cut at all, check that the sphere overlaps the body rather than sitting entirely outside it.

Understand the rounded body

minkowski() expands a smaller cube by a sphere, making a rounded cube whose overall dimensions are approximately size. The radius must be less than half the die size. This is an intuitive way to make curved edges, but high curve resolution can make a Minkowski render slow. For faster drafts, reduce $fn. For a more angular look and lighter geometry, build a chamfered body instead: a chamfer is a flat bevel, while a fillet or rounded edge is curved. Neither shape guarantees casino-style rolling behavior.

$fn controls the number of facets used to approximate curved shapes; OpenSCAD also provides $fa and $fs for angular and size-based resolution. Higher resolution can look smoother in the model but increases rendering work and mesh size. It cannot exceed the detail your printer can reproduce.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the face placement works

The pips are defined in local coordinates on a +Z-facing plane. Rotating the group moves that plane onto another cube face. This is why the coordinates can be reused rather than written separately for all six sides. Inspect the face directions in preview: changing rotations or pip coordinates can change orientation, and personal preferences for which way numbers face vary.

For a more reusable d6 layout, store patterns as arrays of coordinate pairs and loop over them. OpenSCAD arrays are zero-indexed, so a user-facing face number from 1 to 6 maps to an array entry with face_number - 1. The explicit conditions in the starter script are longer but easy to follow and modify.

Rank #2
Sale
FLASHFORGE Adventurer 5M 3D Printer with Fully Auto Leveling, Max 600mm/s High Speed Printing, 280°C Direct Extruder with 3S Detachable Nozzle, CoreXY All Metal Structure, Print Size 220x220x220mm
  • One-Click Automatic Printing: Experience hassle-free 3D printing with the Adventurer 5M Series. Enjoy automatic bed leveling for flawless first layers, ensuring consistent adhesion and saving time with no manual adjustments required.
  • 12X Ultra Fast Printing: Featuring a CoreXY structure with 600mm/s travel speed and 20000mm/s² acceleration, the AD5M maximizes efficiency, reduces production cycles, and ensures high precision, making it ideal for rapid prototyping and mass production.
  • Smart and Efficient Design: Quick 3-second nozzle changes, a high-flow 32mm³/s nozzle, and fast 35-second warm-up to 200°C deliver stable high-speed printing. Its dual-sided PEI platform and versatile options provide easy removal and adaptability for various creative projects.
  • Superior Print Quality & Adaptability: Combines a 280°C direct drive extruder with dual-fan cooling and vibration compensation. Includes a standard 0.4mm nozzle and accepts optional sizes from 0.25mm to 0.8mm to fit various printing needs.
  • Real-Time App Monitoring: Monitor print progress, adjust settings, and receive instant status alerts remotely with the Flash Studio. Smart mobile control ensures a seamless, effortless printing experience anytime, anywhere.

Engrave, emboss, or add another kind of mark

The example uses difference(): OpenSCAD subtracts the pip cutters from the body. This is engraving. Recesses usually snag less than protruding details and leave the exterior silhouette unchanged, but tiny cuts can vanish in a print and deep cavities can collect debris.

To make raised markings, combine the body and mark solids with union() instead. Raised marks can be easier to see or feel and may suit tactile or display dice, but thin details can break and protrusions can affect rolling. Neither approach is inherently fair. For an ordinary rolling die, shallow, similarly sized engravings are a sensible starting point; print tests decide what is legible and durable on your equipment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use numbers or custom symbols

OpenSCAD’s text() creates 2D text; linear_extrude() gives it thickness so it can be used as a cutter or raised solid. For example:

module number_mark(n, size = 5, height = 1) {
    linear_extrude(height = height)
        text(str(n),
             size = size,
             halign = "center",
             valign = "center",
             font = "Liberation Sans:style=Bold");
}

To engrave text, orient it to the face, place it at that face, and make the extruded cutter overlap the die. For an unrotated top face, a cutter can begin just below the surface and extend outward slightly; the extra overlap avoids a coplanar cut. Transform text for the other faces the same way as the pip layout. Always inspect actual glyph orientation and placement, especially for 6 and 9, and confirm that the font creates sufficiently thick strokes.

Font names depend on fonts installed on the computer. A name that works on one operating system may be missing on another, so a script can render differently on a second machine. Bold, simple sans-serif letters tend to be more robust than thin serifs, but inspect the rendered result. For repeatable designs, document the font or use an imported vector outline. Logos and symbols can also be built from OpenSCAD geometry or imported as SVG outlines; verify the file path, scale, and resulting solid.

Rank #3
Bambu Lab P1S 3D Printer, Ready-to-Use FDM 3D Printer
  • Up to 16 Colors: Bring your designs to life with vibrant multi-color/multi-material printing capabilities, perfect for showcasing your creativity. Note: Connecting Bambu Lab AMS is required.
  • 500mm/s and 20000 mm/s² Acceleration True High Speed: Don't wait around for your masterpieces. Lightning-fast printing speed lets you focus on creating, not waiting.
  • Enclosed Design: Fully enclosed body improves print performance for advanced filaments. Automatic Bed Leveling: Say hello to high-quality, successful prints. Auto bed leveling makes 3D printing such an easy thing.
  • Set Up in 15 Minutes: Spend more time printing and less time setting up. User-friendly design ensures a hassle-free assembly experience for all skill levels.
  • Supported Filament: Ideal: PLA, PETG, TPU, PVA, PET ABS, ASA; Capable : PA, PC; Not Recommended: Carbon/Glass Fiber Reinforced Polymer.

Make the script easy to customize

Put the values you expect to change—die size, edge radius, mark size, depth, spacing, font, and whether the marks are raised or engraved—at the top of the file. Use modules for the body and each marking operation. Small, deliberate parameter changes are easier to debug than changing many dimensions at once. OpenSCAD’s documentation covers the Customizer, which can expose selected variables as controls for people who would rather adjust options than edit the script directly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Moving from a d6 to a d20

A d20 is not a d6 with more markings. It needs a valid 20-face polyhedron and a reliable way to orient a mark on each face. OpenSCAD’s polyhedron(points, faces, convexity) module takes a vertex list and faces that reference those vertices. The shell must be closed and non-self-intersecting, and face winding must be consistent so faces point outward. Missing faces, reversed winding, duplicate or nearly coincident vertices, and self-intersections can break rendering or booleans.

A practical learning sequence is: finish the d6, make a simple tetrahedron or octahedron, learn the vertex-and-face data structure, and only then add face-aligned markings. For an arbitrary face, you need its center c, outward unit normal n, and two in-plane directions u and v. A marking is made in a local coordinate system and transformed so its local Z axis follows n. The normal alone does not set the text’s upright direction: the mark can still rotate around that normal.

Hand-authoring a d20 vertex list is easy to get wrong. For advanced polyhedra, consider a maintained library such as BOSL2, whose documentation includes polyhedron and VNF (vertices ’n’ faces) tools. Its attachment system does not attach every native OpenSCAD module; in particular, the library notes limitations for modules such as text(), linear_extrude(), and polyhedron(). Treat library helpers as tools, not as proof that a model is valid. Validate the final solid and every marking transform.

Render, inspect, and export an STL

  1. Preview with F5. Use OpenCSG preview to position features quickly. A clean-looking preview is not proof that the final mesh is valid.
  2. Render with F6. Run a full CGAL render before exporting. Check the Console and resolve geometry errors rather than treating them as cosmetic.
  3. Inspect the solid. Look for missing cuts, inverted or misplaced markings, open surfaces, and details too close to edges. If needed, render the body and cutters separately.
  4. Export the rendered object as STL. OpenSCAD’s manual documents export formats and command-line use. For automation, a generic command is openscad -o custom-die.stl custom-die.scad; the executable name, path, and shell syntax vary by platform.
  5. Open the STL in your slicer. Check orientation, scale, warnings, and the sliced layers before printing.

Print a test before committing to a design

There is no universal minimum printable pip, text stroke, or engraving depth. Results depend on printer type, nozzle or optical resolution, layer height, material, orientation, slicer settings, surface angle, font, and whether the feature is raised or recessed. Formlabs’ design guide gives about 0.4 mm minimum engraved detail and 0.5 mm minimum clearance for its referenced process; those figures are process-specific, not general FDM guarantees (Formlabs design guide). Make a small test with several mark sizes or depths before scaling the design to a final die.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Bambu Lab P2S Combo, P2S 3D Printer & AMS 2 Pro, Multi-Color 3D Printing
  • High-Speed Precision: The Bambu Lab P2S 3D printer prints up to 600 mm/s while maintaining exceptional accuracy. With the PMSM Servo Extruder and Active Flowrate Compensation, every layer of your printed object stays sharp and smooth, delivering flawless corners and consistent results.
  • Ready to Print in 15 Minutes: Set up your P2S FDM 3D printer and start printing in just 15 minutes. With AI failure detection, quick-swap nozzles, and automatic calibration, this 3D printer makes professional-grade 3D printing effortless, even for beginners.
  • Effortless Multi-Color Printing: The AMS 2 Pro enables seamless multi-color/multi-material 3D printing. It features built-in filament drying at up to 65 °C, keeping every spool ready for flawless prints. (Note: The P2S 3D printer does not support multi-color printing; Combo version required.)
  • Smart Airflow for Any Filament: The Adaptive Airflow System automatically balances cooling and heat retention—keeping overhangs crisp with cool air, or maintaining a 50 °C chamber for engineering-grade materials. A carbon filter ensures clean, safe air while you print.
  • Limitless Creativity, Seamless Workflow: Explore over one million 3D models on MakerWorld and bring them to life with a smooth, unified workflow using Bambu Studio, Bambu Handy, and your FDM 3D printer, from design to finished print.
  • Use bold lettering and avoid extremely thin strokes.
  • Make a recess deep enough to survive the intended print process, but keep it similar across faces.
  • Test a small calibration die or decorated face first.
  • For separate inserts or two-piece dice, add a parameter such as fit_clearance and calibrate it with your printer, material, slicer, feature size, and orientation. A nominal fit is not guaranteed. BOSL2 describes its $slop clearance concept and warns that the right value varies by setup.

FDM: A die printed on one face may have a visibly different bottom face. Elephant foot can distort that face; seams can leave a tactile line; overhangs may require supports, whose marks can damage decorated surfaces. Layer lines and small recessed cuts may reduce legibility. Choose orientation with the marked faces and support scars in mind.

Resin: Resin can capture small decorative detail, but dice can still have brittle features, support marks, or uneven results. Hollow models need drainage and post-processing considerations. Uncured resin is hazardous; follow the printer and material manufacturer’s handling, washing, and curing instructions. Resin printing does not make a die automatically fair.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does a 3D-printed die roll fairly?

A symmetrical-looking model is not evidence of statistical fairness. Unequal marking volume, deep or large engravings, raised symbols, internal voids, infill variation, material-density differences, layer seams, support scars, warping, and surface roughness can all shift behavior or the center of mass.

For a casual game, keep marks similar in size and depth across faces, avoid a large logo or heavy decoration on only one side, and use a uniform solid or carefully controlled internal structure. Keep familiar opposing-face totals if you want a conventional d6. Print more than one and compare them in use, but do not claim that a visual inspection proves fairness. For serious gambling or tournament use, choose certified dice rather than relying on an untested home print.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshooting

A cut or marking is invisible

The cutter may not overlap the body, may be on the wrong side of the face, or may be too shallow. With text, it may also be too thin or facing away. Move the cutter into the solid enough to intersect, increase depth cautiously, and use a bolder font. Render with F6 to inspect the actual result. Temporarily show a marking on its own with OpenSCAD’s % modifier, or use a contrasting color while checking placement.

Best Value
FLASHFORGE Adventurer 5M Pro 3D Printer with 1 Click Auto Printing System
  • 600mm/s Speed & CoreXY Structure — Powered by an all-metal CoreXY frame and 20,000mm/s² acceleration, Adventurer 5M Pro reaches speeds up to 600mm/s. Integrated vibration compensation algorithms eliminate ghosting and ringing for smooth, high-precision surface finishes.
  • 3-Second Quick-Swap Nozzle & Auto Leveling — Features a tool-free, quick-release nozzle mechanism for effortless 3-second replacements across multiple sizes (0.25/0.4/0.6/0.8mm). One-click full auto-leveling ensures precise bed calibration and a perfect first layer every time.
  • Dual Filtration System & Quiet Enclosure — Built with an integrated dual filtration system and a fully enclosed chamber to ensure a clean printing environment and thermal stability. Powered by low-noise motion control, it operates quietly under 50dB for seamless home, office, or classroom use.
  • 280°C High-Temp Extruder & Broad Material Compatibility — With a 280°C max nozzle temperature and a 110°C heated bed, it reliably prints engineering materials like ABS, ASA, and PETG-CF, as well as standard PLA and PETG.
  • Smart Camera & Mobile Control — Features a built-in camera for real-time monitoring and time-lapse video creation. Monitor progress, adjust settings, and receive instant status alerts via Flash Studio. Integrated with filament detection, power loss recovery, and a 4.3-inch touchscreen for effortless operation.

difference() appears to do nothing

Confirm both objects are solids and overlap. A 2D text outline cannot cut a 3D body until it is extruded. Check the face rotation and translation, and render the body and cutter separately. A temporary union() can help confirm whether two parts occupy the expected space.

F6 reports a CGAL error

Render the body alone, then the cutter alone, and add boolean operations back one at a time. Check polyhedron face winding and closure, remove self-intersections or duplicate surfaces, and avoid nearly coplanar cutters by giving them deliberate overlap. Reduce $fn or replace a costly rounded operation with a chamfer to narrow down performance or geometry problems. BOSL2’s VNF tools may help with advanced polyhedron validation.

The model previews but will not export

Run F6 first; do not treat the preview as the exportable mesh. Check the Console, ensure the top-level object is a solid, and simplify the model to identify the failing part. Exporting a simpler body and adding features back incrementally can isolate a bad boolean.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The printed numbers are rough or missing

Try larger lettering, thicker strokes, a deeper but still consistent recess, or a different print orientation. Test a printer-specific sample. If you need more contrast, consider raised marks or a two-color workflow, then assess whether protrusions change the way the die rolls.

Next projects

Once the d6 works, adapt the same parameter-and-module approach to a custom symbol die, a tactile raised-mark die, or a numbered d8. For a d20, first solve the polyhedron and local face frames rather than copying cube rotations. Keep a known-good d6 version so changes to a more complex model do not erase a working starting point.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

More from the Paint Desk

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.