1414def poisson_surface_reconstruction (
1515 points : Union [list [Point ], FloatNx3 ],
1616 normals : Union [list [Vector ], FloatNx3 ],
17+ sm_angle : float = 20.0 ,
18+ sm_radius : float = 30.0 ,
19+ sm_distance : float = 0.375 ,
1720) -> Tuple [FloatNx3 , IntNx3 ]:
1821 """Reconstruct a surface from a point cloud using the Poisson surface reconstruction algorithm.
1922
@@ -23,6 +26,20 @@ def poisson_surface_reconstruction(
2326 The points of the point cloud.
2427 normals
2528 The normals of the point cloud.
29+ sm_angle : float, optional
30+ Surface meshing angle bound in degrees.
31+ Controls the minimum angle of triangles in the output mesh.
32+ Default is 20.0.
33+ sm_radius : float, optional
34+ Surface meshing radius bound as a factor of average spacing.
35+ Controls the size of triangles relative to the point cloud density.
36+ Larger values result in coarser meshes with fewer vertices.
37+ Default is 30.0.
38+ sm_distance : float, optional
39+ Surface meshing approximation error bound as a factor of average spacing.
40+ Controls how closely the mesh approximates the implicit surface.
41+ Larger values result in coarser meshes with fewer vertices that may deviate more from the original point cloud.
42+ Default is 0.375.
2643
2744 Returns
2845 -------
@@ -46,6 +63,18 @@ def poisson_surface_reconstruction(
4663 2. Well-oriented normals
4764 3. Points distributed across a meaningful surface
4865
66+ The surface meshing parameters (sm_angle, sm_radius, sm_distance) control the quality and
67+ density of the output mesh. Increasing sm_radius and sm_distance will typically result in
68+ fewer mesh vertices, which can help filter out vertices that don't belong to the original
69+ point cloud, but may also reduce detail.
70+
71+ Examples
72+ --------
73+ >>> points = [[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]]
74+ >>> normals = [[0, 0, 1], [0, 0, 1], [0, 0, 1], [0, 0, 1]]
75+ >>> V, F = poisson_surface_reconstruction(points, normals)
76+ >>> # Use larger sm_radius and sm_distance to reduce mesh complexity
77+ >>> V, F = poisson_surface_reconstruction(points, normals, sm_radius=50.0, sm_distance=0.5)
4978 """
5079 # Convert input to numpy arrays with proper type and memory layout
5180 P = np .asarray (points , dtype = np .float64 , order = "C" )
@@ -67,7 +96,7 @@ def poisson_surface_reconstruction(
6796 N = N / norms [:, np .newaxis ]
6897
6998 try :
70- return _reconstruction .poisson_surface_reconstruction (P , N )
99+ return _reconstruction .poisson_surface_reconstruction (P , N , sm_angle , sm_radius , sm_distance )
71100 except RuntimeError as e :
72101 raise RuntimeError (f"Poisson surface reconstruction failed: { str (e )} " )
73102
0 commit comments