# An Open-Source Algorithm for 3D ROck Slope Kinematic Analysis (ROKA)
## 2 The ROck Slope Kinematic Analysis (ROKA) Algorithm
### Algorithm Input Data  
The input required for the KA performed by the ROKA algorithm are as follows:  
1. The 3D point cloud representing the study rock slope;
2. The geometric features (center coordinates, orientation, dimension/radius) and the set of attribution of the discontinuity;
3. The dimension of the scan-sphere that will be centered on every point of the point cloud to select the surrounding points used to calculate the \"average\" local orientation of the slope; and the dimension of the circular scan-plane that will be centered on every point of the point cloud with the local orientation of the 3D model, which is used to calculate the intersections between the discontinuities and the slope surface;
4. The cutoff value of the intersection between discontinuities and the moving scan-plane;
5. The KA parameters, in particular the friction angle and the lateral limits. The input point cloud must be a text file in which all the metric coordinates of the 3D points that represent the rock slope (x, y and z) and their normal vector components (Nx, Ny and Nz) are reported. To perform a correct analysis, the point cloud must have a near constant surface point density because it is required to ROKA calculations, especially for the definition of critical value of the discontinuity planes and intersection that could activate MOFs (described in Section 2.5). The geometric information about the discontinuities must be stored in an Excel file (.xlsx) where the rows correspond to the discontinuities and the columns to their geometrical information. The XLSX file must report the header and the data as the example shown in Table 1.  
The set to which the discontinuity belongs must be stored in another Excel file (.xlsx) where dip, dip direction and set must be reported in three column for each discontinuity. The dimension of the scan-radius can be decided considering several parameters, as the density of the point cloud representing the slope, the complexity of the slope geometry and the dimension of the discontinuities. In general, for each point of the 3D model the scan-radius defines (Figure 3):  
1. the dimension of the scan-sphere (Figure 3b) that is used to calculate the 'average' local orientation of the slope; \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Dip** & **DipDirection** & **Radius** & **Xcenter** & **Ycenter** & **Zcenter** & **Nx** & **Ny** & **Nz** \\ \hline
83 & 119 & 2.56 & 67.66 & \(-46.94\) & 845.85 & 0.86 & \(-0.48\) & \(0.11\) \\
75 & 327 & 3.01 & 67.94 & \(-45.74\) & 847.04 & \(-0.51\) & 0.82 & 0.24 \\
85 & 287 & 2.35 & 67.95 & \(-46.30\) & 846.46 & \(-0.94\) & 0.30 & 0.07 \\
86 & 284 & 1.08 & 67.49 & \(-46.55\) & 847.56 & \(-0.96\) & 0.2 & 0.06 \\
11 & 108 & 18.16 & 101.61 & \(-26.32\) & 891.34 & 0.19 & \(-0.06\) & 0.97 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Example of outfit of a XLSX file where the discontinuity geometry information is stored. The data reported in this table are rounded to fit well the text. The user can change the precision of the data as preferred. 2. the dimension of the scan-plane (Figure 3d) that is used to calculate the intersections between the discontinuities and the slope surface. The choice of the scan-radius size must be done considering also its influences on results, because modifying the scan-radius the different slope orientations and consequently the number of critical discontinuities and intersections can undergo variations. The cutoff value of the length of the intersections between the discontinuities and the scan-plane must be defined in order to avoid an overestimation of the critical discontinuities. The cutoff must be expressed in meter and the default value selected (already considered by the algorithm) is equal to 90% of the scan-plane diameter. The parameters required to perform the kinematic analysis are the friction angle and the lateral limits. The default values are 30\({}^{\circ}\) and 20\({}^{\circ}\), respectively, because, as reported by [5], they are the most common values for many types of rocks slope.