General CAD LLM+RAG Grasshopper Pipeline (C# Script Series)
General CAD LLM+RAG Grasshopper Pipeline (C# Script Series)
$39.99 https://wickersonstudios.com/b/S67b1
Add to wishlist
Wickerson Studios — General CAD LLM+RAG Grasshopper Pipeline (C# Script Series)
This product is a 10-node Grasshopper STEP pipeline (00 → 09) that turns CFG/SFG strings + prompts into stable, manufacturable CAD assemblies—with optional LLM + RAG support for prompt-driven design variation.
What it does
STEP_00 (Template Starting Script / INIT):
Builds a reusable EngineState (JSON) that holds your parsed CFG + SFG, normalized keys, default values, performance caps, and a starter RAG corpus. Every downstream node reads the same STATE, so the whole system stays consistent and predictable.
STEP_01b (Example Script / Beginning Prompts):
Takes DesignPrompt + ReferenceImageUrl + MetadataText and (optionally) calls the OpenAI Responses API to produce:
cfg overrides (strict allowed keys only)
sfg channel guidance
rag_docs aligned to your prompt
Includes deterministic fallback (no API key required) and input-signature caching so it won’t re-call the API when inputs haven’t changed.
Finished Algorithm Example (Downstream “real” step):
The later steps demonstrate a production-style algorithm that consumes final Breps and outputs sheet-ready documentation primitives (part outlines, label points/strings, leader curves) while honoring caps like timeBudgetSec, maxParts, and other performance limits—so Grasshopper stays fast and stable.
Why it’s powerful
BasePlane-consistent design pipeline (no drift, predictable transforms)
Versionable CFG/SFG strings for fast iteration, presets, and productized workflows
LLM optional (works offline via deterministic fallback)
Strict schema + key constraints keep everything stable and easy to debug
Built for fast recompute: caps on parts / complexity / runtime
Download the README
Download the readme .txt
Wickerson Studios — General CAD LLM+RAG Grasshopper Pipeline (C# Node Editor)
README.txt (Download & Include with the .gh file)
1) What this is
This project is a 10-node Grasshopper “STEP” pipeline (00 → 09) that combines:
• A robust PARAMETRIC CAD engine (RhinoCommon C#)
• A configurable CFG + SFG control system (plain-text strings)
• Optional OpenAI-driven prompting (text + reference image URL) via STEP_01b
• RAG-style “precedent memory” stored in STATE (swap to file/vector-store later)
• Performance & stability controls (BasePlane consistency + caps + fallbacks)
It’s designed as an all‑purpose template for generating “clean, buildable” CAD assemblies
from prompt-driven intent—while staying deterministic and fast when you need it.
2) What’s included (template + example + finished algorithm)
A) Template starting script (STEP_00 — INIT / Master CFG+SFG / EngineState)
• Creates the EngineState JSON (STATE)
• Parses cfg/sfg
• Normalizes keys
• Installs default options + performance caps
• Loads a starter RAG corpus (small embedded dataset)
• Outputs STATE + DEBUG + LOG so every downstream node stays consistent
B) Example script (beginning prompts) (STEP_01b — OpenAI Prompting)
• Inputs: DesignPrompt + ReferenceImageUrl + MetadataText
• Uses OpenAI Responses API (optional) to generate:
- cfg overrides (only allowed keys)
- sfg channel text
- rag_docs list aligned to the prompt
• Includes:
- deterministic fallback mode if no key is present
- caching signature so it doesn’t re-call the API when inputs don’t change
- strict schema output (json_schema) for stability in Grasshopper
C) Example script (finished algorithm) (mid/late pipeline steps, e.g. STEP_07)
• Demonstrates a “real” downstream algorithm that:
- consumes assembly breps
- lays them out predictably on BasePlane (stack/grid)
- generates PartOutlineCrvs, TextPts/TextStr, LeaderCurves (sheet-ready)
- auto-builds a minimal CSV if CSV_In is empty
- honors timeBudgetSec + maxParts caps
• Shows the intended “production” style of the series:
stable, low-risk geometry operations and consistent outputs.
3) Requirements
• Rhino 7/8 + Grasshopper
• C# Script component (GH C# node editor / Script_Instance format)
• Internet + OpenAI API key (OPTIONAL; deterministic fallback works offline)
• If using OpenAI: allow https://api.openai.com/v1/responses
4) Quick start
1) Drop STEP_00 and STEP_01b onto your canvas and paste the scripts.
2) Provide a CFG string + SFG string + Seed.
3) In STEP_01b, paste:
• DesignPrompt (one of the samples below)
• ReferenceImageUrl (optional)
• MetadataText (optional)
4) Run STEP_00, then STEP_01b, then the downstream geometry steps.
Tip: If you want repeatable results, fix the Seed and avoid changing it mid-run.
5) Sample inputs (CFG / SFG / prompts)
A) CFG (lightweight defaults; fast)
(These keys may be different in your general CAD variant; keep the same style: key=value.)
brand=Wickerson Studios
project=General CAD LLM+RAG Generator
cta=https://www.wickersonstudios.com
B) SFG (structured focus guidance)
reference: “industrial product CAD precedent” (enclosures, brackets, clamps, housings) with clean part breakup + fasteners.
program: generate a manufacturable assembly (shell + ribs + bosses + panelization) with stable topology.
style: spartan, engineering-forward, readable seams, low ornament, high legibility.
massing: simple silhouette, clear split line, consistent draft direction, few unique parts.
facade: shallow panel relief, sparse vents, minimal fillets/chamfers (only where needed).
math: parameterized dims; clamps for min feature; LOD caps; time budgets to prevent heavy recompute.
notes: keep everything BasePlane-consistent; avoid drift; prefer bounding-box/plane logic to expensive booleans.
C) ReferenceImageUrl (optional)
Leave blank if you don’t have one yet. When you do:
• paste a direct image URL (https://...jpg / ...png), or use your own hosted image link.
D) MetadataText (optional)
Use this to “pin” real constraints:
• overall size, material, fabrication method, target part count, fastener sizes, etc.
Example:
Overall envelope 220 x 120 x 70 mm. Must include two screw bosses (M3) + snap-fit ribs.
Keep part count <= 40. Avoid dense panelization. Prefer planar faces.
E) Four example DesignPrompts (paste into STEP_01b)
1) Rugged electronics enclosure:
“Design a compact rugged enclosure with a clean split seam, sparse venting, and two internal PCB standoffs.
Keep the silhouette simple; emphasize manufacturable ribs + bosses; minimal panel lines.”
2) Modular clamp bracket:
“Generate a modular clamp bracket assembly with a primary shell, a clamping jaw insert, and two fastener bosses.
Keep fillets minimal; focus on structural ribs and clear assembly logic.”
3) Desk accessory organizer:
“Create a simple desk organizer body with partition ribs and a removable lid. Few parts, large planar faces,
shallow panel relief, and a single seam line that is easy to fabricate.”
4) Aerospace-style sensor pod:
“Produce a streamlined sensor pod housing with a clear midline seam split, sparse access panel, and internal stiffening ribs.
Keep the design light and avoid high panel counts; prioritize a clean silhouette.”
6) What makes it “production friendly”
• BasePlane consistency (no drifting coordinate frames)
• CFG/SFG strings for versionable configuration
• Deterministic fallback (works without the API)
• Strict schema outputs (predictable keys/values)
• Time + part caps to keep Grasshopper responsive
• Lightweight layout/annotation step for documentation outputs
7) Troubleshooting
• Outputs empty?
- Check wiring first (most common).
- Ensure Run=true on the node.
- Confirm the upstream Brep list is actually populated.
• STEP_01b not changing results?
- Your prompt might be too vague: include explicit dims/constraints in MetadataText.
- Ensure OverrideMode is “merge” or “replace” if you want stronger changes.
• Grasshopper slow?
- Lower maxParts, maxBooleans, timeBudgetSec.
- Use fewer panels/vents.
- Keep features above featureMin.
8) License / Usage
Use this pipeline as a template for your own parametric CAD products and generators.
If you share or sell derivatives, please credit Wickerson Studios where appropriate.
9) Wickerson Studios
https://www.wickersonstudios.com
You will get the following files:
GH (60KB) GH (70KB) GH (140KB) TXT (8KB)