SpiralCad Manual
Getting started
SpiralCad opens DWG drawings (R13, R14, R2000, R2004, R2010, R2013 and R2018) and ASCII DXF. Three ways to load a drawing:
- Drag the file onto the window.
- 📂 Open button (or the system file picker).
- Pick one of the sample drawings in the left panel.
The status bar shows the detected format and version, the total object count and the percentage of decoded geometry.
Navigation & layers
- Pan: drag with the mouse. Zoom: mouse wheel (centered on the cursor).
- ⌖ Zoom extents: fits the view to the whole drawing, including what you have drawn.
- Layers: the left panel lists layers with their color; the checkbox shows or hides them. Layers that are off or frozen in the file come hidden by default.
- 🖨 PDF: prints the current view to vector PDF.
Measure, draw & edit
| Tool | Use |
|---|---|
| 📏 Measure | Click two points: true distance in drawing units. The cursor snaps to nearby vertices and centers. |
| Line / Polyline / Circle / Text | Markup drawing over the plan. The polyline closes on double-click; text prompts for its content when placed. |
| Select | Click an object: move it (drag), or delete it with Del. |
| ↶ Undo | Ctrl+Z reverts the last action (draw, delete or move). |
Command console
The command line lives at the bottom of the viewer (the ; key
focuses it). It accepts commands and SpiralScript (anything that
starts with (). History with ↑/↓.
| Command | What it does |
|---|---|
LINE 0,0 100,50 @0,40 | Lines between points. x,y absolute; @dx,dy relative to the previous point. |
CIRCLE 50,50 25 | Circle: center and radius. |
PLINE 0,0 40,0 40,30 C | Polyline; a trailing C closes it. |
TEXT 10,20 2.5 REVIEWED | Text: point, height and content. |
CAPA REVISION · COLOR 1 | Current layer and color for what you draw next (the layer is created in the DWG if missing). |
ALIAS L LINE | Your own aliases, persisted in ~/.spiralcad/spiralcad.pgp (acad.pgp syntax — your AutoCAD file copies over as-is). |
LOTEO | Subdivides the parcel (selected closed polyline) into lots by target area with minimum frontage — with an optional internal street. |
ESTILO | Lists and edits the drawing's TEXT styles (width factor, fixed height, oblique, font) with native DWG write-back. |
ACOTESTILO | Lists and edits the drawing's DIMENSION styles (DIMXXX=value fields: DIMSCALE, DIMASZ, DIMTXT, DIMDEC…). |
XREF | Attaches an external reference to the drawing (the resulting DWG downloads). |
AYUDA · LIMPIAR | Command summary · clears the output. |
NAME | A bare name runs the routine (defun c:name ...) if defined. |
Save DWG & export
- ↓ DWG — native save: your edits go INSIDE a real DWG, in the
same version as the original drawing, preserving untouched content byte for
byte. On R2000 you can add and delete; on R2004–R2018 additions go on
the
SPIRALCAD_MARKUPlayer (red) and you can delete (native modern delete, AUDIT-clean). - Sheet-set PDF: the project sheet set (viewports, auto scale, index, title block with owner/manager/revision) in ONE multi-page pdf.
- Sheet-set DWG: the same set as a ZIP of native R2010 DWGs — one
per sheet, in paper space with its
LAMINA n DE Nlayout, ready to plot in AutoCAD (AUDIT 0 errors). - ↓ DXF: exports the full drawing plus your edits to ASCII DXF, readable by any CAD.
- ↓ SHP: the drawing as a packaged shapefile (UTM 19S / EPSG:32719); cadastre SHPs come in with their ROL labeled.
- PDF: vector print of the view.
Works modules
- 🔍 QA check: automated drawing audit against a normed checklist (UTM georeferencing, layers, texts, scales) with a report.
- ⛰ 3D surface: TIN surfaces from LandXML with contour lines, cut/fill quantities and a calculation report.
- 3D model / 3D editor: extrusion of the drawing into a walkable model and hand-off to the 3D editor.
Civil road works (the complete municipal flow)
- Alignment by PIs with circular curves or clothoids (radius and A parameter per PI), editable grips, LandXML import from Civil 3D/Istram.
- Finished grade by PVIs in the longitudinal profile pane (click adds, right-click removes), with a reference superelevation band (MOP).
- Volumes: cross sections + average-end-area, Bruckner mass haul diagram and quantities to CSV/PDF for the budget.
- Corridor: typical section swept along the alignment against the surface, with superelevation and widening per station; feature lines and 3D quantities.
- Cross sections to an A3 sheet: existing-vs-subgrade grid with cut/fill areas per station ("Sections PDF" button).
- Contour lines of the surface with oriented elevation labels and majors every 5th ("Contours" button).
- Gravity and potable water networks: manholes/nodes over the surface, RIDAA/NCh validation, network profile to a PDF sheet (ground, pipes with Ø/slope/length, chambers), LandXML PipeNetwork.
- Civil copilot (2D|CIVIL toggle in the chat): "lay out an alignment through these PIs with radius 80… and its corridor… and the sheet set" — validates against the real engine and applies to the drawing. Local LLM (Ollama): nothing leaves the machine.
Customization
- Aliases in acad.pgp syntax:
~/.spiralcad/ spiralcad.pgp, linesSHORTCUT,*COMMAND. Your AutoCAD file copies over as-is. - Named workspaces (Settings dialog): save and apply theme + UI size + workspace + F3/F8/F9/F10/F12 toggles.
- 2D library with favorites (★ per part, own section) and Design Center ("DC…" button): insert blocks from any DWG on disk as native blocks.
The Workshop: the parametric part
The Workshop (Taller button in the toolbar, or
/taller) is the MCAD bench: it designs 3D parts to print, cut
and machine, with its own B-rep kernel (OCCT) — exact booleans, fillets
and chamfers, not breakable meshes. The part is not drawn: it is built as
an operation tree (box → hole → fillet → polar pattern…) that stays
editable step by step: change the radius of hole 4 and the whole part
regenerates, with volume and watertight solid verified at every
step.
- Operations: box, cylinder, sphere, polygon prism, hole (through/blind/ISO metric threaded), fillet, chamfer, shell, revolve, sweep, linear/polar pattern, union/cut/intersection.
- Named parameters («espesor», «d_perno + 0.5»): the part becomes a family — change one number, get the variant.
- Navigation: drag = orbit · wheel = zoom · right-click = pan · double-click = center · WASD/QE to walk.
- Own parts library: any tree can be saved as a reusable part.
Part copilot
The Workshop chat edits the part's HISTORY in natural language: «hazle 2 mm más gruesa la base», «ponle 6 pernos en vez de 4», «filete en la cara que marqué». Click a face in the 3D view to hand it over as context. The copilot also sizes: ask for «una caja para un ESP32» or «un soporte que aguante 500 N» and it proposes a verified part, not just a drawn one. Replies render with formatting (bold, code, lists) and the history persists across sessions. Local LLM (Ollama): nothing leaves the machine.
FEA verification
- Face picking: click a face and the menu pops next to the cursor; Shift+click adds faces in batch. Each selection gets a role: blue = fixed, red = pressure/load.
- Push/pull: drag a picked face and the part STRETCHES — the kernel knows which operation each face was born from and rebuilds the history with the new dimension.
- Linear static FEA (Gmsh mesh + finite elements): von Mises map on the part, max displacement and safety factor against the chosen material.
- Calculation report PDF: the signable report with assumptions, mesh, results and the model version signature — the part ships with its justification, not just its STL.
- Evidence: every computational model can record dated physical tests (prediction vs measurement with a declared band) — the observed factor warns when reality drifts from the model.
Fabrication: from part to machine
| Output | What you get |
|---|---|
| 3D printing | STL and own 3MF with suggested print orientation (minimizes overhang) and printability (bed, overhang, supports). No own slicer, on purpose: the 3MF opens straight in Bambu Studio or OrcaSlicer. |
| Multi-object bed | From an assembly, ONE 3MF with each part named, in its suggested orientation and laid out in a row on the bed — never in the assembled pose. |
| CAM 2.5D | Drilling, contour and pocket with tabs on the final pass, swappable posts and G-code verified with an independent parser and geometric backplot. |
| Sheet metal | Fold/unfold with real BA = θ·(r + K·t); the
DXF/DWG carries a separate PLIEGUE layer for the brake. |
| Laser / cutting | Tangential lead-in on contours and DXF/SVG cut sheets with exact dimensions (the kernel is B-rep: dimensions are for machining, not approximating). |
| Topology (SIMP) | Topology optimization via invariants: the classic MBB beam drops −79.7% compliance; the result is sewn back into an editable solid and returns to the tree. |
| Cutting plate | Part nesting on plate with measured yield (62.8% vs 17.5% freehand on the test bench). |
Assemblies with mates
- Mates: concentric, coincident, prismatic (with real stop) and Coulomb friction — the lid opens as far as physics allows.
- Push parts: in the assembly view you grab a part with the mouse and push it; the interference stop halts the motion when solids collide ("opens to 205° and then CLASHES").
- Animate: joint sweep with per-frame clash check; if the first step already collides, it reverses the sweep.
- Import assemblies: STEP and FreeCAD (.FCStd) come in part by part as instances with recoverable mates.
Import & GVCS Library
- Import: STL, OBJ and .FCStd (FreeCAD) come in as reference meshes. The FCStd carries the OCCT B-rep inside: each piece arrives separately with its own reference color (declared: not the real material) plus a panel to show/hide and frame each one.
- GVCS Library (
/gvcs): the 50 machines of the Global Village Construction Set by Open Source Ecology, curated with search and sector filters. Each machine can be "opened as layers" (whole machine in the Workshop, one color per file), downloaded as a free zip (OSE's CC-BY-SA license) or browsed file by file. It is the first open library of the store — more coming. - Gallery & computational models: curated entries that load with their spec ready; computational models are deterministic parametric families (spec → part → FEA → report), versioned and tested — including the GVCS CEB press as a living family.
SpiralScript reference
SpiralScript is SpiralCad's routine engine: a LISP-style language with the CAD industry's standard syntax, meant to automate repetitive drawing. It runs in a server sandbox: no file or network access, with an operation limit.
Semantics worth knowing (faithful to classic CAD LISP):
- Only
nilis false:0and""are truthy. - An unbound symbol evaluates to
nil(not an error). substrcounts from 1, not from 0.- In
(defun f (a b / x y) ...), what follows/are local variables. t,nilandpiare protected constants.- Integer division is integer:
(/ 7 2)→3; use(/ 7 2.0)for 3.5.
Special forms
| Form | Description |
|---|---|
(setq var value ...) | Assigns (variable/value pairs). |
(defun name (args / locals) ...) | Defines a function. c:name makes it a console command. |
(lambda (args) ...) | Anonymous function. |
(if c then [else]) · (cond (c ...) ...) | Conditionals. |
(while c ...) · (repeat n ...) · (foreach v list ...) | Iteration. |
(and ...) · (or ...) · (progn ...) · (quote x) / 'x | Logic, sequencing, quoting. |
Functions
| Category | Functions |
|---|---|
| Arithmetic | + - * / rem 1+ 1- abs min max sqrt expt exp log sin cos atan float fix |
| Comparison & predicates | = /= < <= > >= eq equal not null atom listp numberp zerop minusp |
| Lists | list cons car cdr nth length last reverse append member assoc subst mapcar apply |
| Strings | strcat strlen substr strcase itoa atoi atof rtos chr ascii (substr is 1-based) |
| Geometry | (polar pt angle dist) · (distance p1 p2) · (angle p1 p2) — angles in radians, pi available |
| Text output | princ prin1 print terpri (shows in the console) |
| Drawing variables | (setvar "CLAYER" "REVISION") · (setvar "CECOLOR" 1) · getvar |
CAD bridge: entmake & command
entmake creates an entity from an association list with the
standard DXF group codes:
| Entity | Supported codes |
|---|---|
| LINE | (10 x y) start · (11 x y) end |
| CIRCLE | (10 x y) center · (40 . radius) |
| ARC | center, radius, (50 . a0) and (51 . a1) in radians |
| TEXT | (10 x y) · (40 . height) · (1 . "text") |
| LWPOLYLINE | (10 x y) repeated · (70 . 1) = closed |
| Common | (8 . "LAYER") · (62 . aci_color) |
command accepts the classic simplified form:
(command "line" '(0 0) '(100 0) "") ·
(command "circle" '(50 50) 25) ·
(command "pline" '(0 0) '(10 0) '(10 8) "c") ·
(command "text" '(5 5) 2.5 "HELLO").
Complete examples
; sheet border as your own command
(defun c:marco ()
(command "pline" '(0 0) '(297 0) '(297 210) '(0 210) "c"))
; grid of vertical axes with labels
(defun c:ejes (/ i)
(setq i 0)
(repeat 5
(entmake (list '(0 . "LINE") (list 10 (* i 600) 0) (list 11 (* i 600) 3000)))
(entmake (list '(0 . "TEXT") (list 10 (+ (* i 600) 50) 3050)
'(40 . 120.0) (cons 1 (strcat "AXIS " (itoa (1+ i))))))
(setq i (1+ i))))
; golden spiral (the brand mark): 299 computed segments
(defun c:espiral (/ b i ang r p q)
(setq b 0.3063489 i 0 q nil)
(repeat 300
(setq ang (* i 0.06)
r (* 1.5 (exp (* b ang)))
p (list (* r (cos ang)) (* r (sin ang))))
(if q (entmake (list '(0 . "LINE") (cons 10 q) (cons 11 p) '(62 . 2))))
(setq q p i (1+ i))))
Define the routine by pasting it into the console (once per session), then
run it by typing its name: MARCO, EJES,
ESPIRAL.
Sandbox limits
- No file, network or operating-system access.
- At most 1,000,000 operations per run (an infinite
whileis cut off with a clear error) and 400 recursion levels. - Defined routines live for the duration of the console session.