I am working on a project in which I have to convert a .dae file to .stl file. I am using the code given below
import sys
sys.path.insert(0, "C:\\Program Files (x86)\\FreeCAD 0.17\\bin\\")
import FreeCAD
import Part
import Mesh
shape = Part.Shape()
shape.read('INPUTFILE.dae')
doc = App.newDocument('Doc')
pf = doc.addObject("Part::Feature","MyShape")
pf.Shape = shape
Mesh.export([pf], 'OUTPUTFILE.stl')
I get an error when the interpreter tries to execute the command shape.read('INPUTFILE.dae'). According to this the code should be able to handle .dae input files. The error I get is concerning invalid input file format:
shape.read('INPUTFILE.dae')
FreeCADError: {'swhat': 'Unknown extension', 'sfunction': '', 'btranslatable': False, 'sfile': '', 'sclassname': 'class Base::Exception', 'breported': True, 'sErrMsg': 'Unknown extension', 'iline': 0}
I also have pycollada installed on the system.
Does anyone know how to tackle this problem?