bellockk / alphashape

Toolbox for constructing alpha shapes.
MIT License
258 stars 28 forks source link

shapes (3,3) and (0,) not aligned: 3 (dim 1) != 0 (dim 0) crash and how to solve this? #33

Open zhongmingshen opened 2 years ago

zhongmingshen commented 2 years ago

Description

I have those dots that need to convert to a 3D volume using this code But I found that there was something wrong with the compiled period after I entered it.

What I Did

points_3d = [
    (57, 11, 18), (51.22318624, 7.595082359,
                   18.96144895), (63.90307229, 0.612714382, 18.92441008),
    (54.04337196, 13.09810222, -36.37036356), (74.99878683, -66.99592395, 22.63615156)
]

alphashape.alphashape(points_3d, lambda ind, r: 1.0 + any(
    np.array(points_3d)[ind][:, 0] == 0.0)).show()

the crash is this

line 22, in <module>
    np.array(points_3d)[ind][:, 0] == 0.0)).show()
  File "C:\Python310\lib\site-packages\trimesh\base.py", line 2644, in show
    return scene.show(**kwargs)
  File "C:\Python310\lib\site-packages\trimesh\scene\scene.py", line 1091, in show
    return SceneViewer(self, **kwargs)
  File "C:\Python310\lib\site-packages\trimesh\viewer\windowed.py", line 103, in __init__
    self._initial_camera_transform = scene.camera_transform.copy()
  File "C:\Python310\lib\site-packages\trimesh\scene\scene.py", line 598, in camera_transform
    return self.graph[self.camera.name][0]
  File "C:\Python310\lib\site-packages\trimesh\scene\scene.py", line 655, in camera
    return self.set_camera()
  File "C:\Python310\lib\site-packages\trimesh\scene\scene.py", line 569, in set_camera
    transform = cameras.look_at(
  File "C:\Python310\lib\site-packages\trimesh\scene\cameras.py", line 329, in look_at
    points_c = rinv.dot(points.T).T
ValueError: shapes (3,3) and (0,) not aligned: 3 (dim 1) != 0 (dim 0)

What I Expected

I want to connect those dots to a 3D volume like those images. 31284722681732d55ad58d39409ed7b 2a48aaf2741b1defec60be5ba49ca0e

Acceptance Criteria