openscad-iterative-modeling

Iteratively generate OpenSCAD (SCAD) code, render PNG previews, visually critique the result, and refine in a tight loop until the model matches. Use when the user asks to create a 3D model, design a part, make a bracket/enclosure/mount, render in OpenSCAD, export STL, or any request that can be expressed as parametric CSG geometry. Requires the OpenSCAD MCP server tools (render_scad_png, export_scad_stl).

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "openscad-iterative-modeling" with this command: npx skills add fboldo/openscad-mcp-server/fboldo-openscad-mcp-server-openscad-iterative-modeling

OpenSCAD iterative modeling loop (SCAD → PNG → refine)

When to Use This Skill

  • The user asks to create, design, or model a 3D object (bracket, enclosure, mount, gear, etc.)
  • The user sends a picture of an object and asks to recreate it in 3D
  • The user wants to render or preview OpenSCAD code
  • The user asks to export an STL file from a SCAD description
  • Any request that can be expressed as parametric CSG geometry

Prerequisites

Required Tools

  • OpenSCAD MCP Server: Required for rendering and exporting OpenSCAD geometry
    • Enables: render_scad_png (SCAD → PNG preview), export_scad_stl (SCAD → STL mesh)
    • Tool names may be namespaced by the host (e.g. mcp_openscad-mcp-_render_scad_png); match by suffix
    • Must be configured and running to render previews and export models

Operating mode

  • Prefer small, parametric SCAD with named variables.
  • Each iteration: change only what the PNG critique indicates.
  • After 3 render-refine cycles without convergence, stop and ask the user for clarification.

Workflow

1. Normalize the request (minimal clarifications)

Extract and confirm only what you must to model correctly:

  • Units (default to mm if unspecified)
  • Critical dimensions (overall size, hole diameters, wall thickness)
  • Constraints (must be printable? tolerance? symmetry? sharp vs filleted edges?)

If key dimensions are missing, ask 1–3 questions. Otherwise proceed with reasonable defaults and state them.

2. Draft SCAD code (first pass)

  • Use module with named parameters.
  • Center geometry at the origin when practical (center=true).
  • Set $fn explicitly for curved parts (start with $fn=64).
  • Ensure cutters in difference() extend beyond the body to avoid zero-thickness walls.

3. Render a PNG preview

Render with cameraPreset="isometric" first (width=800, height=600). If features are hard to judge, add orthographic views:

Feature to verifyCamera preset
Plan-view layout, hole positionstop
Heights, steps, lips, profilesfront or right
Overall shape, proportionsisometric
Underside featuresbottom

4. Visually critique the PNG

Run through this checklist (in order of priority):

  1. Render valid? — If blank/error, see §Render failures below.
  2. Overall proportions — Does the bounding shape match the request?
  3. Feature presence — Are all holes, cutouts, chamfers, and fillets visible?
  4. Placement & alignment — Centered? Symmetric? Correct offsets?
  5. Orientation — Is the part oriented for its intended use (e.g. printable flat side down)?

Write a one-line verdict per issue found, e.g.:

  • "Through-hole is off-center by ~5 mm — shift translate X by +5."
  • "Lip is too tall (6 mm → reduce to 2 mm)."

5. Refine SCAD code and repeat

Apply the smallest SCAD change that addresses the critique, then render again.

Stop when the PNG matches the user's intent and the user approves.

6. Export STL (only when ready)

Once approved, export the geometry:

  • Choose a stable filename (e.g. "bracket.stl").
  • If the user wants multiple variants, export each with a distinct filename.

Render failures

If a render returns blank or errors:

  1. Simplify the SCAD to a minimal shape (e.g. a cube) to confirm the tool is working.
  2. Re-add features one at a time, rendering after each addition, to isolate the problem.
  3. Common causes: syntax error, difference() ordering, negative dimension, cutter not intersecting body.

Example loop

User request: "L-bracket, 40x30 mm base, 25 mm tall wall, 4 mm thick, two M4 countersunk mounting holes in the base."

  1. Draft SCAD:
$fn = 64;
t = 4; base_w = 40; base_d = 30; wall_h = 25;
hole_d = 4.3; csink_d = 8.5; csink_depth = 2.4;
hole_x = [10, 30]; hole_y = 15;

difference() {
  union() {
    cube([base_w, base_d, t]);                      // base
    translate([0, 0, 0]) cube([t, base_d, wall_h]);  // wall
  }
  for (x = hole_x) {
    translate([x, hole_y, -1]) cylinder(h = t + 2, d = hole_d);
    translate([x, hole_y, t - csink_depth]) cylinder(h = csink_depth + 1, d1 = hole_d, d2 = csink_d);
  }
}
  1. Render isometric -> critique: wall is on the wrong edge; move to x = base_w - t.
  2. Fix, render top -> holes look correctly spaced. Render front -> wall height correct.
  3. User approves -> export STL.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Raspberry Pi Manager

Manage Raspberry Pi devices — GPIO control, system monitoring (CPU/temp/memory), service management, sensor data reading, and remote deployment. Use when you...

Registry SourceRecently Updated
Coding

LinkdAPI

Complete LinkdAPI integration OpenClaw skill. Includes all 50+ endpoints, Python/Node.js/Go SDKs, authentication, rate limits, and real-world examples. Use t...

Registry SourceRecently Updated
Coding

Tesla Commander

Command and monitor Tesla vehicles via the Fleet API. Check status, control climate/charging/locks, track location, and analyze trip history. Use when you ne...

Registry SourceRecently Updated
0154
Profile unavailable