Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __init__(): incompatible constructor arguments. The following argument types are supported #33

Open
sugizo opened this issue May 22, 2024 · 0 comments

Comments

@sugizo
Copy link

sugizo commented May 22, 2024

env
google colab

steps

pip install -U pymartini pymeshlab
!wget -c https://raw.githubusercontent.com/kylebarron/pymartini/master/test/data/fuji.png

code

import imageio.v2 as imageio
from pymartini import decode_ele, Martini, rescale_positions
import pymeshlab

path = './fuji.png'
fuji = imageio.imread(path)
terrain = decode_ele(fuji, 'mapbox')
martini = Martini(fuji.shape[0] + 1)
tile = martini.create_tile(terrain)
vertices, triangles = tile.get_mesh(10)
m = pymeshlab.Mesh(vertices, triangles)
ms = pymeshlab.MeshSet()
ms.add_mesh(m)
ms.save_current_mesh(f'{file_name}_pymeshlab.stl')

result

TypeError                                 Traceback (most recent call last)
[<ipython-input-11-7c37458cfb79>](https://localhost:8080/#) in <cell line: 11>()
      9 tile = martini.create_tile(terrain)
     10 vertices, triangles = tile.get_mesh(10)
---> 11 m = pymeshlab.Mesh(vertices, triangles)
     12 ms = pymeshlab.MeshSet()
     13 ms.add_mesh(m)

TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
    1. pymeshlab.pmeshlab.Mesh(vertex_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), face_matrix: numpy.ndarray[numpy.int32[m, 3]] = array([], shape=(0, 3), dtype=int32), edge_matrix: numpy.ndarray[numpy.int32[m, 2]] = array([], shape=(0, 2), dtype=int32), v_normals_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), f_normals_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), v_scalar_array: numpy.ndarray[numpy.float64[m, 1]] = array([], dtype=float64), f_scalar_array: numpy.ndarray[numpy.float64[m, 1]] = array([], dtype=float64), v_color_matrix: numpy.ndarray[numpy.float64[m, 4]] = array([], shape=(0, 4), dtype=float64), f_color_matrix: numpy.ndarray[numpy.float64[m, 4]] = array([], shape=(0, 4), dtype=float64), v_tex_coords_matrix: numpy.ndarray[numpy.float64[m, 2]] = array([], shape=(0, 2), dtype=float64), w_tex_coords_matrix: numpy.ndarray[numpy.float64[m, 2]] = array([], shape=(0, 2), dtype=float64))
    2. pymeshlab.pmeshlab.Mesh(vertex_matrix: numpy.ndarray[numpy.float64[m, 3]], face_list_of_indices: List[numpy.ndarray[numpy.uint32[m, 1]]], v_normals_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), f_normals_matrix: numpy.ndarray[numpy.float64[m, 3]] = array([], shape=(0, 3), dtype=float64), v_scalar_array: numpy.ndarray[numpy.float64[m, 1]] = array([], dtype=float64), f_scalar_array: numpy.ndarray[numpy.float64[m, 1]] = array([], dtype=float64), v_color_matrix: numpy.ndarray[numpy.float64[m, 4]] = array([], shape=(0, 4), dtype=float64), f_color_matrix: numpy.ndarray[numpy.float64[m, 4]] = array([], shape=(0, 4), dtype=float64), v_tex_coords_matrix: numpy.ndarray[numpy.float64[m, 2]] = array([], shape=(0, 2), dtype=float64))

Invoked with: array([308, 100, 304, ..., 294,  98, 292], dtype=uint16), array([    0,     1,     2, ..., 44963, 45051, 45071], dtype=uint32)

n.b.
the same steps work fine with pydelatin

best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant