Digital Twin in Computational Design and Robotic Construction of Wooden Architecture

&is study proposes a cyber-physical interconnection method for computational design and robotic construction in a wooden architectural realm. It aims to provide a highly efficient, flexible, and adaptive design-construction approach by continuously updating digital models and physical operations according to the locally sourced materials. A perception-modeling system to scan the source materials on-site and send their data simultaneously to design software was developed by using physical sensors and computational technologies in an innovative manner. &e data was used for architectural programs to generate design outcomes and guide the robotic construction. &e novelty of this study is to establish a real-time, bidirectional interaction mechanism between digital design and physical construction. &e design outcome is no longer a fixed, predefined geometric model but a dynamic, data-driven model which would be updated bymaterial conditions on-site.&e construction robot is able tomake synchronous adjustment automatically in coordination with the dynamic design. &e success of the iterative perceiving-simulating-updating loop was demonstrated by building two pavilions.


Introduction
Robotic fabrication in the architectural field experienced a big leap since the beginning of the 21st century. anks to the expansion of the open-source program ecosystem and the development of programmable robotic machines (Kuka [1], ABB [2], etc.), an increasing number of digital fabrication projects are being conducted in which the designers are fully involved in the design-construction process from the beginning until completion. In most of these projects, digitalization technologies enable the design ideas to develop virtually by analyzing and managing a large quantity of data through different types of simulations.
In 2015, Menges introduced the concept of cyberphysical construction in architecture, which involves construction processes that intensively integrate the realm of physical production with the virtual domain of computation [3]. is concept helps robotic fabrication to become more intelligent, as various levels of predictions and new operation tests for a complex system are simulated before the system is applied in the real world [4].
In order to further develop this method, this research proposes an on-site robotic construction workflow that is based on real-time physical sensing and computational analysis instead of relying on explicit modeling and inalterable instructions. e construction environment of the architecture using local source materials is complex and dynamic. Natural materials vary in sizes and shapes; hence, they are difficult to predict and to be suitably used. Our onsite robotic construction system is endowed with the perception of its current environment and conditions of source materials. With the feedback information collected by the robot, the virtual plan is updated dynamically and physical robotic actuation is adjusted in coordination with the virtual plan in reverse. is research proposes another design-construction workflow; it is a recursive, informational data-driven paradigm, instead of a static, closed topdown decision-making process. It helps on-site robotic construction to remain optimal in terms of adaptiveness and feasibility.
In order to clarify the subject of discussion, this article aims to achieve the following objectives: (1) A review of robotic fabrication and digital twin method applications (2) An extension and realization of the perceptionmodeling system with sensing and transfer technologies so that the system is able to capture and store source materials' geometry in advance, assemble the components in Rhino/Grasshopper, and instruct on-site construction with real-time site information (3) A redefinition of the novel design-construction workflow and data management, with a robust and integrated informational interaction of human-robot collaboration based on a digital twin model.

Background and Related Works
It was not until recently that the multifunctional industrial robots had their own test scenarios in the field of on-site architectural construction. In order to obtain remarkably efficient and accurate but automated fabrication output from robots, either of these experimental approaches tends to emerge as a series of parallel research fields to realize the novel architectural design-construction discipline, and, at the same time, a brand new concept of managing source data and operations over various fields as well as different phases in the design-construction workflow is raised.

