0

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
--------------------------------------------------------------------------------
273K
  • 29,503
  • 10
  • 41
  • 64
marxcell
  • 69
  • 6
  • 1
    I was about to suggest that you open an issue on github, then I saw [you already have](https://github.com/pyvista/pymeshfix/issues/41). I've never used pymeshfix before, but I'm not the only pyvista person on Stack Overflow :) In the meantime, have you tried running the same code outside Spyder, using vanilla python? Does it give the same error? And is the dataset very large, can there be a memory issue? (I haven't had time to download your mesh yet.) – Andras Deak -- Слава Україні Apr 30 '22 at 09:33
  • 1
    Thank you for your answer. I never tried to execute the code outside spyder, i can give this a try. The file is about 10MB and has about 100.000 vertices. So it is quite big yes, but normally i should have enough memory. – marxcell May 05 '22 at 14:44
  • 1
    So i tested it also outside python, using different environments and it always gives me the same error. Do you maybe know some alternative way to repair some mesh within python? – marxcell May 09 '22 at 07:36
  • 1
    I don't even know _this_ way to repair some mesh :) I'll try to run your code and see if I can reproduce it on linux, then go from there. – Andras Deak -- Слава Україні May 09 '22 at 07:50
  • Now you know there is theoretically a way :). Thank you for your interest in helping me! – marxcell May 09 '22 at 15:55

0 Answers0