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 |
tools/preview.sh
View on GitHub#!/bin/bash
# Generate a preview PNG from an OpenSCAD file
# Usage: preview.sh input.scad output.png [options]
#
# Options:
# --camera=x,y,z,rx,ry,rz,dist Camera position
# --size=WxH Image size (default: 800x600)
# -D 'var=value' Set parameter value
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
source "$SCRIPT_DIR/common.sh"
check_openscad
if [ $# -lt 2 ]; then
echo "Usage: $0 input.scad output.png [--camera=...] [--size=WxH] [-D 'var=val']"
echo ""
echo "Camera format: x,y,z,rotx,roty,rotz,distance"
echo "Common cameras:"
echo " Isometric: --camera=0,0,0,55,0,25,200"
echo " Front: --camera=0,0,0,90,0,0,200"
echo " Top: --camera=0,0,0,0,0,0,200"
exit 1
fi
INPUT="$1"
OUTPUT="$2"
shift 2
# Defaults
CAMERA="0,0,0,55,0,25,0"
SIZE="800,600"
DEFINES=()
# Parse options
while [ $# -gt 0 ]; do
case "$1" in
--camera=*)
CAMERA="${1#--camera=}"
;;
--size=*)
SIZE="${1#--size=}"
SIZE="${SIZE/x/,}"
;;
-D)
shift
DEFINES+=("-D" "$1")
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
shift
done
# Ensure output directory exists
mkdir -p "$(dirname "$OUTPUT")"
# Run OpenSCAD
echo "Rendering preview: $INPUT -> $OUTPUT"
$OPENSCAD \
--camera="$CAMERA" \
--imgsize="${SIZE}" \
--colorscheme="Tomorrow Night" \
--autocenter \
--viewall \
"${DEFINES[@]}" \
-o "$OUTPUT" \
"$INPUT"
echo "Preview saved to: $OUTPUT"
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: 197k | 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: 194k | 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: 194k | 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: 194k | Updated | Claude CodeCodex | Verified | Install |