What you'll build
A reusable OpenSCAD module cup(height, radius, wall, bottom).
Build a reusable cup() module so you can generate hollow cylinders in different sizes without rewriting geometry each time.
What you'll build
A reusable OpenSCAD module cup(height, radius, wall, bottom).
Why this helps
Can be used across multiple projects, easily created hollowed cylinder
Save this as cup.scad:
module cup(height, radius, wall, bottom) { difference() { cylinder(h = height, r = radius, center = true); translate([0, 0, bottom]) cylinder(h = height, r = radius - wall, center = true); }}Parameter guide:
| Parameter | Meaning |
|---|---|
height | Total cup height |
radius | Outer radius |
wall | Wall thickness |
bottom | Vertical offset for the inner cutout (controls bottom thickness) |
Import the module file with use, then call cup(...) with your desired dimensions.
use <cup.scad>;
$fn = 92;cup(63, 32, 3, 3);| Feature | Value |
|---|---|
| Purpose | A cup for dice rolling |
| Surface quality | Smooth round walls ($fn = 92) |
| Wall thickness | 3mm |
| Bottom thickness | 3mm |
