chrisdevito / OBB

Oriented Bounding Boxes in Maya.
ISC License
54 stars 18 forks source link

build_from_hull TypeError: only integer scalar arrays can be converted to a scalar index #3

Open chadmv opened 1 year ago

chadmv commented 1 year ago

I was getting the following error when creating from a hull:

api.py", line 328, in build_from_hull
# #     vertices = npPointList[indices]
# # TypeError: only integer scalar arrays can be converted to a scalar index

It can be fixed by used an np.array instead of regular Python list:

        npPointList = np.array([
            [self.points[i].x, self.points[i].y, self.points[i].z]
            for i in range(self.points.length())
        ])