Skip to content

AxisError: axis 1 is out of bounds for array of dimension 1 #35

@sugizo

Description

@sugizo

env
google colab

steps

pip install -U pymartini trimesh
!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 trimesh

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)
mesh = trimesh.Trimesh(vertices = vertices,
                       faces = triangles,
                       process = False)
mesh.export(f'{file_name}_trimesh.stl')

result

AxisError                                 Traceback (most recent call last)
[<ipython-input-12-8a314949ac13>](https://localhost:8080/#) in <cell line: 14>()
     12                        faces = triangles,
     13                        process = False)
---> 14 mesh.export(f'{file_name}_trimesh.stl')

7 frames
[/usr/local/lib/python3.10/dist-packages/numpy/lib/function_base.py](https://localhost:8080/#) in diff(a, n, axis, prepend, append)
   1417     if nd == 0:
   1418         raise ValueError("diff requires input that is at least one dimensional")
-> 1419     axis = normalize_axis_index(axis, nd)
   1420 
   1421     combined = []

AxisError: axis 1 is out of bounds for array of dimension 1

n.b.
the same steps work fine with pydelatin

best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions