MagicGeo is a training-free framework designed for generating geometric diagrams from textual descriptions. Creating precise diagrams directly from text can be challenging, but MagicGeo simplifies the process by formulating diagram generation as a coordinate optimization problem, integrating large language models for text translation and a formal language solver to ensure geometric correctness. MagicGeo’s coordinate-aware generation effectively handles spatial relationships in text-to-diagram tasks, enabling accurate and efficient geometric diagram synthesis.
Figure 1. Framework of MagicGeo
Figure 2. example
pip install -r requirements.txt
As long as the required dependencies are installed, using MagiceGeo to generate, compile, render, and save TikZ drawings is straightforward.
get your own api
client = OpenAI(
api_key="***",
base_url="***",
)
Clone this project
git clone https://link-to-projectGo to project directory
cd geoStartup server
python text_to_geometric.py- circle: json/circle.json
- triangle: json/triangle.json
- quadrangle: json/quadrangle.json
If MagiceGeo has been beneficial for your research or applications, we kindly request you to acknowledge its use by citing it as follows:
@article{wang2025magicgeo,
title={MagicGeo: Training-Free Text-Guided Geometric Diagram Generation},
author={Wang, Junxiao and Zhang, Ting and Yu, Heng and Wang, Jingdong and Huang, Hua},
journal={arXiv preprint arXiv:2502.13855},
year={2025}
}The implementation of our model is largely based on DeepSeek.



