Convert .3ds and .dae to .stl

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
umardastgir
Posts: 32
Joined: Mon Apr 22, 2019 9:29 pm

Convert .3ds and .dae to .stl

Post by umardastgir »

Hello everyone,
I am new to FreeCAD and have been assigned the task to write a python program to convert various 3D file formats into .stl formats. I have set a python script and have already converted .obj, .step and .iges to .stl. I still need to convert .3ds and .dae formats into .stl. Can I get some guidance on hoe to convert these two formats into .stl using FreeCAD python libraries?
I am already using FreeCAD, Part and Mesh libraries.
Thanks
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Convert .3ds and .dae to .stl

Post by Jee-Bee »

If you have some scripts for .step, .iges and .obj to stl. I would say just look at what you already have.
.dae and .3ds(mesh) files can easy imported by FreeCAD
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Convert .3ds and .dae to .stl

Post by wmayer »

The file formats .3ds and .dae are supported by the Arch module.
umardastgir
Posts: 32
Joined: Mon Apr 22, 2019 9:29 pm

Re: Convert .3ds and .dae to .stl

Post by umardastgir »

Jee-Bee wrote: Tue Apr 23, 2019 5:05 am If you have some scripts for .step, .iges and .obj to stl. I would say just look at what you already have.
.dae and .3ds(mesh) files can easy imported by FreeCAD
I did try to use the existing code I had for .step, .iges and .obj to .stl but the import part gives me an error (unsupported input file format). To verify that FreeCAD supports conversion of .dae and .3ds files to .stl, I imported these file types using the GUI interface and exported them to .stl and it worked fine, so I know there definitely is a way to accomplish that, I just want to know how. Below is the code I am using for .iges to .stl conversion:

Code: Select all

Part.open("bracket.igs")
o = FreeCAD.getDocument("Unnamed").findObjects()[0]
Mesh.export([o], "bracket.stl")
Last edited by umardastgir on Tue Apr 23, 2019 3:31 pm, edited 1 time in total.
umardastgir
Posts: 32
Joined: Mon Apr 22, 2019 9:29 pm

Re: Convert .3ds and .dae to .stl

Post by umardastgir »

wmayer wrote: Tue Apr 23, 2019 7:38 am The file formats .3ds and .dae are supported by the Arch module.
Thanks for your response. How do I import the arch module and how do I proceed with file type conversion?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Convert .3ds and .dae to .stl

Post by wmayer »

Try this

Code: Select all

import3DS
importDAE
umardastgir
Posts: 32
Joined: Mon Apr 22, 2019 9:29 pm

Re: Convert .3ds and .dae to .stl

Post by umardastgir »

Thanks for the response. I have imported these two libraries in my code. However, I still don't get how to convert .daefile to stl. How do I proceed? I have opened the file using the open function provided in importDAE (returns doc). How do I proceed into making an .stl file?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Convert .3ds and .dae to .stl

Post by wmayer »

I never worked with dae or 3ds. Yorik should be able to give some details.
umardastgir
Posts: 32
Joined: Mon Apr 22, 2019 9:29 pm

Re: Convert .3ds and .dae to .stl

Post by umardastgir »

Okay. I will contact Yorik on the email address he has provided in his scripts.
Thanks
User avatar
easyw-fc
Veteran
Posts: 3630
Joined: Thu Jul 09, 2015 9:34 am

Re: Convert .3ds and .dae to .stl

Post by easyw-fc »

umardastgir wrote: Tue Apr 23, 2019 7:46 pm Okay. I will contact Yorik on the email address he has provided in his scripts.
Thanks
HI,
I remember that @wmayer helped me in an old thread
Re: Convert mesh to solid?
It was related to a conversion between wrl and step, but it used dae as an intermediate format.
I'm not sure if it could be fully functional now, but you can get some tips from the thread.
Post Reply