jmplonka / InventorLoader

Workbench for FreeCAD to loads or import Autodesk (R) Inventor (R) files.
GNU General Public License v2.0
119 stars 17 forks source link

Maximum recursion depth exceeded in cmp in build() #13

Closed markol closed 6 years ago

markol commented 6 years ago

Problem occurs with some specific files (sample test.zip enclosed). Setting recursion limit does not help, fast temporary fix is possible by adding counter variables to break recursion, like:

maxRecursion = 500
...
global counter
    if (self.type == 'ref' and counter < maxRecursion):

  File "~/.FreeCAD/Mod/InventorLoader/Acis.py", line 2857, in build
    self.shape = self.surface.build()
  File "~/.FreeCAD/Mod/InventorLoader/Acis.py", line 2857, in build
    self.shape = self.surface.build()
  File "~/.FreeCAD/Mod/InventorLoader/Acis.py", line 2857, in build
    self.shape = self.surface.build()
  File "~/.FreeCAD/Mod/InventorLoader/Acis.py", line 2857, in build
    self.shape = self.surface.build()
  File "~/.FreeCAD/Mod/InventorLoader/Acis.py", line 2857, in build
    self.shape = self.surface.build()<type 'exceptions.RuntimeError'>: maximum recursion depth exceeded in cmp```
jmplonka commented 6 years ago

Hi! Thank you for sharing the sample file. The sat files contains references to subtypes. Currently there is a bug in building up the ref-table. So that sometimes there can be endless loops. I'm working on it but can't find a correct implementation. As a workaround I will simple try to detect and break these "self-references". -Jens

markol commented 6 years ago

I agree that more investigation is needed for that case. Any workaround I have tried, results in surface being omitted in imported solid.

jmplonka commented 6 years ago

The omitted surfaces should now be fixed.

jmplonka commented 6 years ago

Closed: issue fixed, whereas the subtype table for surfaces is nevertheless incomplete.