Pymeshfix Error while trying to repair a stl file

721 views Asked by At

If i try to repair an input stl file (https://www.file-upload.net/download-14916065/waxup_slm_cad.stl.html) with the library pymeshfix (https://github.com/pyvista/pymeshfix), the following error will follow:

Windows fatal exception: access violation


Main thread:
Current thread 0x000031d4 (most recent call first):
  File "C:\Developer\WPy64-3950\python-3.9.5.amd64\lib\site-packages\pymeshfix\meshfix.py", line 207 in repair
  File "C:\Users\Marcel\Desktop\untitled5.py", line 84 in <module>
  File "C:\Developer\WPy64-3950\python-3.9.5.amd64\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 465 in exec_code
  File "C:\Developer\WPy64-3950\python-3.9.5.amd64\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 585 in runfile
  File "C:\Users\Marcel\AppData\Local\Temp\ipykernel_6628\358323758.py", line 1 in <module>


Restarting kernel...

Maybe somebody knows how to fix it or some other way to repair a broken mesh within python. This is my code and the error appears always with the command "meshfix.repair()":

import pymeshfix
import trimesh

model = trimesh.load("waxup_slm_cad.stl")

# Create object from vertex and face arrays
meshfix = pymeshfix.MeshFix(model.vertices, model.faces)

# Repair the mesh
meshfix.repair()

# rewrite the model
model_repair = trimesh.Trimesh(vertices=meshfix.v, faces=meshfix.f)

I got the following pyvista Report "pyvista.Report()" (maybe this is helpful):

--------------------------------------------------------------------------------
  Date: Fri Apr 29 11:42:40 2022 Mitteleuropäische Sommerzeit

                OS : Windows
            CPU(s) : 8
           Machine : AMD64
      Architecture : 64bit
               RAM : 31.7 GiB
       Environment : IPython
       File system : unknown
        GPU Vendor : Intel
      GPU Renderer : Intel(R) Iris(R) Xe Graphics
       GPU Version : 4.5.0 - Build 30.0.100.9955

  Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit
  (AMD64)]

           pyvista : 0.33.3
               vtk : 9.1.0
             numpy : 1.21.0
           imageio : 2.9.0
           appdirs : 1.4.4
            scooby : 0.5.11
        matplotlib : 3.4.2
             PyQt5 : 5.15.4
           IPython : 7.25.0
          colorcet : 1.0.0
             scipy : 1.7.0
              tqdm : 4.61.1

  Intel(R) Math Kernel Library Version 2020.0.4 Product Build 20200917 for
  Intel(R) 64 architecture applications
--------------------------------------------------------------------------------
0

There are 0 answers