SolveSpace Logo SOLVESPACE -- parametric 2d/3d CAD
Examples
Tutorials
Features
Download
Reference
Technology
Library
Forum
Contact
USER FORUM

(you are viewing a thread; or go back to list of threads)

G-code export in practice (by Paul)
I'm looking at g-code export and have questions for people who use this feature.

First up, the exported coordinates are not the same as the sketch coordinates. A rectangle in the first quadrant having a point at the origin get approximately centered with positive and negative coordinates in the g-code.

Is there some option that prevents centering the sketch around the origin?

Is this a problem? How do you get g-code with coordinates suitable for your CNC?

I'd like to make one or two improvements to g-code for version 3.2. Primarily I want to prevent export of constraints without user intervention - you never want that stuff in g-code. I also want to output arcs, but that's going to require understanding how the offsetting stuff works in detail.

There are a few open issues covering other related things here:
https://github.com/solvespace/...%3Aissue+is%3Aopen+label%3ACAM

I feel like Solvespace could be a lot more useful for CNC users with not too much effort, so I'd like to understand what the main issues are.

BTW If you're screaming "Documentation! How do I even get g-code output?" you're not alone. File->Export 2D view, select gcode as your file type ;-)
Wed Jan 17 2024, 09:53:49
(no subject) (by Jonathan Westhues)
When you Export 2d View, the origin of the exported coordinate system for G code (and some other file formats) should be the center of the view. So you can place that wherever you want by choosing a point and then View -> Center View at Point. That's not super discoverable, though you do a get a message noting the exported origin afterward. That message could perhaps be expanded to better explain.

In general, G code is just treated like any other vector export file format. That obviously gets ridiculous in some cases (like those constraints), and could definitely be improved.

The offsetting could be expanded to handle exact arcs pretty easily, since the offset curve of an arc is also an arc, with the same center and different radius. That's not true for Beziers so they're trickier, but many G code interpreters don't support them anyways. So you could just start by approximating all Beziers as piecewise arcs, in the same way that BezierAsNonrationalCubic() approximates as nonrational cubics for certain file formats already.
Thu Jan 18 2024, 03:25:38
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):
© 2008-2022 SolveSpace contributors. Most recent update June 2 2022.