This version of Cloud2FEM is based on a portable python.exe version (compatible with Windows OS only). To launch it, open a cmd.exe window and then type the following commands:
cd Cloud2FEMportable
python main_Cloud2FEM.py
You should see the GUI appear in a few seconds.
A finite element mesh generator based on point clouds of existing/histociral structures.
Illustration of the proposed GUI that implements the CLou2FEM method (from the paper "Cloud2FEM: A finite element mesh generator based on point clouds of existing/historical structures" by Giovanni Castellazzi, Nicolò Lo Presti, Antonio Maria D’Altri and, Stefano de Miranda (2022), published in the SoftwareX Journal).
Nowadays, the common output of surveying activities on existing/historical structures consists of dense point clouds. However, the direct and automatic exploitation of point clouds for structural purposes, i.e. to generate finite element models, is still very limited. In this framework, the Cloud2FEM
software supplies an automatic finite element mesh generator based on point clouds of existing/historical structures. Cloud2FEM
is based on open-source Python libraries with graphical interface.
Python 3.8.5 installed on your machine.
Use the Python package manager pip to install the following packages:
PyQt5, PyQtGraph,
ViSpy, NumPy,
pyntcloud,Shapely,
ezdxf.
- PyQt5: pip install PyQt5==5.12.3
- PyQtGraph: pip install pyqtgraph==0.11.1
- VisPy: pip install vispy==0.6.6
- NumPy: pip install numpy==1.21.2
- pyntcloud: pip install pyntcloud==0.1.5
- Shapely: pip install Shapely==1.7.1
- ezdxf: pip install ezdxf==0.15.2
The main graphical user interface of the software Cloud2FEM
is shown in Fig. 1. On the top (I), the file menu contains buttons to load point clouds (the input data of this software), save a project, load a previously saved project, and export data to be used into CAD environments (i.e. .dxf slices) or FE simulations (i.e. FE solid mesh). On the left (II), the 3D Viewer section contains buttons to open a separated window where the selected quantities can be explored in 3D.
Fig. 1 – Cloud2FEM main graphical user interface: (I) file menu, (II) 3D Viewer panel, (III) cloud/mesh processing panel, (IV) plot area, (V) 2D Viewer panel, (VI) editing bar. |
The right panel (III) contains, starting from the top, the extreme z coordinates of the loaded point cloud, a section to specify the slicing modality, buttons to perform all the steps needed to generate a FE model. Red and green indicators beside each button denote if a certain step still needs to be performed or not, respectively. Most of the data generated through the steps in the right panel can be visualized in the central plot area (IV), which occupies most of the space of the interface. The 2D Viewer section on the left (V) can be utilized to choose the data to be shown, for any slice. The edit button on the top bar (VI) allows to enter the edit mode for the current slice and for the selected data type. An example of slice processing is shown in Fig. 2.
On each slice, local modifications can be performed with the help of various suitable ad-hoc tools (for both points and polylines, e.g. draw, join, remove, add, move, offset, etc.), that can be activated via keyboard shortcuts. The top bar (VI) contains also buttons to save or discard the changes made in the edit mode, as well as a copy button that opens a separated window used to copy data from one slice to others. Finally, the button “Generate mesh” positioned at the bottom of the right panel (III) generates the matrix of nodal coordinates and the connectivity matrix of the FEs, i.e. the FE mesh, which can be exported from the file menu (I). In this particular case, the mesh is exported into the .inp format (Simulia Abaqus), which can be visualized also by open-source software packages, see e.g. FreeCAD . Anyway, the matrix of nodal coordinates and the connectivity matrix of the FEs can be found unencrypted in the .inp file (text format), and so they can be used in any available FE software.
The main functionalities of Cloud2FEM are here listed:
- Loading a point cloud in .pcd or .ply formats and visualizing it with the 3D viewer. Since the 3D visualization of a large point cloud can be computationally demanding, the software uses a graphical accelerated tool to support real large dataset visualization. Nevertheless, the user can choose between three possible predefined resolutions (10, 50 and 100%) to get a smoother interaction.
- Visualizing the extreme [Z_min,Z_max] coordinates of the loaded point cloud.
- Slicing of the point cloud. The user can choose between two slicing rules, i.e. fixed number of slices or fixed step height. The function activated by the “Generate slices” button extracts slices from the loaded point cloud, according to the specified slicing parameters. Every slice, named by its Z coordinate, can be selected from the drop-down list on the left panel and visualized in the 2D viewer. The whole set of slices can be visualized in the 3D viewer by checking the corresponding checkbox on the left panel.
- Simplifying and ordering the slices. Every slice, consisting of an unordered array of points, is processed through the algorithm called by the “Generate Centroids” button to get a new smaller array of ordered points that can be used to efficiently describe the geometry of the slice. The centroids can be visualized in the 2D viewer by checking the corresponding checkbox in the left panel.
- Generating polylines. The centroids data generated by the software in a previous step is utilized to get a set of raw polylines. These are automatically simplified to get a cleaner and lightweight geometric representation. Both the raw and the clean polylines can be visualized in the 2D viewer by checking the corresponding checkbox in the left panel.
- Generating polygons. A more descriptive data type is automatically derived from the polylines obtained in a previous step. Each slice is described by means of polygons, made of inner and outer bounds. This geometric representation can be exported in the .dxf file format.
- Generating the mesh. A FE mesh is automatically generated from the polygons data. The X and Y dimensions of the voxels are set according to the grid visible in the 2D viewer, while the Z dimension depends on the adopted slicing parameters. The output can be exported in a text file format organized according to the Abaqus notation (.inp) [9].
- Saving and opening a project. The data handled by the software can be stored and retrieved to allow discontinuous work sessions. Furthermore, since the data is stored using the built-in Python shelve module, advanced users can easily exploit the data in other Python-based software.
- Editing of points and centroids. To eliminate criticalities in the slices, points and centroids can be removed individually or in bulk with graphic tools in the 2D viewer.
- Editing of polylines. A set of tools in the 2D viewer allows for an advanced graphic editing of the polylines. Vertices can be added, removed or moved, polylines can be joined, removed or drawn from scratch if geometric data is missing from the original point cloud.
- Copy of the polylines of a slice. The polylines of a slice can be copied to other to speed up the editing process.