## 3 Framework for Automated Earthwork Network Architecture (ENA)
### Module-1: Topological Feature Collector  
Module-1: Topological Feature Collector in the proposed Earthwork Network Architecture (ENA) framework was responsible for the extraction, organization, and pre-processing of critical earthwork features from road cross-sectional designs or similar datasets. The module identifies and extracts important topological features such as cut and fill areas, slopes, subgrade conditions, and other geometric attributes from cross-sectional drawings. These features are crucial for accurate earthwork quantity estimation and serve as the primary inputs for the subsequent modeling process. In particular, the training data for LLMs should be in the form of sequences with some ordering among the features. To extract the features required for training, it is necessary to create polylines by connecting line segments from entities included in the cross-section. Each entity in the cross-section is represented as a line segment on a specific layer, but these segments are not always topologically connected. To establish connectivity, the Half-Edge Topology Structure is introduced. This structure is used to trace the line in a specific direction, creating a closed polyline by ensuring that each segment is connected to form a complete entity. The Half-Edge Topology Structure is an efficient method for representing the connectivity of the Boundary Representation (B-REP) model, which is widely used in computational geometry. It is particularly useful for managing complex operations such as geometry navigation and topological queries, making it an ideal choice for accurately modeling road cross-sections in CAD. Figure 2 illustrates a typical Half-Edge Topology Structure example. The Half-Edge Topology Structure is composed of three main elements: V (Vertex), H (Half-Edge), and F (Face). * V (Vertex): Each vertex in the entity is represented individually, storing attributes like position, color, and other geometric properties. Each vertex also maintains a reference to one of the half-edges that originates from it. * H (Half-Edge): A half-edge represents one side of an edge in the B-REP model. In a full edge, there are two half-edges, each pointing in opposite directions. Each half-edge also stores references to its next half-edge in the clockwise direction around its loop, its opposite half-edge, the vertex it originates from, and the loop it belongs to. * F (Face): A face is a polygonal region bounded by a loop of half-edges. Each face stores a reference to one of its bounding half-edges, making it easy to navigate and manage the connectivity of the surface geometry. Figure 2: Half-Edge Topology Structure example. To create connected polylines from entities of the cross-sectional drawing, which have entities in CAD format (see Figure 3), the algorithm (see Figure 4) used is as follows:  
T1. C_list = The entities stored in each cross-section are selected. T2. E_list = Entities are selected for each layer in C_list. The entity is a line segment and consists of two H.  
T3. H_seed = Randomly select H to track the phase in E_list. T4. H_next = H_seed  
T5. L = [H_next]  
T5.1. if E_list = \(\{\}\) then break  
T5.2. L = H_loop \(\cup\) H_next  
T5.3. E_list = E_list - H_next  
T5.4. H_next - list = Exploring other H lists with the same coordinate (x, y) value as the end point of the entity. T5.5. H_next = Select an entity with the largest internal angle between other entities and H_seed  
T5.6. if H_next in L then break  
T5.7. goto T5.1  
T6. P_list = P_list \(\cup\) L  
T7. C_list = C_list - L  
T7. if C_list = \(\{\}\) then exit  
T8. goto T2  
Figure 4 illustrates the process of creating a closed polyline using the Half-Edge Topology Structure and the above algorithm. The steps depict how individual line segments are connected and looped to form a closed face, which is then used for further processing and analysis in the earthwork quantity estimation.