Skip to content

Commit 34bea70

Browse files
committed
placed open3d parameters to the top of the file
1 parent b76f846 commit 34bea70

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

docs/tutorials/mesh_mapping.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,32 +125,33 @@ Open3D is a versatile open-source library for 3D data processing that provides t
125125
import open3d as o3d
126126
import sys
127127

128-
"""
129-
This script reconstructs surfaces from a point cloud using Poisson Surface reconstruction
130-
using Open3D's API (version 0.18.0)
131-
132-
Input: point cloud -> Output: mesh
133-
"""
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
134140
if __name__ == '__main__':
135141
file_in = sys.argv[1]
136142
file_out = sys.argv[2]
137-
138143
pcd = o3d.io.read_point_cloud(file_in)
139144

140145
print("Estimating point normals...")
141-
pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.1, max_nn=30))
142-
143-
# Tweek the following parameters
144-
depth = 11 # the higher the more details, the more RAM is used
145-
density_filter = 0.05
146+
pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=ne_max_radius, max_nn=ne_max_nn))
146147

147148
print("Starting Poisson surface reconstruction...")
148149
mesh, densities = o3d.geometry.TriangleMesh.create_from_point_cloud_poisson(pcd, depth=depth)
149150

150151
print("Removing vertices with low Poission density")
151152
vertices_to_remove = densities < np.quantile(densities, density_filter)
152153
mesh.remove_vertices_by_index(np.where(vertices_to_remove)[0])
153-
154+
154155
# Save the mesh
155156
o3d.io.write_triangle_mesh(file_out, mesh)
156157
```

0 commit comments

Comments
 (0)