1
1
# cython: language_level=3str
2
2
3
+ # # 2021.07.21: code adapted from https://github.com/mmolero/pypoisson
4
+ # # https://github.com/mmolero/pypoisson/blob/4f6a651d20ff2bab5ec0d0f8d0a14cc6cef3ef51/src/pypoisson.pyx
5
+
3
6
cimport numpy as np
4
7
import numpy as np
5
8
from libcpp.vector cimport vector
@@ -17,9 +20,9 @@ cdef extern from "../Src/PoissonReconLib.h":
17
20
18
21
def poisson_reconstruction (points , normals ,
19
22
depth = 8 , full_depth = 5 , scale = 1.1 ,
20
- samples_per_node = 1.0 , cg_depth = 0.0 ,
23
+ samples_per_node = 1.0 ,
21
24
enable_polygon_mesh = False , enable_density = False ,
22
- nthreads = 0 , verbose = False ):
25
+ nthreads = 8 , verbose = False ):
23
26
24
27
"""
25
28
Python Binding of Poisson Surface Reconstruction
@@ -64,12 +67,6 @@ def poisson_reconstruction(points, normals,
64
67
For more noisy samples, larger values in the range [15.0 - 20.0] may be needed to provide a smoother, noise-reduced, reconstruction.
65
68
The default value is 1.0.
66
69
67
- cg_depth: Integer
68
-
69
- This integer is the depth up to which a conjugate-gradients solver will be used to solve the linear system.
70
- Beyond this depth Gauss-Seidel relaxation will be used.
71
- The default value for this parameter is 0.
72
-
73
70
enable_polygon_mesh: Bool
74
71
Enabling this flag tells the reconstructor to output a polygon mesh (rather than triangulating the results of Marching Cubes).
75
72
The default value for this parameter is False.
@@ -79,7 +76,8 @@ def poisson_reconstruction(points, normals,
79
76
The default value for this parameter is False.
80
77
81
78
nthreads: int
82
- Number of omp threads to use. Default = 0 = all available threads.
79
+ This parameter specifies the number of threads across which the solver should be parallelized.
80
+ The default value for this parameter is 8.
83
81
84
82
verbose: Bool
85
83
Enable verbose mode.
@@ -104,7 +102,7 @@ def poisson_reconstruction(points, normals,
104
102
return _poisson_reconstruction(np.ascontiguousarray(np.float64(points)),
105
103
np.ascontiguousarray(np.float64(normals)),
106
104
depth, full_depth, scale, samples_per_node,
107
- cg_depth, enable_polygon_mesh, enable_density,
105
+ enable_polygon_mesh, enable_density,
108
106
nthreads, verbose)
109
107
110
108
@@ -115,7 +113,6 @@ cdef _poisson_reconstruction(np.float64_t[:, ::1] points,
115
113
int full_depth = 5 ,
116
114
double scale = 1.10 ,
117
115
double samples_per_node = 1.0 ,
118
- double cg_depth = 0.0 ,
119
116
bool enable_polygon_mesh = False ,
120
117
bool enable_density = False ,
121
118
int nthreads = 0 ,
@@ -127,7 +124,6 @@ cdef _poisson_reconstruction(np.float64_t[:, ::1] points,
127
124
string arg_full_depth = str (full_depth).encode()
128
125
string arg_scale = str (scale).encode()
129
126
string arg_samples_per_node = str (samples_per_node).encode()
130
- string arg_cg_depth = str (cg_depth).encode()
131
127
string arg_nthreads = str (nthreads).encode()
132
128
133
129
int_data.clear()
@@ -145,17 +141,16 @@ cdef _poisson_reconstruction(np.float64_t[:, ::1] points,
145
141
mem_data[j + point_ncols + i * (point_ncols + normal_ncols)] = normals[i,j]
146
142
147
143
148
- args = [b" PoissonRecon" , b" --in" , b" none" , b" --out" , b" none" , b" --depth" , arg_depth.c_str(),
149
- b" --fullDepth" , arg_full_depth.c_str(), b" --scale" , arg_scale.c_str(),
150
- b" --samplesPerNode" , arg_samples_per_node.c_str(),
151
- b" --cgDepth" , arg_cg_depth.c_str()]
144
+ args = [b" PoissonRecon" , b" --in" , b" none" , b" --out" , b" none" ,
145
+ b" --depth" , arg_depth.c_str(),
146
+ b" --fullDepth" , arg_full_depth.c_str(),
147
+ b" --scale" , arg_scale.c_str(),
148
+ b" --samplesPerNode" , arg_samples_per_node.c_str(),
149
+ b" --threads" , arg_nthreads.c_str()
150
+ ]
152
151
153
152
if verbose == True :
154
153
args += [b" --verbose" ]
155
-
156
- if nthreads > 0 :
157
- args += [b" --threads" , arg_nthreads.c_str()]
158
-
159
154
if enable_polygon_mesh:
160
155
args += [b" --polygonMesh" ]
161
156
if enable_density:
0 commit comments