Skip to content

Commit 89d0abf

Browse files
committed
hot fix for ray_mesh
1 parent de79480 commit 89d0abf

1 file changed

Lines changed: 9 additions & 46 deletions

File tree

src/ray_mesh_intersect.cpp

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <typedefs.h>
1111

1212
#include <igl/ray_mesh_intersect.h>
13+
#include <igl/matlab_format.h>
14+
#include <iostream>
1315
#include <pybind11/stl.h>
1416

1517
const char *ds_ray_mesh_intersect = R"igl_Qu8mg5v7(
@@ -44,7 +46,9 @@ npe_doc(ds_ray_mesh_intersect)
4446

4547
npe_arg(source, dense_float, dense_double)
4648
npe_arg(dir, npe_matches(source))
47-
npe_arg(v, npe_matches(source))
49+
// This does not work and seems to be a bug in numpyeigen
50+
//// npe_arg(v, npe_matches(source))
51+
npe_arg(v, dense_float, dense_double)
4852
npe_arg(f, dense_int32, dense_int64)
4953

5054

@@ -54,7 +58,10 @@ npe_begin_code()
5458
assert_valid_3d_tri_mesh(v, f);
5559

5660
std::vector<igl::Hit> hits;
57-
igl::ray_mesh_intersect(source, dir, v, f, hits);
61+
igl::ray_mesh_intersect(
62+
source.template cast<npe_Scalar_v>().eval(),
63+
dir.template cast<npe_Scalar_v>().eval(),
64+
v, f, hits);
5865
std::vector<std::tuple<int, int, float, float, float>> hits_res;
5966

6067
for(const auto &h : hits)
@@ -63,47 +70,3 @@ npe_begin_code()
6370
return hits_res;
6471

6572
npe_end_code()
66-
67-
68-
// const char* ds_ray_mesh_intersect = R"igl_Qu8mg5v7(
69-
70-
// Parameters
71-
// ----------
72-
73-
74-
// Returns
75-
// -------
76-
77-
78-
// See also
79-
// --------
80-
81-
82-
// Notes
83-
// -----
84-
// None
85-
86-
// Examples
87-
// --------
88-
89-
// Outputs:
90-
91-
// )igl_Qu8mg5v7";
92-
93-
// npe_function(ray_mesh_intersect)
94-
// npe_doc(ds_ray_mesh_intersect)
95-
96-
// npe_arg(source, dense_float, dense_double)
97-
// npe_arg(dir, dense_float, dense_double)
98-
// npe_arg(v, dense_float, dense_double)
99-
// npe_arg(f, dense_int32, dense_int64)
100-
101-
102-
// npe_begin_code()
103-
104-
// igl::Hit & hit;
105-
// igl::ray_mesh_intersect(source, dir, v, f, hit);
106-
// return npe::move(hit);
107-
108-
// npe_end_code()
109-

0 commit comments

Comments
 (0)