Skip to content

Commit 9c19f8a

Browse files
Update src/fcl/fcl.pyx
Co-authored-by: Dmitry Neverov <mail@dmitryneverov.xyz>
1 parent c5d4f1f commit 9c19f8a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/fcl/fcl.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,11 @@ cdef mat3d_to_numpy(defs.Matrix3d m):
759759
[m(1,0), m(1,1), m(1,2)],
760760
[m(2,0), m(2,1), m(2,2)]])
761761

762-
cdef defs.Matrix3d numpy_to_mat3d(np.ndarray[double, ndim=2] a):
762+
cdef defs.Matrix3d numpy_to_mat3d(arr):
763763
# NOTE Eigen defaults to column-major storage,
764764
# which corresponds to non-default Fortran mode of ordering in numpy
765-
cdef np.ndarray[double, ndim=2, mode='fortran'] f = np.ndarray.copy(a, order='F')
766-
return defs.Matrix3d(&f[0, 0])
765+
cdef double[:, :] memview = arr.astype(numpy.float64, order='F')
766+
return defs.Matrix3d(&memview[0, 0])
767767

768768
cdef c_to_python_collision_geometry(defs.const_CollisionGeometryd*geom, CollisionObject o1, CollisionObject o2):
769769
cdef CollisionGeometry o1_py_geom = <CollisionGeometry> ((<defs.CollisionObjectd*> o1.thisptr).getUserData())

0 commit comments

Comments
 (0)