# Voxel-Based Digital Twin Framework for Earthwork Construction
## 3 Methodology
### Interaction Between the Model and Equipment for Graphical Simulation in Unity 3D  
To create a simulation of the earthwork operational environment and model-equipment interaction at any given time during construction, interaction between voxels and equipment is necessary. This simulation was achieved in the Unity game engine. The Unity game engine was selected because it can import 3D data from design tools, provides a robust physical system, simulates model-equipment contact forces, allows simulation enhancements through scripts, and supports the deployment of cross-platform development and interactive user interfaces (UIs), where the operator or manager can interact with the system. Considering the complex nature of the earthwork process, the interaction is categorized into two main components, as follows: (i) model vs. model, and (ii) model vs. equipment. Since the target, ground, and as-planned voxel models are used in the proposed graphical simulation, each model is created separately. Surface-based representation has been used to create target and ground models, while voxels are used to represent the as-planned earthwork model. These models interact with each other during earthwork operations in the graphical simulation. Each component is assigned Unity physics components, which provide functions that behave realistically (Table 1). The model vs. model interaction was achieved using the defined Unity physics components. For example, the excavator falls under gravity because of the Rigidbody component, and the ground Mesh Collider supports the equipment's navigation around the construction site during the graphical simulation. Figure 6: A 3D model of the equipment with a hierarchical structure. On the other hand, the model vs. equipment interaction is the most important and complex aspect of manipulating earthwork models with equipment. This has been achieved using Unity physics components and scripting. When an excavator performs activities such as digging, loading, and moving back and forth for material handling, it interacts with the environment. The excavator interacts with the environment in two ways, as follows: (i) interaction with the environment not directly handled by the excavator bucket, i.e., the ground and target models, and (ii) interaction with the work environment, i.e., the voxel-based as-planned model. In order to reduce the computational efforts, the environment interactions (equipment vs. target model and equipment vs. ground model) are achieved through Unity physics, which provides exact collision. The excavator vs. as-planned model is a complex interaction because the excavator has to deal with the voxels to perform the earthwork activities. In the context of construction management, the project managers and operators are mainly concerned with volumetric deformation, quantities, and realistic visualization for making informed decisions. Simplified but efficient algorithms have been developed based on collision detection to create interaction between buckets and voxels, allowing excavation and earth loading to be performed. The algorithms allow us to perform earthwork activities and update the model in real-time, which would otherwise be too complex, requiring high computational loads due to the strongly nonlinear behavior of the dynamic equations [36]. The algorithms are scripted with C# programming and attached to each voxel and excavator bucket to determine the position of the bucket. When the excavator bucket enters the trigger zone of the voxels, the interaction is determined based on the Box Colliders assigned to each voxel. The algorithm detects the event and triggers the interaction. The identically shaped voxels proposed in this research make it easy and efficient to detect bucket mesh colliders. Similarly, when the excavator bucket exits the voxel trigger zone, the trigger exit function is activated. As the excavator bucket moves inside the voxels, the algorithm monitors the excavator bucket movement continuously as it interacts with the