Skip to content

Commit fcc9005

Browse files
Fix numpy_num_face_vertices() (#408)
* Test Python + NumPy in CI * Add comments * Add more tests * Add more Python tests * assert_array_almost_equal * Try decimal=5 * Try to fix vertex test * Update a comment * Upgrade cibuildwheel * Fix toml * Match the types and call buf.release() * Rm buf.release() * Try to clear license warning on build * Fix license specifier * Move python tests out of python so they don’t end up in the wheel * Add some excludes * Reformat and exclude some python files * Update .github/workflows/python.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add a note about local numpy install * Reset a few files --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a285d14 commit fcc9005

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/bindings.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ PYBIND11_MODULE(tinyobjloader, tobj_module)
149149
.def(py::init<>())
150150
.def_readonly("num_face_vertices", &mesh_t::num_face_vertices)
151151
.def("numpy_num_face_vertices", [] (mesh_t &instance) {
152-
auto ret = py::array_t<unsigned char>(instance.num_face_vertices.size());
152+
auto ret = py::array_t<unsigned int>(instance.num_face_vertices.size());
153153
py::buffer_info buf = ret.request();
154-
memcpy(buf.ptr, instance.num_face_vertices.data(), instance.num_face_vertices.size() * sizeof(unsigned char));
154+
memcpy(buf.ptr, instance.num_face_vertices.data(), instance.num_face_vertices.size() * sizeof(unsigned int));
155155
return ret;
156156
})
157157
.def("vertex_indices", [](mesh_t &self) {

0 commit comments

Comments
 (0)