Table of Contents
Fetching ...

MagicGeo: Training-Free Text-Guided Geometric Diagram Generation

Junxiao Wang, Ting Zhang, Heng Yu, Jingdong Wang, Hua Huang

TL;DR

The paper tackles automatic generation of geometric diagrams from natural language descriptions, a task where precise spatial relationships are essential and traditional text-to-image methods struggle. It introduces MagicGeo, a training-free framework that converts descriptions into an optimization problem over point coordinates ($Points$) under geometric constraints ($Cons$), solved by a custom solver and rendered via coordinate-aware TikZ. A dedicated benchmark, MagicGeoBench, with 220 plane-geometry descriptions, enables systematic evaluation against baselines, showing improvements in geometric fidelity and practical editing capabilities. The approach offers scalable, accurate diagram generation for education and science, with extensibility to other geometric domains and potential broad impact on content generation in technical fields.

Abstract

Geometric diagrams are critical in conveying mathematical and scientific concepts, yet traditional diagram generation methods are often manual and resource-intensive. While text-to-image generation has made strides in photorealistic imagery, creating accurate geometric diagrams remains a challenge due to the need for precise spatial relationships and the scarcity of geometry-specific datasets. This paper presents MagicGeo, a training-free framework for generating geometric diagrams from textual descriptions. MagicGeo formulates the diagram generation process as a coordinate optimization problem, ensuring geometric correctness through a formal language solver, and then employs coordinate-aware generation. The framework leverages the strong language translation capability of large language models, while formal mathematical solving ensures geometric correctness. We further introduce MagicGeoBench, a benchmark dataset of 220 geometric diagram descriptions, and demonstrate that MagicGeo outperforms current methods in both qualitative and quantitative evaluations. This work provides a scalable, accurate solution for automated diagram generation, with significant implications for educational and academic applications.

MagicGeo: Training-Free Text-Guided Geometric Diagram Generation

TL;DR

The paper tackles automatic generation of geometric diagrams from natural language descriptions, a task where precise spatial relationships are essential and traditional text-to-image methods struggle. It introduces MagicGeo, a training-free framework that converts descriptions into an optimization problem over point coordinates () under geometric constraints (), solved by a custom solver and rendered via coordinate-aware TikZ. A dedicated benchmark, MagicGeoBench, with 220 plane-geometry descriptions, enables systematic evaluation against baselines, showing improvements in geometric fidelity and practical editing capabilities. The approach offers scalable, accurate diagram generation for education and science, with extensibility to other geometric domains and potential broad impact on content generation in technical fields.

Abstract

Geometric diagrams are critical in conveying mathematical and scientific concepts, yet traditional diagram generation methods are often manual and resource-intensive. While text-to-image generation has made strides in photorealistic imagery, creating accurate geometric diagrams remains a challenge due to the need for precise spatial relationships and the scarcity of geometry-specific datasets. This paper presents MagicGeo, a training-free framework for generating geometric diagrams from textual descriptions. MagicGeo formulates the diagram generation process as a coordinate optimization problem, ensuring geometric correctness through a formal language solver, and then employs coordinate-aware generation. The framework leverages the strong language translation capability of large language models, while formal mathematical solving ensures geometric correctness. We further introduce MagicGeoBench, a benchmark dataset of 220 geometric diagram descriptions, and demonstrate that MagicGeo outperforms current methods in both qualitative and quantitative evaluations. This work provides a scalable, accurate solution for automated diagram generation, with significant implications for educational and academic applications.

Paper Structure

This paper contains 14 sections, 5 figures, 5 tables.

Figures (5)

  • Figure 1: The overall framework of MagicGeo consists of three stages: Autoformalization with LLM, Solver with Verification, and Coordinate-aware Generation.
  • Figure 2: Illustrating an example of modifying the original text to include necessary information during MagicGeoBench construction.
  • Figure 3: Qualitative comparison with other approaches. Our method generates results that rigorously adhere to geometric constraints while maintaining high perceptual quality.
  • Figure 4: Illustrating that the solver effectively ensures precise alignment with the accompanying text.
  • Figure 5: Application to diagram editing.