Robotic Fabrication for Wooden
Architecture. e application of digital technologies in wooden construction, including early joinery customization and the CNC process, started in the 1980s [5]. In less than 40 years, Mjøsa Tower, the tallest prefabricated timber frame high-rise building in the world, has been constructed with a maximum height of 85.4 m, demonstrating the potential of wood as one of the most sustainable universal construction materials. Due to the flexibility of its materialization nature, wood has also become one of the preferred robotic fabrication materials and has been used in more than 80% of the most projects in the current research field [6]. In earlier studies, two main aspects of robotic wood fabrication research were reported. Fabio et al. completed a series of large-scale robotic fabrication projects [5,7], in which the wooden structural frame of the house was processed and assembled on-site. Alvarez et al. [8] and Schwinn et al. [9] from ICD University of Stuttgart introduced an integrative approach to build a sophisticated timber pavilion. However, both researches used processed timber components which is delicately produced and organized, and passively accepted errors occurred and accumulated during both fabrication and assembling processes. On the other hand, research studies also shed light on using unprocessed wood as the local components in a novel way, which may immensely improve the freedom and effectiveness of the system. Monier et al. developed a method for optimizing the use of native irregular shape wood pieces [10], although the method is still in the digital model phase. Schindler et al. worked on the potential of 3D scanning and the postprocessing of wooden branches by using CNC fabrication [11]. Obuchi et al. and their research pavilions [12,13] from T-ADS in the University of Tokyo explored a series of raw material assembly logic by accumulating regular and irregular local components, pushing the limit of raw materials as proper constructible elements, and using the latest digitization technology and a sophisticated working process. Self et al. and their Wood Chip Barn minimized the preprocessing of the wooden elements, replacing wooden trunks with the pretreatment of the joints. e trunks were later 3D-scanned, all geometric information was collected to generate the final form, and part of the main structure was assembled beforehand and then transported to the site [6]. Nevertheless, for all of these unprocessed wooden construction researches, neither a fully integrated procedure from design to construction phases nor a synthesized data flow management method can be found.

From Human-Robot Collaboration to Perception-Modeling
Fabrication.
e component assembly task is considered to be of great significance in on-site construction. e main challenges of this task are handling complicated geometries and obtaining high production flexibility [14], which in turn reflects in the proportion of human and robot involvement in this process. With the ultimate objective of achieving a construction automaton, to indicate a clear boundary between human and robot is inevitable, which increases an additional layer to the system complexity. Research studies have been conducted on various methodologies and frameworks for human-robot collaboration, realizing a highly flexible and adaptable construction system. Almeida and Sousa operated a robotic arm to cut timber components and then assembled the pavilion with human effort [15]. Larsson et al. proposed a human-in-the-loop fabrication system for small-scale construction by using irregular wooden branches, a leverage digital scanning technology, and a 2.5 D CNC machine [16,17]. It can be concluded that the division of labor between robot and human is relatively clear in the above cases; yet human involvement increases alongside the geometrical complexity, thereby resulting in a reduction in the effectiveness. By reconsidering such an increasing number of scenarios, the cases of implementing robotic perception-modeling fabrication intend to realize human involvement at the beginning of each informational input loop. Decision taken by the process of feeding physical environmental perception to the robot becomes possible with the support of the latest edge-computing technologies. Brugnaro et al. inspect the robotic fabrication of the woven bamboo structure in their robotic softness research, in which the real-time information is continuously shared with the decision maker [18]. Wu and Kilian conducted a research study on setting up a vision system to suggest assembly positions of the desired topological connections through real-time processed image information [19]. Jeffers discussed a method that a virtual model is built for persistent storage of material data and next built action can be computed accordingly [20].
In these cases, the robotic fabrication process includes interference either from the IoT devices or directly from 2 Advances in Civil Engineering humans to achieve a more adaptable system attributed by the real-time informational update and adjustment, avoiding the gradually accumulated errors, while a master management method about the workflow has not yet been summarized or proposed. In order to develop this concept further, the distribution and management of the appropriate human-robot relationship for the whole lifecycle should be addressed prior to the description of the construction.

