archibate/dotfiles-opencode / skills/openscad
openscad
VerifiedCreate and render OpenSCAD 3D models. Generate preview images from multiple angles, extract customizable parameters, validate syntax, and export STL files for 3D printing.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.1 KB |
| examples/parametric_box.scad | other | 2.6 KB |
| examples/phone_stand.scad | other | 3.1 KB |
| tools/common.shexecutable | script | 1.1 KB |
| tools/export-stl.shexecutable | script | 1.1 KB |
| tools/extract-params.shexecutable | script | 4.3 KB |
| tools/multi-preview.shexecutable | script | 1.4 KB |
| tools/preview.shexecutable | script | 1.6 KB |
| tools/render-with-params.shexecutable | script | 2.1 KB |
| tools/validate.shexecutable | script | 954 B |
examples/parametric_box.scad
View on GitHub// Parametric Box with Lid
// A customizable storage box for 3D printing
// === Box Parameters ===
width = 60; // [20:200] Width in mm
depth = 40; // [20:200] Depth in mm
height = 30; // [10:150] Height in mm
wall_thickness = 2; // [1:0.5:5] Wall thickness in mm
// === Lid Parameters ===
include_lid = true; // Include a separate lid
lid_height = 8; // [5:30] Lid height in mm
lid_tolerance = 0.3; // [0.1:0.1:0.8] Gap for lid fit
// === Style Options ===
corner_radius = 3; // [0:10] Corner rounding radius
add_grip = true; // Add grip indents to lid
// === Internal ===
$fn = 32; // Smoothness
// Rounded box module
module rounded_box(w, d, h, r) {
if (r > 0) {
hull() {
for (x = [r, w-r]) {
for (y = [r, d-r]) {
translate([x, y, 0])
cylinder(h = h, r = r);
}
}
}
} else {
cube([w, d, h]);
}
}
// Main box body
module box_body() {
difference() {
rounded_box(width, depth, height, corner_radius);
// Hollow inside
translate([wall_thickness, wall_thickness, wall_thickness])
rounded_box(
width - 2*wall_thickness,
depth - 2*wall_thickness,
height, // Open top
max(0, corner_radius - wall_thickness)
);
}
}
// Lid
module lid() {
inner_w = width - 2*wall_thickness - 2*lid_tolerance;
inner_d = depth - 2*wall_thickness - 2*lid_tolerance;
lip_height = lid_height * 0.6;
difference() {
union() {
// Top cap
rounded_box(width, depth, wall_thickness, corner_radius);
// Inner lip
translate([wall_thickness + lid_tolerance, wall_thickness + lid_tolerance, -lip_height + wall_thickness])
rounded_box(inner_w, inner_d, lip_height, max(0, corner_radius - wall_thickness));
}
// Grip indents
if (add_grip) {
for (x = [width * 0.3, width * 0.7]) {
translate([x, -1, wall_thickness/2])
rotate([-90, 0, 0])
cylinder(h = 5, r = 3, $fn = 16);
translate([x, depth - 4, wall_thickness/2])
rotate([-90, 0, 0])
cylinder(h = 5, r = 3, $fn = 16);
}
}
}
}
// Render
box_body();
if (include_lid) {
// Position lid next to box for printing
translate([width + 10, 0, lid_height - wall_thickness])
rotate([180, 0, 0])
lid();
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 193k | Updated | Claude CodeCodex | Verified | Install |