I am working on a project to convert various file formats to .stl. I have succeeded converting .step, .igs, .dae and .obj file to .stl. Whenever I try to convert .3ds file to .stl, I get the following error:
Traceback (most recent call last): File "3DFileFormatConversion.py", line 141, in import3DS.open(INPUT) File "/usr/share/freecad/Mod/Arch/import3DS.py", line 59, in open read(filename) File "/usr/share/freecad/Mod/Arch/import3DS.py", line 92, in read for j,d_nobj in enumerate(dom.mdata.objects):
AttributeError: 'UnknownChunk' object has no attribute 'mdata'
The code I am using for this conversion is as follows:
import import3DS
import3DS.open(INPUT)
App.setActiveDocument(INPUTFILE)
App.ActiveDocument=App.getDocument(INPUTFILE)
__objs__=[]
for mesh in FreeCAD.getDocument(INPUTFILE).Objects:
__objs__.append(mesh)
Mesh.export(__objs__,OUTPUT)
del __objs__
I get an error in the import3Ds.open(INPUT) command, where INPUT is the input file name. The weird part is that this code executes completely fine on a Windows platform. However, when I tried running it on Ubuntu 18.04, it gives me the above mentioned error. Can someone point whats going on here?
Code reference for import3DS library can be found here