We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c605ea commit 2cf40c9Copy full SHA for 2cf40c9
1 file changed
src/polyhedron.jl
@@ -14,6 +14,7 @@ function pip_query(
14
n, m = size(points)
15
n == 3 || error("points must be a 3xN array")
16
m >= 1 || error("at least 1 points are required")
17
+ (nsamples > 0 && isodd(nsamples)) || error("nsamples must be a positive odd integer")
18
py_points = np.array(points')
19
20
# query by using open3d
@@ -28,6 +29,8 @@ function pip_query(
28
29
scene = o3d.t.geometry.RaycastingScene(device=_dev)
30
_ = scene.add_triangles(mesh_t)
31
pts_t = o3d.core.Tensor(py_points.astype(np.float32), device=_dev)
32
+
33
+ println("\e[1;36m[start]:\e[0m querying points inside the STL model")
34
occ = scene.compute_occupancy(pts_t, nsamples=nsamples)
35
tmp = occ.numpy().astype(pybuiltins.bool)
36
0 commit comments