File size: 1,225 Bytes
c3e1a32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eab734a
 
c3e1a32
eab734a
c3e1a32
eab734a
c3e1a32
eab734a
c3e1a32
 
 
 
eab734a
 
 
 
c3e1a32
eab734a
 
 
c3e1a32
eab734a
c3e1a32
eab734a
c3e1a32
eab734a
c3e1a32
eab734a
c3e1a32
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
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)