e Digital Twin
Paradigm. Digital twin (DT), as a novel paradigm for realizing interaction and integration between the physical space and the virtual space, has been developed to manage complicated systems for the relevant academic circles and enterprises [21]. is method is considered to be able to provide an integral and material-behavior-driven construction paradigm for complex conditions in robotic fabrication process [22], aimed at bringing geometric and detailed design, structural simulation, 3D scanning, and onsite construction together. e concept of the digital twin was first introduced by Grieves, who stated it as the "Conceptual ideal for product lifecycle management (PLM)" at the University of Michigan in 2002 [4], defined as "a set of virtual information" that describes the physical object of different scales. Due to the rapid development of IoT devices, the cloud-computing technology, and the machine learning algorithm, a multifunctional robotic arm is conferred with the capacity of retaining its digital twin, which receives real-time information through sensors, has access to the collected big data cloud, and triggers its physical twin to take actions after analyzing various design disciplines in the virtual world.
is method was tested in the early space capsule prototype [23] and can be continuously developed in the manufacturing realm. In 1991, an idea called "simulation control" was proposed, which outlines a prototype system in which simulation is integrated into a CIM environment for manufacturing [24]. ereafter, the concept and exploration of DT have seen rapid progress thanks to the advances in technology. e digital-twin-driven approach includes the following three parts: the physical layer, digital data exchange, and the virtual layer. e physical layer refers to the real production environment. e virtual layer refers to the digital model of the physical resources for carrying out both the manufacturing simulation and the real-time optimization of the systems. Digital data exchange refers to the data interaction between the physical layer and the virtual layer; it collects the real-time data from the physical layer and the feedback from the virtual layer and vice versa. Nowadays, the focus areas of digital twin applications are different from the product lifecycle, layout planning, process design, maintenance, PPC, etc. [25], and the inclusion of the digital twin model optimizes multiple aspects. Boschert and Rosen illustrated that the digital twin uses essential information to bridge over creation, production, operation, and disposal phases, thus resulting in a system available for succeeding in the phases in which almost everything within the system, including material geometry, structural performance, and raw data from fabrication, can be monitored and tracked [21]. Malik and Bilberg proposed a digital-twin-framework-based model that supports the design, development, and operation of human-robot collaboration in the manufacturing practice, illustrating the use of digital twin in the human-robot task allocation and the workplace setup [14]. Harper et al. in ABB focused on the development of digital twin standards in which the on-site virtual support can be achieved [26].
Taking advantage of the digital twin model, the negotiation and blurry boundary between the virtual and the physical space are erased, thus leaving a fully integrated cyber-physical construction environment for a real-time information feedback loop. e vision of the digital twin application is always emphasized; yet practical use is seldom tested or realized, especially for those robotic fabrication researches in architectural field.

Methodology
is research presents a digital twin framework ( Figure 1) of the overall design-construction process, ensuring a smooth interconnected informational exchange back and forth linking the virtual and physical space. e framework consists of four phases: in the preparation phase, unprocessed wood branches are selected as source materials; the silhouette is selected and developed as the measuring method. In the material perception-modeling phase, the parameters and mathematical formulation of the real-time image acquisition and shape reconstruction system are calculated; corresponding programs are developed. In the dynamic design phase, material organization and the corresponding overall geometries are evolved using matching algorithm and positioning algorithm. In the flexible construction phase, robotic assembly is achieved using the executing program, monitoring program, and adjusting program. e digital twin framework enables up-to-date material information of the physical space to be reflected in the digital model with a high level of precision and synchronization, and the dynamic modifications of the digital model also provide an almost real-time change in the robotic assembly.

Material Selection.
Wood is considered to be a lowcarbon, environmentally friendly material, and its unique texture is aesthetically favorable for architectural design. Straight tree trunks are widely used as they can be cut into standardized pieces for the building industry. However, small tree trunks and branches with diversified shapes are typically abandoned as they are difficult to use systematically due to their variability.
However, we believe that wood branches with natural variability demonstrate great potential in nonlinear architecture with complex geometry as they offer more approaches and possibilities in design. In the manufacturing processes, taking advantage of material variability rather than fabricating variable components out of standardized materials decreases processing operations, improves Advances in Civil Engineering fabricating efficiency, and transforms scrap materials into good account.
Our objective was to develop a real-time material information acquisition system that features variability recognition and shape awareness. erefore, we used unprocessed wood branches collected from the trees on the construction site on the campus of Tianjin University. ese branches were cut by the City Sanitation Department and were considered low valued and were to be chipped or burned if not used ( Figure 2).
is study conducted pavilion-scale design-construction experiments. Consequently, we selected branches with lengths of 35-245 cm. eir diameters ranged from 4 cm to 20 cm, thick enough to be strong and thin enough to be easily used.

