# Using Dynamo for Automatic Reconstruction of BIM Elements from Point Clouds
## 3 Case Study
### Structural Columns  
The Old Lifeguard Station of Fuseta building is raised from the ground and supported by twenty-eight structural concrete columns, fourteen columns that support its access ramp, and eight columns visible on its main floor. These columns have a chamfered rectangular profile with variations in length and width. In addition to corrosion and deformations at several points, the columns are not distributed in an orthogonal grid and present considerable deviations from their axis with the vertical direction and rotation along the axis (Figure 8). The modeling of these structural columns in a traditional and orthogonal way, ignoring their deviations in their axes and rotation, would bring a high level of inaccuracy and infidelity; besides that, identifying all deviations and rotations would consume too much time in the process and could bring results that are not accurate. For these reasons, an automatic solution for geometric detection and modeling is the best approach in this case. The algorithm for the automatic detection and modeling of the columns was developed so that it is not necessary to perform point cloud cleaning operations beforehand, unless in cases where there is a lot of noise, and artifacts that can make it challenging to identify the shape of the columns. After inserting the point cloud in Revit, a selection of the corresponding points of the column was made. When running the algorithm, the user chooses the base and top levels of the column, the family to be used as a base, and the points used for the automatic detection of the geometry. For the script to have a good performance, the selection of points must be made to avoid including unnecessary points; even so, an automatic cleaning operation of artifacts and surplus points was developed, preventing the points that do not correspond to the columns from compromising the process. This noise and artifact cleaning operation was written and placed at the beginning of the code and is present in all the developed algorithms. It essentially groups by proximity the points in the selection and deletes those that are at a pre-determined distance greater than the set value, in this case, 15 mm (since the density of the point cloud used was 10 mm), but this value can be adjusted according to the needs of each project. After this cleaning-up operation, the automatic detection of  
Figure 8: **(a)** Image showing the type and state of conservation of the structural columns from the base of the building. **(b)** Illustrative image of the existing deviations in the columns. the column profiles and their dimensions begins. As the objective was also to identify the existing vertical deviation, it was necessary to obtain two profiles in each column, the first being close to the base of the column and the second close to the top. The location of the profiles in the \(Z\)-axis is performed through a variable parameter defined by the operator because, in this way, there is more control over the best place to perform the measurement, an important factor in cases like this where the columns have deteriorated in their base due to marine corrosion. With the two profile positions identified, it is possible to create the axis where the column fits and automatically position the created column families with their correct names and dimensions. To calculate the dimensions of column profiles, the algorithm measures the average distance between the captured points in the point cloud and the detected column insertion axis; then, it performs a value rounding operation. The algorithm automatically applies a rotation operation to its axis after having the column positioned and aligned with the axis previously determined. The first rotation value is automatically obtained with the same custom node used to draw the top and bottom column profiles, the Points.MinAreaRectangle node. A second value is calculated from the intersection of the vector of the two central points of these top and bottom profiles and the vector of the \(Y\)-axis.