Abstract
The capability to learn latent representations plays a key role in the effectiveness of recent machine learning methods. An active frontier in representation learning is understanding representations for combinatorial structures which may not admit well-behaved local neighborhoods or distance functions. For example, for polygons, slightly perturbing vertex locations might lead to significant changes in their combinatorial structure and may even lead to invalid polygons. In this paper, we investigate representations to capture the underlying combinatorial structures of polygons. Specifically, we study the open problem of Visibility Reconstruction: Given a visibility graph G, construct a polygon P whose visibility graph is G. We introduce VisDiff, a novel diffusion-based approach to reconstruct a polygon from its given visibility graph G. Our method first estimates the signed distance function (SDF) of P from G. Afterwards, it extracts ordered vertex locations that have the pairwise visibility relationship given by the edges of G. Our main insight is that going through the SDF significantly improves learning for reconstruction. In order to train VisDiff, we make two main contributions: (1) We design novel loss components for computing the visibility in a differentiable manner and (2) create a carefully curated dataset. We use this dataset to benchmark our method and achieve 21% improvement in F1-Score over standard methods. We also demonstrate effective generalization to out-of-distribution polygon types and show that learning a generative model allows us to sample the set of polygons with a given visibility graph. Finally, we extend our method to the related combinatorial problem of reconstruction from a triangulation. We achieve 95% classification accuracy of triangulation edges and a 4% improvement in Chamfer distance compared to current architectures.
Introduction
In computational geometry, a visibility graph $G$ encodes the "line-of-sight" relationships between the vertices of a polygon. Two vertices are connected in the graph if a straight line can be drawn between them without intersecting the polygon's boundary. The "Visibility Reconstruction" problem—constructing a polygon $P$ given only its visibility graph $G$—is a significant challenge in representation learning. Polygons are inherently "brittle" structures; minute perturbations in vertex coordinates can lead to drastic changes in the resulting visibility graph, making direct coordinate prediction difficult for standard Graph Neural Networks (GNNs).
Methods
VisDiff addresses this problem through a two-stage generative pipeline that utilizes a Signed Distance Function (SDF) as an intermediate geometric representation.
- SDF-Guided Diffusion: Instead of predicting vertices directly, the model first generates an SDF from the input visibility graph. The SDF provides a continuous spatial field where each value represents the distance to the nearest boundary. A diffusion model is employed to denoise a random grid into a clean SDF conditioned on $G$.
- Vertex Extraction: A Transformer-based architecture then processes the predicted SDF. It combines global features ($Z_{global}$) with pixel-aligned local features ($Z_{pix}$) to identify precise vertex locations along the boundary, ensuring they satisfy the visibility constraints of $G$.
Experimental Results
To evaluate VisDiff, the authors curated a dataset of 370,000 polygons, balanced by link diameter to ensure geometric complexity. VisDiff achieved an F1-score of 0.912 on visibility reconstruction, representing a 26% improvement over the Vertex-Diffusion baseline (0.724). The model also generalizes to triangulation graphs, achieving 95% classification accuracy of triangulation edges and a 4% improvement in Chamfer distance compared to existing architectures. Furthermore, the model identifies non-valid graphs with 90% accuracy. The generative nature of the diffusion process allows for diverse sampling, enabling the characterization of multiple polygons that share the same visibility graph.
Conclusion
VisDiff demonstrates that using an SDF as a "geometric bridge" significantly stabilizes the learning of combinatorial structures like polygons. Currently, the SDF is represented as a $40 \times 40$ grid, which provides sufficient resolution for typical polygons but may present a bottleneck for complex architectural floorplans. While inference takes approximately 1.02 seconds—slower than one-shot methods—the framework provides a robust foundation for reconstructing complex geometries from abstract graphs. Future work will explore higher-resolution representations and stricter geometric consistency checks.
Summary updated