# Voxel-Based Digital Twin Framework for Earthwork Construction
## 4 Implementation of the Proposed System
### Graphical Simulation Environment for Model-Equipment Interaction
#### 4.1.3 Model Integration in Platform
When the excavator loads the voxels and unloads them in the dumper, the system monitors the number and type (material type) of voxels and visualizes them at the UI. Moreover, when the excavator bucket is rolled out, the voxels fall into the dumper owing to gravity. The dumper detects the voxels and shows them in the UI with properties such as volume, material type, and number of voxels. #### 4.1.5 User Interface Development

The integrated georeferenced earthwork model is shown in Figure 10 along with the equipment and other details of the proposed system. The imported models are shown in the asset module and can be used at any time while the game objects in the hierarchy are manipulated. They include earthwork models, UI components, cameras, lighting, and equipment models. Users interact with the model through an interactive UI developed using the Unity platform. In equipment selection, the excavator and dumper are linked to UI buttons, where users select and switch between equipment types. The equipment is linked and activated through UI buttons with scripts having the ExcavatorActive and DumperActive functions. The ExcavatorActive function activates or deactivates all relevant components or activities of the excavator in the game. The calculation UI displays information about earthwork quantities in terms of voxel volume, type, and number, along with time metrics and equipment information, such as excavator and dumper productivity. The voxel information is monitored at the excavation site, dump truck, and dump site. The information is categorized according to the soil type. The UI tracks the times for different activities, such as loading, hauling, returning, and dumping. These periods are associated with the equipment activities for each cycle. The systems calculate the productivity of the equipment based on the number of voxels excavated and the time period. #### 4.1.6 Excavation Cycle Visualization

An earthwork cyclic activity scenario was selected to demonstrate the functionality of the proposed system. The excavation activities were performed in repetitive cycles, and involved digging, loading, hauling, unloading, dumping, and returning. For model-equipment manipulation, users first selected equipment according to the activity. The excavation in the simulation was initiated when the excavator bucket interacted with the voxels. As the bucket penetrated the voxels, a collision was detected. The bucket penetrated the voxels to depth d based on the applied force, which was calculated from the bucket speed, penetration depth, and machine power. Once the voxels were dug and loaded into the bucket, they were classified as excavated voxels and added to the bucket payload. Figure 11 shows the excavation cycle of the excavation process, allowing users to experience the excavation process--from digging, involving bucket-voxel interaction, to unloading voxels at the dump site. After voxel excavation, the loaded voxels were collected in the bucket against the force of gravity, and the total number of voxels was monitored, depending on the voxel size and bucket size. The excavator hauled the voxel materials following constraints such as rotational angle, arm limit, movement, or velocity constraints. The unloading process was followed by placing the voxels from the bucket in the dump truck under gravitational acceleration and interactions with neighboring voxels. Finally, the dump truck was driven to the dump site, where the voxels from the dump truck container were unloaded under gravity at the dump site and settled after interacting with the rigid terrain. To improve operational performance, performance metrics were used to display operational information, including voxel volume excavated, dumped volume, cycle time, and productivity. This information was displayed on the UI captured through the scripts attached to the components (Figure 11).