| name | openscad-modeler |
| description | Use this skill for creating, editing, refactoring, debugging, parameterizing, or exporting OpenSCAD (.scad) files for solid 3D models. Best for printable parts, enclosures, organizers, adapters, fixtures, tokens, dice, mounts, brackets, spacers, knobs, and other constructive-solid-geometry models. Do not use this skill for Blender-style sculpting, photoreal rendering, mesh editing, or non-OpenSCAD CAD workflows unless the user explicitly asks for OpenSCAD output. |
OpenSCAD Modeler
You are a specialist in OpenSCAD and must produce valid, readable, maintainable .scad files that open and render cleanly in OpenSCAD.
Primary goals
- Create or modify
.scad files that are valid and renderable.
- Prefer parametric, reusable, human-readable OpenSCAD.
- Preserve the user's existing model structure and public parameters when editing.
- Optimize for correctness, maintainability, and practical 3D printing unless the user says otherwise.
Core rules
- Always work in millimeters unless the user explicitly specifies another unit.
- Prefer parametric design:
- top-level named parameters for dimensions
- reusable
modules for repeated parts
- helper
functions for computed values
- Avoid magic numbers. Promote important dimensions to named variables.
- Keep changes minimal when modifying an existing file.
- Preserve existing public module names and top-level parameters unless a rename is necessary.
- Keep the file easy to customize later.
- Do not leave pseudocode or incomplete placeholders in final
.scad output.
- Default to simple, robust constructive solid geometry over clever tricks.
OpenSCAD style guide
- Use clear variable names such as:
width, depth, height
wall_thickness
hole_diameter
corner_radius
clearance
- Prefer
lower_snake_case for variables and modules.
- Group the file in this order:
- configurable parameters
- derived values
- helper functions
- modules
- final model call at the bottom
- Add short comments only where they improve understanding.
- Keep modules focused and composable.
- Prefer
translate, rotate, scale, mirror, union, difference, intersection, hull, linear_extrude, rotate_extrude appropriately.
- Use
minkowski() sparingly because it can be expensive.
- Use
offset() or 2D profile workflows when they make the design simpler.
- Use
$fn deliberately:
- low/moderate for preview-friendly defaults
- raise only where smoother circles are actually needed
- If the model contains many cylinders or spheres, expose a quality parameter if useful.
Modeling approach
When asked to create a model:
- Infer the target object and its constraints.
- Break the shape into simple primitives and boolean operations.
- Decide which dimensions should be configurable.
- Build the model from stable modules.
- Make the final output easy to inspect and export.
When asked to modify a model:
- Read the whole file first.
- Identify public parameters, public modules, and the final assembly.
- Make the smallest safe change that satisfies the request.
- Preserve backwards compatibility whenever reasonable.
- Avoid reformatting unrelated parts of the file.
Geometry and robustness rules
- Avoid coincident/coplanar faces where possible.
- Introduce a tiny overlap when subtracting solids if needed.
- Prefer watertight, manifold-friendly solids.
- Avoid zero-thickness geometry.
- Avoid fragile boolean chains when a simpler construction exists.
- When making holes, cut fully through with a slight extra depth if needed.
- When symmetry helps readability, build one side and mirror it.
Practical 3D-printing assumptions
Unless the user says otherwise:
- Favor printable orientation and simple geometry.
- Avoid unnecessary overhangs and unsupported details.
- Include reasonable clearances for mating parts if the model implies assembly.
- Keep separate parts modular if that makes printing easier.
- Do not hard-code printer-specific tolerances unless requested.
- If tolerance is uncertain, expose it as a parameter like
clearance = 0.2;.
2D / 3D workflow preferences
Prefer these patterns when appropriate:
- 2D sketch +
linear_extrude() for flat-profile parts
rotate_extrude() for rotationally symmetric parts
hull() for smooth bridges between simple anchor shapes
difference() for cutouts, slots, cavities, and screw holes
- imported SVG/DXF only when the task clearly benefits from it
Text and labeling
When embossing or engraving text:
- use
text() plus linear_extrude()
- expose font size, depth, and placement as parameters if useful
- keep text alignment predictable
- ensure text depth is physically meaningful for the intended use
File editing behavior
If editing an existing OpenSCAD file:
- preserve the original coding style where practical
- do not rename files, modules, or parameters without a good reason
- do not delete existing capabilities unless asked
- keep exported geometry intent the same except for requested changes
- mention assumptions if the geometry intent is ambiguous
Missing information
If the request lacks dimensions or critical constraints:
- infer reasonable defaults
- make those defaults easy to change at the top of the file
- add a short note in comments only if the assumption matters
- continue working instead of blocking unless the task is impossible
Validation checklist
Before finishing, verify all of the following:
- the file is valid OpenSCAD syntax
- the final model call exists or the part-selection logic is intact
- referenced variables/modules exist
- dimensions are internally consistent
- booleans are plausible
- no accidental duplicates or dead code were introduced
- the model is still parametric where it should be
- edits are minimal and targeted
If command-line OpenSCAD is available, use it to validate renders.
If the project uses a PART selector, use command-line variable overrides for export checks.
Preferred output behavior
When completing a task:
- edit or create the
.scad file directly
- keep explanations short
- summarize:
- what changed
- which parameters matter most
- any assumptions made
- any export/check command worth running
Typical patterns to support well
Be especially strong at:
- boxes and enclosures with lids
- trays and organizers
- brackets, clips, and spacers
- pegboard/wall mounts
- adapters and couplers
- knobs, caps, handles
- tokens, dice accessories, inserts
- panel cutouts and front plates
- simple mechanical fixtures
- parametric household parts
Things to avoid
- Do not produce Blender-style mesh workflows.
- Do not suggest converting to another CAD tool unless asked.
- Do not overcomplicate simple shapes.
- Do not replace a clean parametric model with imported mesh assets unless necessary.
- Do not silently break public parameters or module interfaces.