Measuring Method Decision.
e existing measuring and modeling methods can be categorized into active and passive methods. e active methods primarily include moiré fringe, time-of-flight (ToF), structured lighting, and triangulation, whereas the passive methods primarily include shape from texture (SFT), shape from shading (SFS), multiview stereo (MVS), and silhouette methods. ese methods rebuild objects with mathematical and physical principles. To be more specific, moiré fringe uses the interference of wave to deduce the shape; ToF measures the time taken by an object to travel a distance through a medium; SFT, SFS, and structured lighting mainly use perspective principles; and triangulation, MVS, and silhouette use the methods of deformations with triangular positioning. e attributes of each method are presented in Table 1 [14][15][16][17][18]. e "+" and "− " signs indicate strong and weak performances. e perception-modeling system developed in this study was based on the silhouette method. We selected the silhouette method for the following reasons. 2D silhouettes from different views of the scanning material are able to rebuild a 3D digital model by Boolean intersection, and hence the method is feasible. Second, the hardware setup is convenient and suits for the environment of construction site.
ird, the software is easy to operate and can be compatible with the popular design software Rhino/ Grasshopper.
Based on the silhouette method, we introduced a simple algorithm to improve the speed and efficiency of the obtained outlines from wood branches and rebuild their visual replicas. e optimized perception-modeling system could  quickly and easily build 3D digital models of all of the tested branches. e system could be embedded in the end effector of a construction robot for small-scale material components or fitted to a particular holder for large-scale components.

Parameters and Mathematical Formulation.
e parameters of the perception-modeling system include camera angle, the size of the provided branches, the distance between the camera and the testing branch, the angle between two adjacent cameras, and the number of pixels in the corresponding direction. ese parameters should be considered as a related set, and they would determine the precision and the cost of the system.
In this study, the radius of the branch range is set as R, the distance between the camera and the branch center is d, and the camera angle is set as α. Hence, a relationship is formulated between these parameters as follows: en, the number of pixels in the corresponding direction of the camera is set as n, and the resolution of the reconstructed model is set as c.
en, a relationship is established between them using (1): In regard to the error analysis, the uniform errors of the system are affected by two factors, as shown in Figure 3: one is the angle between two adjacent cameras, and the other is the radius of the projection on the plane of the camera group. In order to establish the error, the study sets the former as δ, the latter as r, and the inherent error as e. en, a relationship is formulated between these parameters as follows: An approach direction is that the performance of the equipment should be improved as much as possible, which means e < c. Finally, the corresponding equipment configuration and the working range can be determined by solving the above equations.
For relatively smaller branches with a section radius of less than 10 cm, the perception-modeling system is embedded inside a Kuka KR60/HA Robot. Considering the robot arm span and the analysis of the above formular, the length of 165 cm was chosen as a safe threshold for the scanning branch. Actually, the threshold is a reference value with multiple idealizations. e measurement limit is related  Advances in Civil Engineering to the shape of the branch, the position it is placed at, the lens parameters of the camera, and the position of the shot. e limit value is estimated from these parameters through a ternary function. Maintaining a balance between convenience and accuracy, this research finally uses d � 100 cm, α � 0.3π, δ � 0.444π, and n � 720. As shown in Figure 4, the robot would capture nine images from different perspectives as its end effort moves and shots in relevant positions. For larger components exceeding the robotic scanning range, another strategy that controls several cameras to capture material images from different perspectives at the same time is applied by using a particular holder. With a similar calculation method, this study considers d � 300 cm, α � 0.3π, δ � 0.667π, and n � 720. Six cameras are fixed to a 600 cm long frame to shot the branch at the same time.

