Translate imported gcode?

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
sliptonic
Posts: 1753
Joined: Tue Oct 25, 2011 10:46 pm

Re: Translate imported gcode?

Post by sliptonic » Sun Mar 22, 2020 2:34 pm

The visual feedback is still there. The advantage of using a new offset placement property rather than the view provider object placement is that it avoids the duplicate path problem at the cost that you can't use the transform drag tool.
etrombly wrote:
Sun Mar 22, 2020 1:10 pm
Do you know why the placement isn't used anywhere in the path workbench(well other than updating the viewport)? It seems a little inconsistent with the way the other workbenches operate.
View Provider placements in FreeCAD are in the global coordinate system. Gcode however, exists (and needs to exist) within the coordinate system of the Job. Everywhere else in Path, we overcome the problem by creating copies of the base objects, translating them into the coordinate system of the job, and generating gcode from them rather than the 'real' part. This lets you, for example, lay out multiple parts to be cut from one sheet.

But when it comes to imported gcode, there is no base object to copy/translate. The only thing we have to work with are the raw gcode commands that were imported.
edit: this is a little off topic, but I've noticed that the gcode parsing is done in several different places. Would it make sense while I'm working on this to consolidate it? I was thinking of making a gcode object and having a fromStr, toStr, toPath function, etc. That way it should be a little more consistent.
Check out the Path Scripting page. The Path and Command objects should have what you're talking about.
https://wiki.freecadweb.org/Path_scripting
etrombly
Posts: 80
Joined: Thu Dec 05, 2019 6:50 pm

Re: Translate imported gcode?

Post by etrombly » Sun Mar 22, 2020 3:42 pm

Thanks, that actually helped a lot. I'll try to wrap this up soon and send a pull request.
User avatar
sliptonic
Posts: 1753
Joined: Tue Oct 25, 2011 10:46 pm

Re: Translate imported gcode?

Post by sliptonic » Sun Mar 22, 2020 4:13 pm

etrombly wrote:
Sun Mar 22, 2020 3:42 pm
Thanks, that actually helped a lot. I'll try to wrap this up soon and send a pull request.
No problem. Thanks for working on this. Reminder that there's the Gitter Path room if you want to chat realtime. Strangely, I'm finding I have a lot of time on my hands these days :D
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Wsk8 and 3 guests