Skip to content

Commit fb6ed01

Browse files
authored
Merge pull request #3 from naturerobots/update-amock
Short meshing instructions for meshlab and Open3D
2 parents f81f575 + 34bea70 commit fb6ed01

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

docs/tutorials/mesh_mapping.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ It is also possible to convert certain data structures to others. Here a list:
6969
| Name | Link | Comments | MeshNav-proved? |
7070
|:----|:----|:--------|:-----|
7171
| lvr2 | https://github.com/uos/lvr2 | `lvr2_reconstruct` executable | yes |
72-
| Open3D | https://www.open3d.org/ | Example Open3D scripts: [Link](https://github.com/naturerobots/open3d_scripts) | yes |
7372
| meshlab | https://www.meshlab.net/ | | yes |
73+
| Open3D | https://www.open3d.org/ | Example Open3D scripts: [Link](https://github.com/naturerobots/open3d_scripts) | yes |
7474

7575

7676
#### LVR2
@@ -108,6 +108,56 @@ Some important parameters are:
108108
There are more parameters that influence the way lvr2 is reconstructing surfaces from point clouds.
109109
My advise is to just test them and see what changes.
110110

111+
112+
#### Meshlab
113+
114+
MeshLab is an open-source software designed for processing and editing 3D triangular meshes, widely used for reconstructing surfaces from point clouds.
115+
It supports various algorithms to convert unstructured point clouds into coherent triangular meshes, such as Poisson surface reconstruction, and Marching Cubes.
116+
117+
Further resources:
118+
- "Meshing Point Clouds": [https://meshlabstuff.blogspot.com/2009/09/meshing-point-clouds.html](https://meshlabstuff.blogspot.com/2009/09/meshing-point-clouds.html)
119+
120+
#### Open3D
121+
122+
Open3D is a versatile open-source library for 3D data processing that provides tools for surface reconstruction from point clouds using methods like Poisson reconstruction and alpha shapes. The following example showcases the usage of the python API to Poission reconstruction to extract surfaces:
123+
124+
```python
125+
import open3d as o3d
126+
import sys
127+
128+
# parameters for normal estimation for each point in PCD
129+
ne_max_radius = 0.1 # choose this dependent on the scale and density of your PCD
130+
ne_max_nn = 30 # choose this dependent on density of your PCD
131+
132+
# parameters for poission reconstruction
133+
possion_depth = 11 # the higher the more details, the more RAM is used
134+
density_filter = 0.05 # filter surface patches with low 'evidence'
135+
136+
# This script reconstructs surfaces from a point cloud using Poisson Surface reconstruction
137+
# using Open3D's API (version 0.18.0)
138+
#
139+
# Input: point cloud -> Output: mesh
140+
if __name__ == '__main__':
141+
file_in = sys.argv[1]
142+
file_out = sys.argv[2]
143+
pcd = o3d.io.read_point_cloud(file_in)
144+
145+
print("Estimating point normals...")
146+
pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=ne_max_radius, max_nn=ne_max_nn))
147+
148+
print("Starting Poisson surface reconstruction...")
149+
mesh, densities = o3d.geometry.TriangleMesh.create_from_point_cloud_poisson(pcd, depth=depth)
150+
151+
print("Removing vertices with low Poission density")
152+
vertices_to_remove = densities < np.quantile(densities, density_filter)
153+
mesh.remove_vertices_by_index(np.where(vertices_to_remove)[0])
154+
155+
# Save the mesh
156+
o3d.io.write_triangle_mesh(file_out, mesh)
157+
```
158+
159+
Further examples can be inferred from the official Open3D documention page: [https://www.open3d.org/docs/release/](https://www.open3d.org/docs/release/).
160+
111161
## Optimization
112162

113163
After we generated a mesh using SLAM approaches, it often has a high resolution; normally, exactly as high as the internal voxel representation.

0 commit comments

Comments
 (0)