Programs.
A calibration program for correcting dimensions is prepared before scanning the branches. e program establishes the mapping relationship between the contour pixels of the testing object in the measuring location and spatial points in the modeling software. e scaling parameter and the rotation parameter are calculated and examined. Meanwhile, scripts for reading information from multiple cameras are also developed. is calibration program only executes once at the beginning of the whole workflow and does not require recalculation once the branch is scanned.
After running the calibration program, the system begins to perceive physical branches and rebuild their 3D models virtually. Two programs are developed. One is an external program that captures different views of the branch images and extracts related data for the visual presentation. e other one is an interface program that synchronously receives the data and converts it into the corresponding digital model in the design software Rhino/Grasshopper. e external program and the interface program run simultaneously.
e external program extracts smooth contours of the branch, calculates three-dimensional coordinates of the points in the contours, and generates a file containing the data of all the points. e interface program receives array data, maps the spatial positions of the points, shapes outlines from different views, and generates the corresponding digital model by using the algorithm of the Boolean intersection ( Figure 5). e perception-modeling system developed in this study is endowed with flexibility, reliability, and usability. Firstly, flexibility implies that the material perception programs are applied in modular organizations, where each camera and its corresponding software layer can work independently. erefore, researchers can add or reduce camera numbers to achieve different accuracy requirements. Additionally, the system displays a high tolerance for faults and hence is considered highly reliable. It considers the unstable operation of the sensor: when some cameras are broken, the other cameras can still work and maintain the system's function despite a reduced accuracy. Lastly, usability implies that the system is designed for easy operation, low cost, fast running, and high efficiency on most devices. e system has been optimized through appropriate image abstraction techniques that need less computational capacity, so that most computers are capable of running the program without considering the speed issue.

Dynamic Generative Design
Phase. Source materials are recognized, digitalized, and analyzed in the perceptionmodeling phase and would be well organized in the design phase. ey actively participate in generating the overall geometry of the architecture, and the outcome remains dynamic with the updating of the provided materials. is study provides two approaches to generate the dynamic design outcome based on the source materials.

Matching Algorithm.
e first approach focuses on the matching algorithm; it generates geometry by optimizing the organization order of the provided branches. Based on connection rules, i.e., each fork of the branch should be connected with a fork of another branch; it firstly gets the results of different combination possibilities. If none of the  Advances in Civil Engineering combinations can achieve the rule, more source branches should be provided until at least one option is resultful. After geometric simulations, material effectiveness of all resultful combinations is calculated and the most effective way is selected. Specifically, if the distance between two adjacent forks is too small, the extra parts beyond the intersection will not bear weight and will be ineffective. e total lengths of the ineffective parts of different combinations are calculated and their results are sorted. Finally, structural performance of generative geometry is simulated and optimized by finite element analysis in Grasshopper ( Figure 6).

Positioning
Algorithm. e other approach of generative design focuses on positioning algorithm, and the overall geometry evolves by scanning and assembling the source branches iteratively. e outcome is updated by continuously mirroring the current branch and putting it in a suitable position. A guiding curve is defined by the designer from an aesthetic perspective. e branch is assembled along the curve by anchor determination script and orientation determination script. e operation continues until no more branch is provided. In this approach, the overall geometry forms gradually, and the final outcome appears only after the last source branch is captured (Figure 7).

Flexible Robotic Construction Phase.
After the material perception-modeling phase and the dynamic generative design phase, a flexible construction system is developed using real-time robotic communication techniques. e "flexible" term implies that the robotic fabrication system

Advances in Civil Engineering
can react to new information acquired during the actual fabrication process rather than merely executing the previously compiled machine code.

Executing Program.
Robotic executing program is developed in Grasshopper/KukaPrc. ey output synchronous serial commands for the effector actuation in coordination with the dynamic design. Once the design model calculates the position of a branch, the robotic arm would move it to the corresponding location for assembly. In addition, a pause function and a forced-termination function are added to the program in order to prevent accidents.

Monitoring and Adjusting
Program. e monitoring and adjusting program is developed using Grasshopper Python to quickly validate the assembly operation before its output in the real world. A monitoring module made of Kinect device is embedded in the end effector of the robotic arm to perform real-time skeletal detection. Quokka, a software tool for connecting Kinect with Grasshopper, is edited to use the Kinect as a 3D scanner. With the monitoring module, points and vectors could then be extracted from the centreline throughout the geometry of the branch, and then the actual status of the branch could be compared with the digital simulation. Adjusting codes are written in Grasshopper Python for modifying the assembling location if the difference between real geometry and digital geometry exceeds the threshold value.

Experimental Results and Discussion
Based on the above-discussed cyber-physical system, this research constructed two experimental pavilions to verify the feasibility. e processes and results are explained in the following sections.

Experimental Case 1: "Robotic Knows" Pavilion.
e first experimental pavilion is called "Robotic knows." e pavilion is devised using a physical-virtual-physical procedure. Information extracted from the physical materials is processed to drive the digital design geometry and the digital model and, in turn, decides the robotic actuation in the physical space.

Physical to Virtual: Material Perception and Design
Generation. In this pavilion, the abandoned "Y"-shaped branches with the length ranging from 75 cm to 245 cm are used, and their digital replicas are automatically built using the perception-modeling method developed in this study. e valuable data of the scanning branch are distilled, whereas the useless data that does not affect the design result, such as slight unevenness on the branch surface and the bending amplitude of each fork, are discarded. e valuable data include the following parameters: three-dimensional coordinates of the four points-P0, P1, P2, and P3-of the branch, the length between every two points, and the length and the thickness of each fork (Figure 8).
en, the digital replicas of all the branches are used to generate the architectural design in Rhino/Grasshopper platform. Multiple screening is used to choose the organization method for all branches and to generate the corresponding architectural geometry.
ere are four levels of system screening: load-bearing screening, arrangement order screening, material effectiveness screening, and structural performance screening. In load-bearing screening, branches are sorted by volume, and the three largest branches are selected as the main supporting structure. In arrangement order screening, feasible arrangement orders are kept while incorrect arrangements are eliminated. As shown in Figure 9, for any two branches B and C, fix their P1 to P2 or P3 of branches A and check if they can intersect or not and then remove all the disjoint combinations. For the next layer, branches D and E connecting with branches B, repeat the logic. In material effectiveness screening, the total amount of useless material of every feasible arrangement is calculated and ranked. For all possible combinations, the intersection trajectory of branches B and C is an ellipse; choose the position that is closest to the central axis of branch A to ensure the overall stability, cut the useless parts of branches B and C, and repeat this process until all branches are linked to each other. Calculate the total cutting lengths of different options according to the information list of all the branches and rank all possibilities according to e top five options are selected. In structural performance screening, a plug-in of Grasshopper called "Millipedes" is used, and scripts are written in GH Python to test and optimize the structural performances of the five options. e best one is selected and optimized. e initial design sets three load-bearing branches from an empirical point of view. Nevertheless, the simulation results show that the shear force at the grounding points can be very strong and exceed their beating capacities. erefore, modifications are proposed, and more small supporting branches are added. e upper part of the geometry is also regenerated to make the force distribution more uniform (see Figure 10).

Virtual to Physical: Real-Time Data Flow and Robotic
Construction. Once the geometry is generated and optimized, data is transmitted from Grasshopper to the robot arm for creating a direct link between the digital design and the physical construction. Robotic construction includes the following two parts: localization and motion planning. In the localization part, a reference location is used to make the robot "know" its position. e results show that the position accuracy can be achieved within 2 cm. In the motion planning part, a plug-in called KukaPrc is used to control the robotic actuation. e program is written for computing the movement data based on the digital model ( Figure 11). e last step is joint designing for feedback error correction. At present, two methods are available for removing the errors: reducing errors by higher precision control and designing structures with larger error redundancy to directly absorb the errors. Considering the complexity and reliability, this experiment adopts the latter strategy. A special node with universal joints, three-way pipes, and jackscrews is designed to fix the major error. e universal coupling is very flexible and can freely adjust the distance and the angle of the two connection points. Before positioning the branches, the cardans are fixed on each branch. Each pipe with a universal joint is fixed with a fork, and there are three universal joints in each node that are connected by prefabricated metal pipes instead of the traditional shaft. e branch is autonomously moved to the corresponding position by the robot, whereas the cardans are manually welded, and the node is manually locked by the architects. e newly designed joints ensure structural stability and local adjustment (Figures 12 and 13).

Experimental Case 2: "Robotic Eye-Brain-Hand Coordination" Pavilion.
e second experimental pavilion is referred to as the "robotic eye-brain-hand coordination." e pavilion is evolved by cyber-physical iteration with sensoractuator feedback. e perception-modeling system is embedded in the end effector of a robot and is considered as the "eye" (the sensing end) of the iteration system, which reads the characteristics of the scanned branch and transfers the data to Rhino/Grasshopper on a PC. e "brain" (the calculation end) analyzes the data to calculate the position of the scanned branch. e "hand" (the action end), i.e., the robotic end-effector, assembles the branch autonomously without programming its motion code in advance. e "eyebrain-hand" program loop operates continuously, gradually evolving and unfolding the overall geometry of the pavilion ( Figure 14).    Bending moment (before) The mechanical properties of wood are also anisotropic. When the force direction is caused by the fiber direction, it is stress along the grain. When the stress direction is perpendicular to the fiber direction, it is the transverse stress.
Axial: meshes are colored red or cyan depending on whether the dominant effect compression or tension  there are no roads or obstacles. Hence, a decreasing spiral guiding curve is defined, expecting that a closed shield is formed with an entrance hole. en, the number of joints and joint positions are set based on the structurability and structure performance. Before the actual construction, testing experiments were conducted, and the results showed the following logic ensured feasibility and stability: the position of the current branch is determined by itself and the previous one. When assembling branch (N + 1), its midpoint G of the longer fork is found and then one-third of points near the branch attachment points A and B of branch N are computed; the midpoint of line AB coincides with the point G, and the longer fork in branch (N + 1) is passed through points A and B so that the joint position of branches (N + 1) and branch N is known. At this time, branch (N + 1) can be rotated along the AB axis and its rotation angle is determined by the tangent direction of branch (N + 1) to the nearest point of the guiding curve so that the assembly location of branch (N + 1) is determined (Figure 15). e monitoring programs and adjusting programs are developed to prevent the problems before they even occur. Codes are written in Grasshopper and KukaPrc to allow realtime rectifications. In the digital model, the closest point selected each time is compared to the former one. If the current closest point grows in the opposite direction of the generating surfaces, the former point replaces it. is loop continues until the generating surface moves beyond the guiding curve. If there is any problem during the construction process, the data are fed back to the digital model in Grasshopper for a real-time adjustment (Figures 16  and 17). e end effector of the robotic arm is custom-designed and is supposed to hold the branch firmly and be available for the different surface qualities of all the provided wood branches. First, an electronically controlled claw is used. By using the AFMotor library in Arduino, the opening and closing states, running speed, and rotation direction of the gripper can be controlled in real time. However, such a claw has the following limitations: its opening and closing range is only 0-90 mm, and its maximum force weight is only 16 kg, so it is considered suitable for grabbing only light and thin branches. In order to improve the grabbing ability, the pneumatic parallel open/close claw is finally selected and modified. e size between the parallel plates is adjusted to match the diameter of the branch. e contacting surface of the plates is coated with a special rubber material for increasing the coefficient of friction so that the branch is not twisted. e features of this developed pneumatic claw are as follows: (1) wide opening and closing range, (2) greater grabbling ability, (3) being suitable for branches with different sizes and weights, and (4) the capability of being connected to the GH function and controlled by the generative digital model.

