Friday, May 22, 2009
Want to Slice Step files or bad STL Files?
I have produced a script that will slice STEP files. It will also handle really bad STL files, which is a nice bonus.
The script generates an svg file that is both human viewable and contains the path information for the slices. This file can be imported into skeinforge to generate the gcode.
If you have been frustrated by the "create STL-->have skeinforge/rr host puke because there are holes/etc--> fix by black magic" dance, this is the tool for you.
Is it the solution for you? You can download the tool here:
Give it a try, and let me know your thoughts! Fair warning, installation requires a few dependencies; they are documented in the install.txt file in the zip file.
As soon as I started playing with the RepRap host software and skeinforge, the first thing that I realized was that my modelling tool ( and old student version of solidworks ) creates horrible STL. Neither skeinforge nor the host would handle it my STL.
The next thing i realized is that STEP is a much better format for storing solid objects-- smaller, more accurate, etc.
I set out to make a slicing program that would handle STEP and bad STL files, and, ideally handle them very fast.
I did not want to re-invent the work Enrique has done-- what was needed was a file I could create that had only the hard part--the slicing-- and then let his tools do the rest.
Enrique and I collaborated on the slice file format. It seemed like a good idea to use a standard way to communicte 2D paths, and to provide a way for humans to understand the files contents.
Needless to say, reading STEP files and fixing bad STL is quite hard-- I needed to avoid writing this. So, I ended up getting involved in www.pythonocc.org -- a python binding to the OpenCasecade open source modelling kernel. This is really the tool for this job-- an open source full-fledged modelling kernel!
For the cost of having to install OCC, i got lots of benefits-- including a really handy, really fast viewer for 3d objects that can handle STL, STEP, and IGES!
I hope to expand the tool to provide a more interactive environment for slicing and getting objects ready to build. i would like to integrate skeinforge into the tool.
Can't wait to play around with this.
For me, parametric modelling is the killer app, and going back to sketchup or similar was a real pain. All modelling should be parametric.
Having to register to download the components, then downgrade my python version. Urgh.
I'll pass for now. I'd be interested to hear anyone else's experiences though.
Also, I'm really glad that skeinforge alternatives are popping up and that your work validates OCC as a good base to build on.
One suggestion, would you set up a public source control repository for the code? Hacking on stuff is so much easier if the code can be forked on github (or google code or wherever).
I've been working with the pythonocc guys-- my hope is to include the tool in the samples distribution for pythonocc-- that way, when you install pythonocc you get my tool.
@Gav-- try with your current version of python first-- Thomas @occ indicated that python 2.6 and probably v 3 worked.
Which components did you have to register to download? Didn't think you needed to register to get pythonocc or cheetah-- i guess OpenCascade itself?
I'll have another look in the future, but I'm a bit pressed a the moment and I can't take the time to work through the dependency chain.
I'd love to see skeinforge integrated at some point. I'm just learning what everything means right now (a lot to learn there). Since despite it's sophistication, it's usability is rather underdeveloped. I'd love to see the workflow of printing 3D models improved.
Were you able to successfully slice any models? I am anxious to hear stories of success, as one of the biggest concerns i have is 'strange problems' with complex models.
My test models are pretty simple, so though the scripts work well for those, I would love some feedback for more complex models.
(1) Do complex models work?
(2) how does slicing speed compare to skeinforge or host software speed
Integrating skeinforge should not be hard-- that's the primary reason I used python.
I'm using Ubuntu Linux (Jaunty, 9.04). OpenCascade is an installable package. But the latest version of pythonOCC didn't compile. I've tried it via SCONS and with the ordinary method "sudo python setup.py build"
Of course this software would be valuable enough to make a nice installer, including a debian/ubuntu repository to stay up to date automatically. I'm willing to offer hosting for it (for free!) on a linux box (gigabit connection online) where you can also build the package (fast hardware).
Instructions for getting it running on windows would be a good start, since the majority still uses that. I guess that that would be a bit easier.
I put instructions for installing my slicer into the module. As for installing OpenCascade and pythonOCC, the windows installers worked for me-- i used the wo-0.2 release. I found the windows installation pretty painless- there was a wizard-like installer for both OpenCascade and the pythonocc latest stable release.
Thomas @pythonocc has gotten a linux distro working. You could post to the mailing list there.
Thank yoou very much for your script.
I try the script, but it doesn´t run. The error is the next:
Traceback (most recent call last):
File "OccSliceLib.py", line 62, in
ImportError: No module named wx
Can you help me?
Had the same problem, I downloaded and installed wx from here http://www.wxpython.org/download.php#prerequisites
I also had to go back and download v2.2.1 of cheetah (the windows installer version is only 2.0b4 apparently). I unzipped the .tz file and copied the contents of "src" to C:\Python26\Lib\site-packages\Cheetah
Seems to work now but haven't tried slicing anything yet.
I was wondering how you recommend using the generated SVG files however. Is there are way to convert these slices into splines or something that can be imported back into CAD software?
Links to this post: