Parametric 3D modeling of furniture and metal structures. TCSL v1.5 + Python/FreeCAD, interactive 3D visualizer, cost calculator and quote generator — no server, entirely in the browser. Integrated LLM guide v5.3
Complete guide: from general provisions to appendices with GOST profiles
Purpose, principles, request types, product types, and LLM workflow algorithm
This guide is intended for external LLMs (Claude, ChatGPT, Gemini, GigaChat, YandexGPT, DeepSeek, Ollama and others) tasked with generating TCSL code from user requests.
A declarative language for describing physical objects. A number without a unit of measurement is a syntax error. The code simultaneously serves as three things:
Five integrated tools, zero server processing:
Every TCSL code fragment in this document is executable. LLMs learn from few-shot examples and mechanically replicate the format. If an example contains an error, the error will be reproduced in every generated code.
Photos, drawings, assembly instructions (PDF), parts list. All dimensions are known.
Photos and overall dimensions (73×42×93 cm). Detail dimensions derived from photo proportions.
Text description: “dresser with three drawers, 80 cm.” LLM assigns standard dimensions.
“IKEA MALM 4 drawers.” LLM searches the web for dimensions, photos, and instructions.
Existing code + diagnostics for fixing. Share URL, LLM Fix, Copy Log.
Wardrobes, dressers, cabinets, shelving units, kitchen modules
Materials: laminated chipboard 16 mm, HDF 3–4 mm. Operations: box + translate, fasteners via box. Patterns: sections 5.1–5.3
Table frames, tube shelving, railings, staircases
Materials: profile tube. Operations: box + cut (hollow profile). Patterns: section 5.6
Table with metal frame and wooden tabletop
Order: frame first (K), then panels (M), then hardware
Type E: incoming code from Viewer → step 6i
D: web search · C: standard dimensions · B: proportions from photos · A: from documentation
Product type (M/K/S) · Support scheme · Decomposition · Z-levels · Connection table
Arithmetic check: sum of sections + shelves ≈ side panel height (±12 mm)
Formalized template: composition, height marks, connections, mapping
Includes Viewer channel compatibility check
Web search, photo analysis, assembly instructions, drawings — and forming height marks
# === HEIGHT MARKS (Z, mm) — calculated TOP DOWN ===
# Z = 916 top of lid (lid on side panels: 900 + 16)
# Z = 900 top of side panels = bottom of lid (REFERENCE POINT)
# Z = 737..900 niche (163 mm free space)
# Z = 721..737 shelf-niche bottom (16 mm chipboard)
# Z = 528..721 upper middle section (193 mm)
# Z = 512..528 shelf (16 mm chipboard)
# Z = 319..512 lower middle section (193 mm)
# Z = 303..319 shelf (16 mm chipboard)
# Z = 4..303 bottom section (299 mm)
# Z = 0..16 bottom panel (16 mm chipboard, supports entire structure)
#
# Check: 16 + 299 + 16 + 193 + 16 + 193 + 16 + 163 = 912
# Side panels: 900 mm. Difference 912 - 900 = 12 mm → gaps. OK.
Mandatory step 4 of the algorithm, not a recommendation. If the check fails — code generation does not begin.
Units, program structure, constructors, pipeline, transforms, boolean operations, arrays, selectors, tags
Without a unit — parser error. 800 ✗ 800 mm ✓
Parameters
Literals: number with unit, boolean, string, unitless integer for counters
input width = 732 mm
input count = 4
Computations
Formulas and references to parameters. This zone is optional.
let inner_w = width - 2 * board
Construction
Constructors + pipeline. Bare arithmetic is forbidden.
p = box(100mm,50mm,16mm)
|> translate(10mm,0mm,0mm)
Naming
Minimum 1 line. as for calculator.
export p as Side_LDSP16mm_1
box(width=W, depth=D, height=H)
Origin at (0,0,0)
cylinder(radius=R, height=H)
Z-axis, center at (0,0,0)
sphere(radius=R)
Center at (0,0,0)
plate(width=W, depth=D, height=H)
Alias for box (panels)
|>panel = box(width=100 mm, depth=50 mm, height=16 mm) |> translate(x=10 mm, y=0 mm, z=0 mm)
panel = box(width=100 mm, depth=50 mm, height=16 mm)
|> translate(x=10 mm, y=0 mm, z=0 mm)
translate(x=X, y=Y, z=Z)
All three arguments are required
rotate(angle=A, ax, ay, az, cx, cy, cz)
Around point (cx, cy, cz)
scale(sx=SX, sy=SY, sz=SZ)
Dimensionless coefficients
Union
Subtraction (subtract — alias)
Intersection
three-bvh-csg (async loading). Fallback — grouping without subtraction.
linear_pattern(count=N, dx=DX, dy=DY, dz=DZ)
circular_pattern(count=N, angle=A, cx, cy, cz, ax, ay, az)
body |> select_edges_by_axis(axis=z) |> fillet(radius=3 mm)
body |> select_faces_by_axis(axis=z, keep=max) |> shell(thickness=2 mm)
Fillets and chamfers — after all booleans
7 absolute prohibitions, naming rules, input parameters, hardware positioning, Z-levels
Numbers without units in length/angle context
Bare arithmetic in GEOMETRY zone
Line break before |>
$ in variable names
Violating zone order
Missing export
Python / import / exec / eval / os / sys
Viewer creates a slider for each input (10%–300%, step 1, debounce 100 ms). Precomputed input values are NOT recalculated. Use let for derived values.
# Base values — input (sliders):
input total_width = 732 mm # slider
input board = 16 mm # slider
# Derived values — let (auto-recalc):
let inner_width = total_width - 2 * board
input total_width = 732 mm
input inner_width = 700 mm # Stays 700!
# When total_width=900 → inner_width
# still 700, not 868. PROBLEM.
Through side panel into shelf edge. Left: x = 0 mm. Right: x = total_w - conf_len
Top/side joint: z = side_h - dowel_len/2. Half in side panel, half in top.
Against inner face. Left: x = board. Right: x = total_w - board - guide_w
cylinder + rotate for fasteners. Use box only.
Without material keyword — warning W001
Standard for wardrobes and dressers. Side panels: Z = 0..side_height
Nightstands and tables. Legs: Z = 0..leg_h. Carcass: Z = leg_h..
Rare. Frame or solid panel: Z = 0..plinth_h
box(width=board, depth=total_d, height=side_h)box(width=total_w, ...) at Z=side_hbox(width=shelf_w, ...) offset x=boardinput tube_w = 40 mm # profile width
input tube_d = 40 mm # profile depth
input tube_t = 2 mm # wall thickness
input tube_len = 750 mm # length
let tube_inner_w = tube_w - 2 * tube_t
let tube_inner_d = tube_d - 2 * tube_t
tube_outer = box(width = tube_w, depth = tube_d, height = tube_len)
tube_inner = box(width = tube_inner_w, depth = tube_inner_d, height = tube_len + 2 mm) |> translate(x = tube_t, y = tube_t, z = -1 mm)
tube_post = tube_outer |> cut(other = tube_inner)
export tube_post as Post_Tube40x40x2_1
Prepared before hardware generation (step 6f). Included in the code as a comment.
| Part A | Part B | Fastener | Qty | Axis | Y Offsets |
|---|---|---|---|---|---|
| corpus_left_side | corpus_bottom | Confirmat 7×50 | 2 | X | 50, D-50 |
| corpus_left_side | corpus_top | Dowel D8×30 | 2 | Z | 50, D-50 |
| corpus_right_side | corpus_bottom | Confirmat 7×50 | 2 | X | 50, D-50 |
| corpus_right_side | corpus_shelf_1 | Confirmat 7×50 | 2 | X | 50, D-50 |
# ═══════════════════════════════════════════════════════
# PRODUCT CARD FOR TCSL
# ═══════════════════════════════════════════════════════
# Name: [local] / [eng]
# Request type: [A / B / C / D / E]
# Product type: [M — furniture / K — frame / S — mixed]
# Dimensions: W × D × H mm
# Carcass material: [Chipboard 16 / MDF 18 / ...]
# Support scheme: [side panels / legs / plinth]
# Target env: TCSL Viewer v3.3.5 / FreeCAD / both
# Animatable: [facade_drawer_*, door_left, ...]
# Decomposition: [single file / N files]
# ═══════════════════════════════════════════════════════
|> moved to a new line. Solution: entire pipeline on one line.let or arithmetic inside function arguments.mm or deg.| Parts | TCSL Lines | Recommendation |
|---|---|---|
| 1–10 | 10–30 | Single file |
| 10–30 | 30–80 | Single file, pay attention to Z-levels |
| 30–50 | 80–150 | 2–3 files by subsystems |
| 50+ | 150+ | Mandatory decomposition into 4–6 files |
Ready-made system prompts for different scenarios: universal, furniture, no documentation, fix/repair, metal structures
15 TCSL rules + LLM Fix handling + response format. Suitable for any request type.
Complete package: instructions, drawings, photos. Extract all dimensions, step-by-step generation.
Photos only or name only. Web search, standard dimensions, furniture standards.
Handle screenshots, LLM Fix, Copy Log. Fix all errors in one iteration.
Profile tube frames per GOST standards. box + cut for hollow profiles.
You are an expert in generating TCSL v1.5 code
for building 3D models in TCSL Viewer v3.3.5
and FreeCAD via the TextToCAD module.
CRITICAL TCSL RULES:
1. UNITS ARE MANDATORY: 800 mm, not 800.
2. STRUCTURE: INPUT → LET → GEOMETRY → EXPORT.
2a. ## headings do NOT control the parser.
2b. Short form is allowed for literals.
3. PIPELINE |> — SINGLE LINE ONLY.
3a. Re-assigning the same name is forbidden.
4. DERIVED VALUES: let name = expression.
5. CONSTRUCTORS: named arguments with units.
6. OPERATIONS: translate, rotate, union, cut, fillet...
7. FASTENERS: box only, NOT cylinder+rotate.
8. EACH PART — separate export ... as.
9. Z-LEVELS top-down, HEIGHT MARKS block.
10. NAMES descriptive + keywords for animation.
11. PRODUCT CARD before generation.
12. CONNECTION TABLE before hardware.
13. >30 parts → DECOMPOSITION.
14. input for sliders, let for auto-recalc.
15. export as with material keywords.
Response format: card + TCSL code + notes.
| Material | Thickness |
|---|---|
| Laminated chipboard | 16 mm |
| Heavy-duty chipboard | 18 mm |
| HDF/Hardboard | 3–4 mm |
| MDF | 16–19 mm |
| Plywood | 10–18 mm |
| Element | Size |
|---|---|
| Confirmat screw | 7×50 mm |
| Dowel | 8×30 mm |
| Cam lock | Ø15×12 |
| Drawer slide L | 250–550 |
| Self-tapper | 3.5–4×16 |
| Gap | Size |
|---|---|
| Between facades | 2–3 mm |
| For drawer slide | 12.5–13 |
| Back panel | 0–2 mm |
| Shelf from back | 0–20 mm |
| Facade forward | 1–3 mm |
input shelf_w = 600 mm # shelf width
input shelf_d = 250 mm # depth
input shelf_h = 16 mm # chipboard thickness
shelf_board = box(width = shelf_w, depth = shelf_d, height = shelf_h)
export shelf_board as Shelf_LDSP16mm_1
# Nightstand with drawer · 500×400×400 mm · Chipboard 16 mm
input total_w = 500 mm # nightstand width
input total_d = 400 mm # depth
input side_h = 384 mm # side panel height
input board = 16 mm # chipboard
input thin = 4 mm # HDF
input facade_h = 180 mm # drawer facade height
input guide_w = 13 mm # slide width
input guide_h = 45 mm # slide height
input guide_len = 350 mm # slide length L350
let shelf_w = total_w - 2 * board
let back_h = side_h - 2 * board + thin
corpus_left = box(width = board, depth = total_d, height = side_h)
corpus_right = box(width = board, depth = total_d, height = side_h) |> translate(x = total_w - board, y = 0 mm, z = 0 mm)
corpus_top = box(width = total_w, depth = total_d, height = board) |> translate(x = 0 mm, y = 0 mm, z = side_h)
corpus_bottom = box(width = shelf_w, depth = total_d - 20 mm, height = board) |> translate(x = board, y = 0 mm, z = 0 mm)
corpus_back = box(width = shelf_w, depth = thin, height = back_h) |> translate(x = board, y = total_d - thin, z = 3 mm)
facade_drawer = box(width = total_w - 6 mm, depth = board, height = facade_h) |> translate(x = 3 mm, y = -2 mm, z = board)
guide_left = box(width = guide_w, depth = guide_len, height = guide_h) |> translate(x = board, y = 15 mm, z = board + 30 mm)
guide_right = box(width = guide_w, depth = guide_len, height = guide_h) |> translate(x = total_w - board - guide_w, y = 15 mm, z = board + 30 mm)
export corpus_left as Side_LDSP16mm_1
export corpus_right as Side_LDSP16mm_2
export corpus_top as Top_LDSP16mm_1
export corpus_bottom as Bottom_LDSP16mm_1
export corpus_back as BackPanel_HDF4mm_1
export facade_drawer as Facade_LDSP16mm_1
export guide_left as Hardware_1
export guide_right as Hardware_2
8 code input channels, Share URL, templates, transpilation, sliders, Inspector, LLM Fix, calculator, quotes, diagnostics
| # | Channel | Direction | Format | For LLM |
|---|---|---|---|---|
| 1 | TCSL Editor | ↔ | TCSL Text | Primary |
| 2 | Python Editor | ↔ | Python/FreeCAD | Secondary |
| 3 | Load .tcsl/.txt | → | File from disk | Long codes |
| 4 | Templates | → | 14 templates | Starting point |
| 5 | Share URL | ↔ | LZString in URL | Collaboration |
| 6 | From TCSL | TCSL→Py | Transpilation | For FreeCAD |
| 7 | Element Inspector | GUI→Code | Property changes | Element editing |
| 8 | Parametric Sliders | GUI→Code | Input update | Interactive tuning |
The “LLM Fix” button (Inspector → Diagnostics) generates a text report for LLM consumption. Contains metadata, all errors with line numbers, full code with numbering, and instructions.
=== ERRORS ===
[3:15] TCSL_R001: Incompatible dimensions
[7:1] TCSL_E005: let after GEOMETRY
=== SOURCE CODE ===
1 | input width = 732 mm
2 | input angle = 45 deg
3 | let bad = width + angle
5 | shelf = box(width=width, ...)
7 | let inner = width - 2 * 16 mm
9 | export shelf
input width = 732 mm
input angle = 45 deg
input board = 16 mm
let inner = width - 2 * board
shelf = box(width=inner, depth=400 mm, height=board)
export shelf as Shelf_LDSP16mm_1
3 currencies (USD, RUB, EUR), 2 markup sliders (×1–×3), item table, totals.
{
"ldsp_16mm_m2": 850,
"dvp_4mm_m2": 220,
"furnitura_pcs": 45,
"truba_40x40x2_mp": 180
}
Green “Quote” button → form → PDF (2 pages).
LLM → code → Viewer (paste/Load) → Run → check → LLM Fix → correction
LLM Fix → copy to LLM → parse errors → all fixes in 1 iteration → full code
Template → sliders → copy code → description → LLM modifies → full code
TCSL → Run → From TCSL → Save .py → FreeCAD
TCSL with export as → Cost → markups → Quote → details → PDF
| Profile | Wall | Mass |
|---|---|---|
| 20×20 | 1.5 | 0.88 |
| 25×25 | 2 | 1.39 |
| 30×30 | 2 | 1.70 |
| 40×40 | 2 | 2.33 |
| 40×40 | 3 | 3.36 |
| 50×50 | 2 | 2.96 |
| 60×60 | 3 | 5.25 |
| 80×80 | 3 | 7.13 |
| Profile | Wall | Mass |
|---|---|---|
| 40×20 | 2 | 1.70 |
| 50×25 | 2 | 2.17 |
| 60×30 | 2 | 2.65 |
| 60×40 | 3 | 4.31 |
| 80×40 | 3 | 5.25 |
| 80×60 | 3 | 6.19 |
| 100×50 | 3 | 6.66 |
| Profile | Wall | Mass |
|---|---|---|
| D25 | 2 | 1.13 |
| D32 | 2 | 1.48 |
| D40 | 2 | 1.87 |
| D42 | 3 | 2.89 |
| D48 | 3 | 3.33 |
| D57 | 3 | 3.99 |
| D76 | 3 | 5.40 |
| English | Code Name | Example | English | Code Name | Example |
|---|---|---|---|---|---|
| Side panel | Side | Side_LDSP16mm_1 | Top | Top | Top_LDSP16mm_1 |
| Bottom | Bottom | Bottom_LDSP16mm_1 | Shelf | Shelf | Shelf_MDF19mm_1 |
| Facade | Facade | Facade_LDSP16mm_1 | Back panel | BackPanel | BackPanel_HDF4mm_1 |
| Post | Post | Post_Tube40x40_1 | Beam | Beam | Beam_Tube60x40_1 |
| Tabletop | Tabletop | Tabletop_LDSP18_1 | Hardware | Hardware | Hardware_12 |
| Channel | ↔ | Format | For LLM |
|---|---|---|---|
| TCSL Editor | ↔ | TCSL Text | Primary |
| Python Editor | ↔ | Python/FreeCAD | Secondary |
| Load .tcsl/.txt | → | File | Long codes |
| Save .tcsl/.py | ← | File | Save |
| Templates | → | 14 templates | Start |
| Share URL | ↔ | LZString URL | Collaboration |
| From TCSL | → | Transpilation | FreeCAD |
| Element Inspector | GUI→ | Properties | Editing |
| Sliders | GUI→ | Input | Tuning |
| LLM Fix | ← | Report | KEY |
| Copy Log | ← | Python report | Debugging |
| Copy Errors | ← | Error list | Diagnostics |
| Screenshot | ← | PNG | Verification |
| Export STL/glTF | ← | 3D file | Manufacturing |
| Export PDF | ← | 2 pages | Document |
| Export Excel | ← | .xlsx | Estimate |
| Export AST | ← | JSON | Analysis |
| Load Price List | → | JSON | Pricing |
| Quote PDF | ← | Sales |
14 templates from a simple shelf to a computer desk
Ctrl+Enter — full cycle in <50 ms
Specification → sliders → model rebuilds in real time
Cost → currency, markups, price list
Details → Generate → 2-page PDF with 3D
Share → URL → colleague opens → same model
Python → From TCSL → Save .py → FreeCAD
TCSL Viewer v3.3.5 + LLM Guide v5.3 — parametric modeling, calculator, commercial quotes.