Discussion.
e main advantages of the digital twin paradigm presented by the two pavilions are as follows.
First, the design-construction system becomes more adaptive and flexible. e traditional approaches usually present design by using static modeling and are not able to manage the challenges of dynamic conditions and the changing demands on the construction site. In the digital twin paradigm, generative design with updating information can optimize the output in real time in response to the source materials and unpredictable changes on the site.
Second, collecting and sending the data simultaneously improves the efficiency of handling complex material information and allows better use of each resource. Significant benefits of reduced managing time and cost can be achieved by the virtual experimentation of the generating and assembling process.
Lastly, the digital twin model is continuously updated with all the evolutionary changes and modifications in the physical system, and design and construction are no longer disconnected and rather collaborate in a digital loop, offering a reasonable design and achieving a more efficient and precise actual realization. Although these two pavilions focus on wood branches, the digital twin paradigm for generative design and robotic construction is applicable to other local source materials. By using the cyber-physical system, material scanning can be combined with a digitally arranged and robotically assembled continuous real-time workflow. Similar to the presented experimental cases, the final design and appearance emerge only after analyzing and responding to the geometric variability of the material.

Conclusion and Future Work
In this research work, a real-time perception-modeling system is explored for digitizing wooden branches of variable shapes, and the generated data is deployed later in both generative design and robotic construction phases. Using this system, material data were obtained and transformed from the physical space to the digital space. e data were subjected to geometrical optimization and structural simulation. In coordination with the digital model, the robot simultaneously outputs synchronous serial commands for the effector actuation. e following contributions of this research can be concluded.
First, a stable, robust, and easy-to-use material scanning method is explored. By implementing this method in perception-modeling phase, the unique geometrical information of each unprocessed wooden branch can be digitalized and abstracted so that all of the data is stored in a master digital twin model. is component information is later used in both generative design phase and robotic construction phase for different purposes.
Second, this research focuses on reusing unprocessed wooden branches as the basic components for two on-site constructed pavilions, in which the solutions are oriented toward the source material and the changing environment instead of a predefined workflow. e system is established with the capacity of integrating all data from preparation to construction phases and being updated according to realtime data.
ird, two practical construction cases are built and studied under guidance of the digital twin paradigm. All of the process data is stored and extracted back and forth from a master model, ensuring the data consistency and providing excellent efficiency in dealing with complicated geometry cases. Besides, the developed paradigm can reversely benefit the traditional discrete construction system with the method of adaptive process that copes with inevitable construction errors by feeding real-time information and making alternative decision iteratively.
In this report, a series of potential improvements are presented. First of all, the material sensing part can be improved. Different types of sensors are installed, and the analysis algorithms can be optimized. erefore, the system is able to perceive and utilize other kinds of material information, such as strength and toughness. Second, the cyber-physical iteration part can be further optimized to deal with physical construction errors. In the robotic arm assembly part, errors inevitably exist between the real and the ideal environments, which may degrade the performance. Further improvement can be achieved by developing a global monitoring system together with the local joint scanning scheme, which provides necessary overall geometric modifying indications towards the ideal form. According to the difference between real geometry and digital geometry, a new strategy should be generated in real time for adjusting the assembling location of the next component.
e theory and method of this study can be used in future research. e digital twin paradigm opens up the possibility of integrating material variability by using highly customized analysis, calculation, and fabrication process [27]. Irregular timber panels or trunks can be analyzed for geometric fitting in large-scale constructions.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.