Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
DXF post-processing tool for laser-cutting

Hello,
when laser-cutting, I typically export a DXF file from OnShape, import it in Affinity Designer 2, and, at that point, I have to do a bunch of work to bind the individual lines and arcs output by OnShape, ideally keeping them on individual layers so that it makes it easy to hide/unhide specific parts. That's quite a bit of tedious work, especially when the design gets frequently modified.
I've worked on a Python script to help me with this:
Consider it as alpha-level - as I executed it solely against my projects at this point - so it is a small sample size, but I'm sharing it here in case it can be useful to anybody else.
Feel free to send PR.
Cheers
Comments
I'm no laser cutter expert. but So long as the coordinates are identical at intersecting points doesn't the cutter just continue about the path? This seems odd that there is an issue with Onshape dxf output. I've not had any issues with DXF when used with the sendcutsend services for laser cutting. And when looking at the files in AutoCAD everything seems to line up.
Those are recommendations from a FabLab, I'm not 100% sure what's the reason for this, maybe it is so the cutting head doesn't jump around in case the driver logic is simple, I don't know, I admit I took it as granted. Other people might chime in on the reason this is needed in the first place as I've seen other posts from people facing a similar problem/need before.
Yes I've seen it multiple times too. So something is awry. With so many ways to get something done.its hard to get to the root of the issue.. Kudos to you for sharing your solution. for others to use.
When I see vendors making requests like this it scares me away from working with them. It means their laser software is not capable of determining perimeters or loops on its own and that's step one in a list of a dozen other industry gotchas that are complete non-issues with better tools. You're likely to run into scaling issues, double cut profiles, font translation incompatibility, kerf compensation (or lack of) and spline to polyline interpretation turning your nice smooth curves into chunky arcs which don't fit other parts in your assembly if you work with this vendor and they make that sort of request.
Is FabLab a fabrication company, a software program, or something else? Google mostly suggests that FabLan is a generic term for something like a MakerSpce. Just a hobbyist here, but the inexpensive software program Lightburn hasn't had any problems cutting the DXFs that Onshape has generated for me and my CO2 laser.
Hello michael3424,
https://en.wikipedia.org/wiki/Fab_lab
The "FabLab" is a concept (launched by MIT AFAIK) to create open labs where everybody can come, learn, and use machines, from laser cutters, 3d printing machines, 3d scanners, woodworking machines, etc. The idea is not to craft commercial items, but really to share knowledge, experiment, learn, prototype, etc. Lots of students come there to build things for their projects, hobbyists come to learn and build things for themselves, entrepreneurs come to build prototypes or items they can display, etc. See it as "Open Source applied to Hardware".
At the FabLab where I go, we can use a couple of Trotec Speedy machines. As part of their operating procedure, it is recommended to join paths before submitting the jobs as there is the risk of seeing the laser head jump around to cut segments here and there vs. determining that paths are actually joined and following those paths continuously. Not sure if this is a legacy of old times or not, but this is part of the operating procedure we follow. I googled some and found similar instructions made at various "public" labs, such as this one as an example (item 5).
Now, if your software/environment/laser-cutting device doesn't require this joining, that's great!
HTH. Cheers
Something else to be mindful of when working with 2d cutting systems and DXF file:.
Version of DXF can matter a lot. For my personal machine (60"x120" CNC plasma table) which uses a CandCNC controller driven by Mach3, I do the programming in SheetCAM TNC. SheetCAM won't process newer DXF file formats so my default output for DXF generation is to use the 2010 format. Even doing that I still have to do a little post-processing in SheetCAM to move lines to different layers, typically I use one layer called INNER and one called OUTER depending on if it's an internal (pocket) or external (outer profile) cut.
You may also try out toggling the different options in the DXF export dialog ("Export splines as polylines" and "Set z-height to zero and normals to positive") to see if that mitigates some of the need for post-processing.