step to stl converter
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
step to stl converter
hey guys,
im using freecad to translate my files from solid edge to blender.
i design everything in solid edge and i need to get the assembly files into blender as individual parts. im using blender as a rendering software, so i need individual parts so i can texture each component without having to select the mesh of each part.
solid edge kinda sucks. i can not batch export individual .stl files from my assembly easily. ( ive used solidworks for years and did everything i needed it to.)
so currently, i export from solid edge as a .step file (1 step file and all individual component parts are preserved within the step file.)
i then open that up in freecad and i can easily select and export individual parts to stl files.
this is still very long and laborious as sometimes i have parts with 200 screws and 50 component parts
is there a way to open the step file in freecad and then with a macro save out each part as an individual .stl file?
is it easy to create? im relatively new to developing. but will definitely give it a go, seeing as im going to have to do this at least 3 times a week.
thanks very much
im using freecad to translate my files from solid edge to blender.
i design everything in solid edge and i need to get the assembly files into blender as individual parts. im using blender as a rendering software, so i need individual parts so i can texture each component without having to select the mesh of each part.
solid edge kinda sucks. i can not batch export individual .stl files from my assembly easily. ( ive used solidworks for years and did everything i needed it to.)
so currently, i export from solid edge as a .step file (1 step file and all individual component parts are preserved within the step file.)
i then open that up in freecad and i can easily select and export individual parts to stl files.
this is still very long and laborious as sometimes i have parts with 200 screws and 50 component parts
is there a way to open the step file in freecad and then with a macro save out each part as an individual .stl file?
is it easy to create? im relatively new to developing. but will definitely give it a go, seeing as im going to have to do this at least 3 times a week.
thanks very much
Re: step to stl converter
You can write a Python script to automate this:
This code is not really tested but it should work this way more or less.
Code: Select all
from PySide import QtCore
import Part, Mesh
d=QtCore.QDir("Directory_to_step_files")
d.setNameFilters(["*.step", "*.stp"])
files = d.entryInfoList()
for i in files:
shape = Part.Shape()
shape.read(i.absoluteFilePath())
mesh = Mesh.Mesh()
mesh.addFacets(shape.tessellate(0.01))
mesh.write(i.absolutePath()+"/"+i.baseName()+".stl")
Re: step to stl converter
hey thanks for doing this for me.
im really showing how much of a noob i am. can you show me how to use it please.
i changed my directory to step files and nothing happened. what else do i need to change?
im really showing how much of a noob i am. can you show me how to use it please.
i changed my directory to step files and nothing happened. what else do i need to change?
Re: step to stl converter
Hello jenosik,
And in theory that should be it! I just tested with a bunch of primitives I created in FreeCAD all with the same placement and sharing the same space, and once I separated by loose parts they were considered as separate mesh objects.
One thing that I don't understand though, is that the obj produced by FreeCAD looses its placement once imported in Blender, it looks like everything is rotated 90 degrees along the X axis.
Last time I had to produce a quick render, I found a free online rendering app that can import multiple file format, including CAD formats. I don't recall its name ATM, if you're interested to check it out, I'll find the link at work.
Funny, I too use Solid Edge at work, and I've thought of doing the same. We have an almost 10-year old version of SE, and since migrating from XP to Seven I can't get Virtual Studio to work anymore. But I can't get enough time off to learn Blender, that beast is so totally different to what I'm used to.jenosik wrote:im using freecad to translate my files from solid edge to blender.
i design everything in solid edge and i need to get the assembly files into blender as individual parts. im using blender as a rendering software
Uh, I do not totally agree. Sure it sucks in a few areas, but as for general modeling I much prefer its workflow to SolidWorks! The problem with SE is that its core market is the machinery industry, so most everything is geared toward that. This is why rendering used to suck (Solid Edge now comes with Luxion KeyShot, a pretty sweet rendering package I shortly used in a previous job), and why surface tools are so lacking compared to SW...jenosik wrote:solid edge kinda sucks.
May I suggest trying a different method? STL is a very limited mesh format designed for rapid prototyping of single parts. Instead I suggest exporting your STEP assembly file from FreeCAD to .obj, which can contain multiple closed mesh objects. Then import the .obj in Blender. It will import as a single object, but you can separate it "by loose parts" see http://blender.stackexchange.com/questi ... -closed-gejenosik wrote:so currently, i export from solid edge as a .step file (1 step file and all individual component parts are preserved within the step file.)
i then open that up in freecad and i can easily select and export individual parts to stl files.
this is still very long and laborious as sometimes i have parts with 200 screws and 50 component parts
And in theory that should be it! I just tested with a bunch of primitives I created in FreeCAD all with the same placement and sharing the same space, and once I separated by loose parts they were considered as separate mesh objects.
One thing that I don't understand though, is that the obj produced by FreeCAD looses its placement once imported in Blender, it looks like everything is rotated 90 degrees along the X axis.
Last time I had to produce a quick render, I found a free online rendering app that can import multiple file format, including CAD formats. I don't recall its name ATM, if you're interested to check it out, I'll find the link at work.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: step to stl converter
NormandC wrote: May I suggest trying a different method? STL is a very limited mesh format designed for rapid prototyping of single parts. Instead I suggest exporting your STEP assembly file from FreeCAD to .obj, which can contain multiple closed mesh objects. Then import the .obj in Blender.
I have done some work for colored export of obj files and reuse it in other viewers.
And in theory that should be it! I just tested with a bunch of primitives I created in FreeCAD all with the same placement and sharing the same space, and once I separated by loose parts they were considered as separate mesh objects.
https://www.youtube.com/watch?v=Vz2sRNQ5wjI
https://github.com/microelly2/freecad-export
You can export sinlge parts but the complete assembly too.
My idea was to wirte an exporter to WebGL too. There is already a method to export monochrom webgl objects,
and its not to difficult to do it with colors too.
WebGL has the benefit that you can publish your model in the web.
However, for realistic texture work Blender is the best.
There are two parameters left bottom in the import dialog where you can define the directions
One thing that I don't understand though, is that the obj produced by FreeCAD looses its placement once imported in Blender, it looks like everything is rotated 90 degrees along the X axis.
Re: step to stl converter
BRILLIANT!!!! thankyou very much!!! .obj worked PERFECTLY that is exactly what i need thankyou very much for your input. much appreciated.
that changes the game!!!
Normandc
im biast to solidworks for sure!! i actually dont hate solid edge. i just wish i knew solid edge as well as i do solidworks. im only 2 months into solidedge and i can scrape by.
i really like the synchronous modelling in solid edge......... as long as nothing unusual comes up. and i do find myself shouting at the screen "why are you doing that???".
Im really enjoying learning blender. i learnt 3d studio max years ago at university used it for rendering and animations
https://youtu.be/yDRg2Z1FTSI
but blender is awesome. attached is what i rendered this week.
once again. thank you very much for your help separating meshes.
that changes the game!!!
Normandc
im biast to solidworks for sure!! i actually dont hate solid edge. i just wish i knew solid edge as well as i do solidworks. im only 2 months into solidedge and i can scrape by.
i really like the synchronous modelling in solid edge......... as long as nothing unusual comes up. and i do find myself shouting at the screen "why are you doing that???".
Im really enjoying learning blender. i learnt 3d studio max years ago at university used it for rendering and animations
https://youtu.be/yDRg2Z1FTSI
but blender is awesome. attached is what i rendered this week.
once again. thank you very much for your help separating meshes.
- Attachments
-
- dell tablet dock front.jpg (238.05 KiB) Viewed 15514 times
Re: step to stl converter
Hey, I'm glad it simplifies your process. I may need it too in the future!
Doh! I hadn't noticed. Thanks!microelly2 wrote:There are two parameters left bottom in the import dialog where you can define the directions
Interesting. Would these obj import in Blender with colors? Right now the export to obj seems to loose color info.microelly2 wrote:I have done some work for colored export of obj files and reuse it in other viewers.
Ah! We're using a version that predates Sync tech, I guess I may scream at my display quite a few time when we upgrade.jenosik wrote:i really like the synchronous modelling in solid edge......... as long as nothing unusual comes up. and i do find myself shouting at the screen "why are you doing that???".
Nice!jenosik wrote:attached is what i rendered this week.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: step to stl converter
Yes, may be it uses some path adjusting, but all data are written. I will check it next and will refine the workflow.NormandC wrote:Interesting. Would these obj import in Blender with colors? Right now the export to obj seems to loose color info.microelly2 wrote:I have done some work for colored export of obj files and reuse it in other viewers.
Re: step to stl converter
hey guys just a quick update.Instead I suggest exporting your STEP assembly file from FreeCAD to .obj
i tried exporting a .stl of my entire assembly into blender. it allowed me to seperate my .stl into multiple parts. using the same method as above