Modern hardware programs span CAD, CAE, CAM, BOM, sourcing, factory automation, and project management. Designs change rapidly; syncing geometry, constraints, analyses, and manufacturing outputs across tools is fragile and manual. CSL exists to make complex, multi-domain engineering agent-friendly, reproducible, and automated.
CSL (CAD-Specific Language) is a compact DSL and JSON IR that describes geometry, constraints, selections, assemblies, and exports in a deterministic, parametric way. Itâs designed for AI agents and humans to co-author designs that are portable across backends. The companion âTriple Lindyâ agent converts natural language into CSL, plans across backends, and realizes results in target tools.
- Meta-parametric design: parameters with units, ranges, and expressions; deterministic evaluation order.
- Robust selections: query by geometry/topology/tags/lineage for stable edits over time.
- Assemblies and joints: mate connectors/LCS, joints; stable instance IDs.
- Export and visualization: STEP/STL/⌠and thumbnails for downstream workflows.
- Backend capabilities: adapters declare feature support; the agent plans fallbacks.
- Production ready:
- Fusion 360 via Python API with real-time control (v12 - fully functional)
- FreeCAD via Python API with workbench integration (v1.3 - 100% feature coverage)
- In development: Onshape (REST API/FeatureScript)
- Planned: SolidWorks (.NET/COM), NX, Blender (Geometry Nodes)
- Adapters publish capabilities so agents can pick the highest-fidelity route with graceful degradation.
- File-based protocol for reliable communication with CAD software
- Universal client (
file_client.py) works across all backends - Query system for debugging and state inspection
- Direct API and CSL transpilation modes
- No silent failures - comprehensive error reporting
- CAE: link meshing/solvers and optimization runs to design parameters.
- CAM: export manufacturable geometry with tolerance/finish metadata.
- BOM and sourcing: extract parameters and materials for structured BOM lines.
- Project/PLM: emit milestones, traceability, and build artifacts per revision.
- Factory automation: generate fixtures/tooling geometry and export to downstream.
- Natural language â Triple Lindy agent â CSL (text) â JSON IR.
- JSON IR â Backend adapter (Fusion/Onshape/SolidWorks/FreeCAD/Blender, etc).
- Adapter executes features, applies selections, exports files and thumbnails.
- Capabilities and diagnostics guide planning, fallbacks, and error reporting.
# 1) Clone
git clone https://github.com/ricfulop/CSL.git
cd CSL
# 2) Install Triple Lindy Fusion add-in (macOS example)
cp -r triple_lindy_fusion_stable "$HOME/Library/Application Support/Autodesk/Autodesk Fusion 360/API/AddIns/"
# 3) In Fusion 360: Scripts & Add-Ins (Shift+S) â Add-Ins tab â Run "triple_lindy_fusion_stable"
# 4) Test real-time control
python3 triple_lindy_daemon/file_client.py ping # Test connection
python3 triple_lindy_daemon/file_client.py query # Query current state
python3 triple_lindy_daemon/file_client.py direct # Create geometry via API
# 5) Execute CSL v1.3 examples
python3 triple_lindy_daemon/file_client.py file --file CSL_v1_2/examples/loft_continuity_demo.jsonOptional backends
- FreeCAD workbench: copy
triple_lindy/to~/.FreeCAD/Mod/and select âTriple Lindyâ. - Onshape: configure API keys and use FeatureScript/API pipeline.
- SolidWorks: install add-in or IPC shim; Windows host.
- Blender:
bpy/Geometry Nodes realization; render/export for visualization.
- Spec (v1.3 Draft):
CSL_v1_3/csl_v1_3_spec.md - JSON Schema (v1.3 Draft):
CSL_v1_3/csl_v1_3_schema.json - Spec (v1.2 Draft):
CSL_v1_2/csl_v1_2_spec.md(extends v1.1) - JSON Schema (v1.2 Draft):
CSL_v1_2/csl_v1_2_schema.json - Migration:
MIGRATION_v1_1_to_v1_2.md - Conformance checklists:
CSL_v1_1/conformance/README.md,CSL_v1_2/conformance/README.md - Examples:
CSL_v1_2/examples/(v1.2) andCSL_v1_1/examples/(v1.1)- Notable v1.1 example:
constraints_patterns_demo.csl(construction/driven constraints, per-instance patterns)
- Notable v1.1 example:
- Surface ops with explicit queries (patch/extend/trim/knit).
- Patterns perâinstance controls (
instances/table). - Constraints QoL: construction flags, reference (driven) dims, equalâlength arrays, curvature continuity diagnostics.
- Loft: continuity (G0/G1/G2), perâsection continuity, orientation options, rails/centerline.
- Export: STL tessellation controls (deviation, angular tolerance, aspect ratio, max edge length).
- Capabilities: refined JSON and versioned publishing (
make publish-caps).
- Sketch:
spline,ellipse,elliptical_arc,text. - Loft: continuity G0/G1/G2, orientation controls, rails/centerline.
- Sweep: orientation, twist, scale, optional guide rail.
- Fillet/Chamfer: perâedge variable groups; transitions/setbacks (bestâeffort).
- Draft: explicit
faces,neutral_plane, optionalpull_dir. - Wrap/Emboss/Project: depth/draft/direction; project along direction.
- Threads: standardized designations/classes/handedness; modeled vs cosmetic.
- Queries:
created_by,owner_feature==,pattern_instances,tangent_connected,largest_by,curvatureâ/radiusâ/areaâ,by_material. - Assemblies & joints: limits
{linear, angular}, optional damping/preload. - Sheet metal: base/edge flange/bend; unfold/refold (bestâeffort).
- Helix curve generator; light PMI notes/frames.
- Validation:
make validate-v12checks IR against the v1.2 schema.
- Backend parity and gaps:
BACKEND_GAP_ANALYSIS.md. - Roadmap priorities: Fusion adapter completeness, robust selection predicates, manufacturing exports.
See Production-Grade Closure Plan in BACKEND_GAP_ANALYSIS.md for remaining items (native wrap/emboss, cross-session stable IDs, units parity tests, full joints, materials/PMI, APS hardening).
Run representative cases (loft continuity G1/G2 with rail, variable fillet/chamfer including angle, emboss/native where available, joints with revolute/slider limits) and emit a JSON report.
python scripts/conformance_harness.pyOutputs:
out/conformance_report.json: summary with per-caseok,mapping_size, and recent diagnostics.out/golden_summary.json: short summary for CI gates.- Dry-run friendly: if Fusion API is unavailable, the adapter returns a stable mapping and diagnostics for CI.
- Auth test:
export APS_CLIENT_ID=... APS_CLIENT_SECRET=...
make aps-auth- Orchestrate example (local Fusion run + upload when configured):
make aps-orchestrate-example- Design Automation (DA) stub:
make aps-da-list-enginesSet APS_SCOPES and optionally APS_BUCKET (defaults to csl-artifacts-<env>).
Quickly exercise STL/STEP unit and resolution options.
python scripts/export_units_test.py- Issues and proposals welcome. For large changes, start with a short design note.
- Adapters should implement a minimal interface and publish capabilities for planning.
- Create a virtualenv and install dev tools (pytest optional).
- Review the adapter stub at
triple_lindy/transpilers/fusion360_backend.py. - Run the demo script:
python scripts/run_fusion_example.py- Implement real Fusion calls in
FusionBackend.realize/export/thumbnail. - Extend capabilities and add tests that validate exported artifacts.
MIT (see LICENSE).
-
Current snapshot (as of 2025-01-13):
- Total lines: 1838992,058
- Python lines: 17737,335
- Markdown/docs lines: 1325283,726
- JSON lines: 57417,686
- CSL language files: 301
- Fusion backend file
triple_lindy/transpilers/fusion360_backend.py: 5388,388
-
File counts by type:
- Python files: 52
- Markdown files: 44
- JSON files: 16
- CSL files: 15
- TypeScript files: 9
- Manifest files: 9
-
Recompute locally (from repo root):
# Totals (excluding .git, out, __pycache__)
find . -type f -not -path "./.git/*" -not -path "./out/*" -not -path "*/__pycache__/*" -print0 | xargs -0 wc -l | tail -n1
# By type
find . -type f -name "*.py" -not -path "*/__pycache__/*" -print0 | xargs -0 wc -l | tail -n1
find . -type f -name "*.md" -print0 | xargs -0 wc -l | tail -n1
find . -type f -name "*.json" -print0 | xargs -0 wc -l | tail -n1
find . -type f -name "*.csl" -print0 | xargs -0 wc -l | tail -n1
# Key file
wc -l triple_lindy/transpilers/fusion360_backend.py
# File count by extension
find . -type f -not -path "./.git/*" -not -path "./out/*" -not -path "*/__pycache__/*" | sed 's/.*\.//' | sort | uniq -c | sort -nr- Documentation index:
DOC_INDEX.md - CSL Glossary:
CSL_GLOSSARY.md - Triple Lindy implementation guide:
triple_lindy_complete with CSL.md
- Adds: surface ops explicit queries, patterns perâinstance (
instances/table), constraints QoL, loft continuity/orientation/rails, STL controls. - Continues: v1.2 features (loft, sweep, wrap/emboss/project, threads, face ops, patterns, booleans), robust queries, diagnostics, export/thumbnail.
- Assemblies/joints: creation with limits; bestâeffort mate connectors and assembly patterns.
- APS: token/bucket upload helpers and an
orchestrate(plan)helper for local/hosted agent models.
- Predicates supported:
created_by/owner_feature==,pattern_instances,tangent_connected(seed, tol_deg),largest_by(axis),curvatureâ/radiusâ/areaâwithtol,by_material. - Tolerances: use absolute tolerances via
tol(e.g.,tol: 0.1mm) ortol_degfor angular floods; values are unit-checked. - Determinism policy: ambiguous queries fail with E12xx diagnostics and guidance to strengthen predicates/tags; lineage/attributes are used for stable reconciliation across sessions.
- Golden check:
make golden-check - Dump capabilities:
make caps(writesout/capabilities_fusion.jsonwith version/commit and determinism metadata) - Publish/Archive capabilities:
make publish-caps(writes versioned archive underout/capabilities/archive/<version>/) - APS Design Automation helpers:
- List engines:
make aps-da-list-engines(requiresAPS_CLIENT_ID/APS_CLIENT_SECRET) - Bootstrap check:
make aps-da-bootstrap - Create AppBundle:
make aps-da-create-appbundle NAME=<name> ENGINE=<engineId> ZIP=<path.zip> - Create Activity:
make aps-da-create-activity NAME=<name> ENGINE=<engineId> APPBUNDLE=<bundleId> - Submit WorkItem:
make aps-da-submit-workitem ACTIVITY=<activityId> ARGS=<args.json> - Clean:
make aps-da-clean - DA pipeline:
make aps-da-pipeline(ensure + submit; see env below)
- List engines:
- Optional env for metadata:
CSL_VERSION,GIT_COMMIT/CI_COMMIT_SHA,FUSION_BUILD - APS DA env:
APS_ENGINE,APS_BUNDLE_ZIP, optionalAPS_BUNDLE_NAME,APS_ACTIVITY_NAME,APS_INPUT_URL,APS_OUTPUT_URL