Cpython crash

Running this script from with ScriptEditor with a seleceted simple mesh crashes rhino silently

remeshing.py (1.4 KB)

This crash is on this line after a long time of processing this call even on a small mesh:

m = pymeshlab.Mesh(verts, faces)

I Although I also do not see an error thrown.

It works on a normal python shell, though.

@Social_Spherene

This is definitely a crash inside pymeshlab. Whats the python version you are using in normal shell? I installed pymeshlabin both 3.9 and 3.11 and can’t get this example script from meshlab to work.

Would you mind sharing your example?

import numpy
import pymeshlab

# create a numpy 8x3 array of vertices
# columns are the coordinates (x, y, z)
# every row represents a vertex
verts = numpy.array([
    [-0.5, -0.5, -0.5],
    [0.5, -0.5, -0.5],
    [-0.5, 0.5, -0.5],
    [0.5, 0.5, -0.5],
    [-0.5, -0.5, 0.5],
    [0.5, -0.5, 0.5],
    [-0.5, 0.5, 0.5],
    [0.5, 0.5, 0.5]])

# create a numpy 12x3 array of faces
# every row represents a face (triangle in this case)
# for every triangle, the index of the vertex
# in the vertex array
faces = numpy.array([
    [2, 1, 0],
    [1, 2, 3],
    [4, 2, 0],
    [2, 4, 6],
    [1, 4, 0],
    [4, 1, 5],
    [6, 5, 7],
    [5, 6, 4],
    [3, 6, 7],
    [6, 3, 2],
    [5, 3, 7],
    [3, 5, 1]])

# create a new Mesh with the two arrays
m = pymeshlab.Mesh(verts, faces)

print(m)

Ok your script worked fine for me on python311 it seems that pymeshlab on python39 has a problem.

1 Like