# Picture Frame Mount Creator (CAD Engine Specification) This file provides system information, architecture guidelines, and syntax reference for picture frame matboard design inside the Picture Frame Mount Creator CAD application. > For the comprehensive technical layout schema, binary bytecode specifications, vector plotter details, and exporter mathematics, see the [Full Technical Specification](/llms-full.txt). --- ## 1. System Overview - **Application Name**: Picture Frame Mount Creator & Matboard Designer - **Domain**: Custom Bespoke Framing Web CAD - **Client Frame Space Coordinates**: - Center of the matboard is absolute `(0, 0)`. - Apertures are positioned with `(x, y)` relative offsets from the matboard center. - Supported unit types: Millimeters (`mm`), Centimeters (`cm`), and Inches (`in`). - Standard physical sizes are calculated dynamically based on margins or absolute selections. --- ## 2. Lisp S-Expression CAD Console (JSON-HC) To make CAD layouts extremely compact for LLMs and conversational interfaces, we serialize matboard layouts into highly dense Lisp-style S-Expressions. ### S-Expression EBNF Grammar Reference ```ebnf layout ::= '(' 'layout' unit width height layers reveal1 reveal2 color1 color2 color3 core margins? bed? dxf-cut? apertures ')' unit ::= '(' 'unit' ('mm' | 'cm' | 'in') ')' width ::= '(' 'width' float ')' height ::= '(' 'height' float ')' layers ::= '(' 'layers' (1 | 2 | 3) ')' reveal1 ::= '(' 'reveal1' float ')' reveal2 ::= '(' 'reveal2' float ')' color1 ::= '(' 'color1' string ')' color2 ::= '(' 'color2' string ')' color3 ::= '(' 'color3' string ')' core ::= '(' 'core' ('white' | 'black' | 'cream') ')' margins ::= '(' 'margin-top' float ')' '(' 'margin-bottom' float ')' '(' 'margin-left' float ')' '(' 'margin-right' float ')' apertures ::= '(' 'apertures' aperture* ')' aperture ::= '(' 'aperture' id shape width height x y radius? tool? text? font? ')' ``` ### Example S-Expression Layout ```lisp (layout (unit mm) (width 500) (height 400) (layers 2) (reveal1 5) (reveal2 5) (color1 "#f8fafc") (color2 "#f1f5f9") (color3 "#ffffff") (core white) (margin-top 50) (margin-bottom 50) (margin-left 50) (margin-right 50) (apertures (aperture (id "ap-1") (shape rectangle) (width 200) (height 150) (x 0) (y 0)) ) ) ``` --- ## 3. Matboard CAD Bytecode (MCB2) The binary bytecode standard represents a compiled `MountLayout` state: - **Magic Header**: `MCB2` (bytes `0x4D 0x43 0x42 0x32`) - **Key Opcodes**: - `0x01` Unit - `0x02` Width, `0x03` Height - `0x04` Layer count - `0x05` Reveal 1, `0x06` Reveal 2 - `0x0C` Margin top, `0x0D` Margin bottom, `0x0E` Margin left, `0x0F` Margin right - `0x07` Color 1, `0x08` Color 2, `0x09` Color 3 - `0x0A` Core color - `0x30` Apertures block (uint16 length) - **Nested Aperture Fields**: - `0x01` Aperture ID (String) - `0x02` Aperture Shape (0=rectangle, 1=oval, 2=circle, 3=rounded, 4=text, etc.) - `0x03` Width, `0x04` Height, `0x05` X offset, `0x06` Y offset - `0x07` Corner radius (for rounded shape) - `0x08` Tool head - `0xFF` End of aperture block --- ## 4. LLM Control Rules (For AI Agents) When generating code or parsing instructions: 1. **Preserve User Settings**: Only modify requested elements. Do not discard existing custom apertures unless explicitly told. 2. **Horizontal Distribution Formula**: - For $n$ apertures of width $W$ and spacing $G$ (gap): - Total Span $S = n \cdot W + (n - 1) \cdot G$. - Center offsets: $X_i = -\frac{S}{2} + \frac{W}{2} + i \cdot (W + G)$ for $i \in [0, n-1]$. 3. **Cloning / Overlapping**: When duplications are requested, offset cloned aperture coordinates by `+10mm` (or `+0.4in` depending on active unit) on both X and Y axes to prevent immediate overlapping. 4. **Licensing Modes**: - Passive Evaluation mode is always active. - Activations are validated via standard key formats (prefixes `MNT-` and `CAD-`).