37 lines
1.5 KiB
OpenSCAD
37 lines
1.5 KiB
OpenSCAD
// Customizable Washer
|
||
// A simple, parametric flat washer for 3D printing or CAD assemblies
|
||
|
||
module washer(
|
||
inner_diameter = 6, // Diameter of the center hole (mm)
|
||
outer_diameter = 12, // Outer diameter of the washer (mm)
|
||
thickness = 2, // Thickness/height of the washer (mm)
|
||
resolution = 64 // Circle resolution ($fn). Higher values produce smoother circles (64–128 recommended)
|
||
) {
|
||
difference() {
|
||
// Outer cylinder
|
||
cylinder(
|
||
d = outer_diameter,
|
||
h = thickness,
|
||
center = true,
|
||
$fn = resolution
|
||
);
|
||
|
||
// Inner hole (slightly taller to guarantee complete subtraction)
|
||
cylinder(
|
||
h = thickness + 2,
|
||
d = inner_diameter,
|
||
center = true,
|
||
$fn = resolution
|
||
);
|
||
}
|
||
}
|
||
|
||
// ──────────────────────────────────────────────────────────────
|
||
// Example usage – change these values to generate your washer
|
||
// ──────────────────────────────────────────────────────────────
|
||
washer(
|
||
inner_diameter = 4, // ← modify this value
|
||
outer_diameter = 10, // ← modify this value
|
||
thickness = 0.2, // ← modify this value
|
||
resolution = 256
|
||
); |