Skip to content

Latest commit

ย 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OpenSCAD Agent Skill Suite

OpenSCAD Antigravity BOSL2 License

An agent-driven skill suite for OpenSCAD parametric 3D model generation, FDM printability validation, headless preview rendering, and slicer CLI metric calculation.

Parametric Model Render (/preview-scad) Slicer & Printability Metrics (/export-stl)
OpenSCAD preview Slicer preview

Agent Workflow Architecture

graph TD
    A["User Prompt"] --> B["/openscad-designer (Vanilla / BOSL2 / Enclosure)"]
    B --> C["Parametric .scad Code"]
    C --> D["/preview-scad (Headless OpenSCAD CLI)"]
    D --> E["Multi-Angle PNG Renders (Iso, Top, Side)"]
    E --> F["/fdm-printability-auditor + Vision Inspection"]
    C --> F
    F --> G{"Printable & Dimensionally Sound?"}
    G -- "No (Refactor)" --> B
    G -- "Yes" --> H["/export-stl + Slicer CLI"]
    H --> I["Binary .stl & Slicer Metrics"]
Loading

Quickstart

1. Installation

Copy the .agents/ and ai/ directories into your workspace root:

# PowerShell / Bash
cp -r .agents/ ai/ /path/to/your/workspace/

2. Prerequisites

  • OpenSCAD 2021.01+ on PATH or configured via OPENSCAD_PATH (e.g. C:\Program Files\OpenSCAD\openscad.com).
  • BOSL2 Library (Required for BOSL2 models): The agent automatically detects if BOSL2 is missing and offers to clone it for you on demand. Alternatively, install it manually:
    # Windows (PowerShell)
    git clone https://github.com/BelfrySCAD/BOSL2.git "$HOME\Documents\OpenSCAD\libraries\BOSL2"
  • (Optional) PrusaSlicer CLI or OrcaSlicer CLI for automated print time & filament consumption metrics.

3. Example Prompts

Run prompts directly in your agent interface:

# Core Workflow: Generate a snap-fit soap holder with vanilla OpenSCAD
/openscad-designer Create a 2-part self-draining soap holder with snap fits

# Inspect multi-view renders of an existing model
/preview-scad models/soap-holder/model.scad

# Audit FDM printability & overhangs
/fdm-printability-auditor models/soap-holder/model.scad

# (Experimental) Generate rounded enclosure with BOSL2 attachments
# /openscad-bosl2-designer Create a parametric junction box with rounded corners and M3 screw bosses

Available Skills

Core Skills (Shipped in Main Repository)

Command Engine / Library Focus / Capabilities Output
/openscad-designer Vanilla OpenSCAD Pure SCAD geometry, CSG operations & basic primitives .scad
/preview-scad OpenSCAD CLI Headless offscreen 3D viewport rendering (--imgsize) .png
/fdm-printability-auditor Rule Engine Wall thickness, overhang angles, clearances & collision checks Audit Report
/export-stl OpenSCAD CLI Convert parametric .scad to binary .stl mesh .stl
/validate-model Geometry Auditor Validate geometry parameters, sanity limits & overhangs Validation Log

๐Ÿงช Experimental Skills (In Active Development)

Note

The following skills are currently under active development, prototyping, and benchmarking. They are being stabilized and will be merged into the main release once validated.

Command Status Engine / Library Focus / Capabilities Output
/openscad-bosl2-designer ๐Ÿงช Experimental BOSL2 Library Advanced attachments, anchors, mask rounding & fillets .scad
/openscad-enclosure-designer ๐Ÿงช Experimental jl_scad + BOSL2 PCB project boxes, standoffs, vents & snap-fit lids .scad
/stl-to-openscad ๐Ÿงช Experimental Mesh Converter Re-import or reference STL meshes inside OpenSCAD .scad
/gh-issue-model-bot ๐Ÿงช Experimental GitHub Actions API Scans GitHub issues for model prompts, generates CAD & replies Issue PR / Comment
/reference-benchmark-analyst ๐Ÿงช Experimental Repos & Web Parser Benchmark external CAD repos, compare features & tech stacks Markdown Proposal

Featured Model Showcase

This repository includes tracked reference models in samples/:

๐Ÿ“ฆ Electronics & Mechanical Assemblies

๐Ÿ› ๏ธ Desk & Workshop Accessories


Features

  • Parametric Generation: Code-first OpenSCAD modeling with customizable parameters.
  • BOSL2 & jl_scad Integration: Native support for modern OpenSCAD library features (anchors, rounded edges, PCB bosses).
  • FDM Printability Validation: Automated checks for overhangs, thin walls, bridge spans, and clearances.
  • Headless Preview Rendering: Automatic camera positioning and offscreen PNG generation via OpenSCAD CLI.
  • Slicer Metric Extraction: Optional slicer CLI parsing for exact print duration and filament usage (grams / meters).
  • Metadata Logging: Full tracking of generated model parameters and audit results in model_log.json.

Repository Structure

openSCADSkill/
โ”œโ”€โ”€ .agents/
โ”‚   โ”œโ”€โ”€ AGENTS.md
โ”‚   โ””โ”€โ”€ skills/
โ”‚       โ”œโ”€โ”€ openscad-designer/          # Core: Vanilla OpenSCAD CAD generation
โ”‚       โ”œโ”€โ”€ preview-scad/               # Core: Headless CLI multi-angle rendering
โ”‚       โ”œโ”€โ”€ fdm-printability-auditor/   # Core: FDM printability validation
โ”‚       โ”œโ”€โ”€ export-stl/                 # Core: Binary STL export & slicer metrics
โ”‚       โ”œโ”€โ”€ validate-model/             # Core: Geometry & parameter auditor
โ”‚       โ”œโ”€โ”€ openscad-bosl2-designer/    # [Experimental] BOSL2 anchor & attachments
โ”‚       โ”œโ”€โ”€ openscad-enclosure-designer/# [Experimental] Enclosure builder (jl_scad)
โ”‚       โ”œโ”€โ”€ stl-to-openscad/            # [Experimental] STL mesh re-import
โ”‚       โ”œโ”€โ”€ gh-issue-model-bot/         # [Experimental] Issue-driven model bot
โ”‚       โ””โ”€โ”€ reference-benchmark-analyst/# [Experimental] External CAD benchmark tool
โ”œโ”€โ”€ ai/
โ”‚   โ””โ”€โ”€ shared/
โ”‚       โ”œโ”€โ”€ instructions/
โ”‚       โ””โ”€โ”€ scripts/
โ”œโ”€โ”€ media/
โ”œโ”€โ”€ samples/              # Tracked reference models & visual previews
โ””โ”€โ”€ models/               # Local runtime directory for generated outputs (.gitignore)

Use Cases

Ideal for:

  • Parametric electronics enclosures, housings, and mounting brackets
  • Mechanical parts with specified tolerances, snap fits, and clearances
  • Automated end-to-end 3D model generation pipelines

Not intended for:

  • Sculpted or organic 3D shapes (sculpting mesh modeling)
  • High-polygon mesh repair or topology retopology

Tested Environment

  • OS: Windows 11, Linux, macOS
  • IDE: Google Antigravity IDE V2.1.1+
  • Shell: PowerShell 7+ or Bash
  • CAD: OpenSCAD 2021.01+
  • Slicers (Optional): PrusaSlicer CLI, OrcaSlicer CLI

Related Links


License

MIT License

Releases

Packages

Contributors

Languages