Abstract
In the computer-aided design (CAD) of doors and windows, accurate positioning of the "fan region" (sash area) within the original frame is critical for the subsequent design of plastic windows. This paper presents a method applying the concept of convex hulls from computational geometry to identify these regions. By utilizing the Graham scan algorithm to analyze frame coordinates and Delaunay triangulation to subdivide the resulting convex hull, the system merges triangular networks into distinct fan regions. This approach overcomes the limitations of traditional topological software, which often fails to recognize complex or "shaped" window designs, thereby significantly expanding the capabilities of window design software.
Introduction
The automation of window design requires software to identify the closed polygons formed by frames and transoms—known as fan regions—where sashes are eventually installed. Traditional CAD tools often rely on simple topological closed-loop algorithms. While effective for standard rectangular windows, these methods frequently stumble when faced with "special-shaped" windows, such as arched or polygonal designs. These failures lead to design faults and necessitate manual intervention. To address this, we propose a robust automated system that treats the window frame as a geometric point set rather than a simple collection of connected lines.
Methodology
1. Point Set Abstraction and Convex Hull Generation
The process begins by extracting a set of 2D coordinates ($S$) from the window frame via the software API. To establish the outer boundary of the window, we apply the Graham scan algorithm. This algorithm identifies the convex hull ($G$), which represents the smallest convex polygon containing all points in $S$. This provides a stable "outer limit" for the geometric analysis.
2. Delaunay Triangulation
Once the convex hull is established, the internal area is subdivided into a network of triangles. We employ a Delaunay triangulation algorithm that selects the third vertex of each triangle by minimizing the value of $\cos C$ (where $C$ is the angle at the third vertex). This ensures the triangles are compact and do not contain other vertices, creating a clean mesh for analysis.
3. Graph-Based Merging and Loop Identification
The core innovation lies in treating these triangles as nodes in an undirected graph. The algorithm traverses the triangles and examines their shared edges. If a shared edge does not correspond to a physical frame or transom (a "welding line"), the two adjacent triangles are merged. By iteratively merging all triangles not separated by a structural boundary, the system reconstructs the "minimum loops."
Performance and Results
Algorithmic Efficiency
A complexity analysis of the pipeline—encompassing point sorting, hull generation, triangulation, and graph merging—reveals a total comparison count of $8n^2 - 7n - 3 + n\log n$. This results in a worst-case time complexity of $O(n^2)$. Given that typical window frames involve a relatively small number of vertices, this performance is highly efficient for real-time CAD applications, providing near-instantaneous recognition during the design phase.
Practical Impact
The geometric approach is significantly more resilient than topological tracing. By defining the fan region as the smallest possible loop that cannot be further subdivided by transoms, the algorithm provides a clear mathematical objective. This has successfully eliminated the "fan area faults" common in legacy software, allowing for the automated design of complex, non-standard window shapes that were previously impossible to process without manual correction.
Conclusion and Future Work
This method provides a robust foundation for automated window manufacturing. By accurately identifying fan regions, the software can automatically feed data into subsequent process planning stages, such as automated welding and glass cutting. Future research will focus on adapting this 2D logic for 3D spatial hulls to support the growing industry shift toward fully 3D Building Information Modeling (BIM) environments.
Summary updated