| title: statement-to-tikz | |
| emoji: ๐ | |
| colorFrom: blue | |
| colorTo: green | |
| sdk: static | |
| pinned: false | |
| tags: | |
| - geometry | |
| - tikz | |
| - latex | |
| - olympiad | |
| - constraint-solver | |
| - formalization | |
| - diagram-generation | |
| license: mit | |
| # statement-to-tikz | |
| **Geometry statement โ constraint-solved TikZ** (training-free pipeline). | |
| This Hub card mirrors the GitHub project. Source of truth for code is the git repository. | |
| ## What it does | |
| 1. Formalize olympiad-style plane geometry text into `GeometryIR` (JSON constraints). | |
| 2. Solve point coordinates with SciPy `least_squares` (gauge-fixed). | |
| 3. Emit TikZ; verify residuals; optionally compile PDF. | |
| 4. Fall back to `schematic` layout when exact solve fails. | |
| ## Quick start | |
| ```bash | |
| pip install -e ".[dev]" | |
| stt "In triangle ABC, AB = AC, and D is the midpoint of BC. Draw the median AD." -o out/median | |
| ``` | |
| Set `OPENAI_API_KEY` for LLM formalization of arbitrary statements (`stt ... --no-offline`). | |
| ## Not a trained model | |
| v1 ships a **pipeline + IR + solver**, not fine-tuned weights. Fixtures under `tests/fixtures/` are the evaluation seeds. | |
| ## Citation / related work | |
| - MagicGeo (text-guided geometric diagram generation) | |
| - FormalGeo (olympiad geometry formal systems) | |