Export contour in gcode

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
AdyV94
Posts: 2
Joined: Sat Jun 11, 2022 9:20 am

Export contour in gcode

Post by AdyV94 »

I want to export a contour to gcode, with I and J in absolute coordinates. And I don't succeed :( Can someone explain to me how to do it? I also leave an example of how I would need gcode (test-Sketch.nc) generated with dxf2gcode.
Image
Attachments
freecad.7z
(5.82 KiB) Downloaded 23 times
Last edited by AdyV94 on Mon Jun 13, 2022 10:40 am, edited 1 time in total.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Export contour in gcode

Post by Kunda1 »

Moved to the Path/CAM subforum

Path_Walkthrough_for_the_Impatient
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
chrisb
Veteran
Posts: 54177
Joined: Tue Mar 17, 2015 9:14 am

Re: Export contour in gcode

Post by chrisb »

AdyV94 wrote: Sat Jun 11, 2022 9:26 am I want to export a contour to gcode, with I and J in absolute coordinates. And I don't succeed :( Can someone explain to me how to do it? I also leave an example of how I would need gcode (test-Sketch.nc) generated with dxf2gcode.
The predecessor of the philips postprocessor could create such paths, using 'K' parameter instead of 'J'. It isn't well maintained, I just commented some lines out which lead to an error, but it may be a basis for what you need. It had lots of parameters which then could not be set as arguments, but had to be changed at the top of the file.

Important are here
USE_RADIUS_IF_POSSIBLE which I have set to False and possibly
ABSOLUTE_CIRCLE_CENTER, which I have set to true.

The output resembles what you expect (header removed manually):

Code: Select all

N7 G54 
N8 G0 Y6.000 
N9 (TC: Default Tool) 
N10 M66 T1 
N11 ()
N12 (Engrave) 
N13 G0    
N14       
N15 X-39.718 Z24.318    
N16 Y4.000    
N17 G1       Y-5.000    
N18 X25.815 Z32.123       
N19 X52.204 Z0.761       
N20 G3 X20.083 Z-43.440    R28.146    
N21 G1 X-39.617 Z-19.211       
N22    Z24.318       
N23 G0 Y6.000 
N24 M30
Attachments
generic_post.py
(25.27 KiB) Downloaded 23 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sliptonic
Veteran
Posts: 3459
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Export contour in gcode

Post by sliptonic »

Sorry. I made an error as moderator and edited the first post instead of replying with quote. :oops:
I reverted what I could but may have lost part of the original post.

I was trying to ask OP about the reason for wanting absolute arc centers. To my knowledge, the request hasn't come up before and I don't see an advantage. I'm just curious about the use-case.
dtay
Posts: 20
Joined: Fri Jan 17, 2020 12:52 pm

Re: Export contour in gcode

Post by dtay »

Hi,

It makes comparing g-code to a blueprint less painful. Sinumerik example:
ABS_ARC_CENTER.JPG
ABS_ARC_CENTER.JPG (57.45 KiB) Viewed 1090 times
AdyV94
Posts: 2
Joined: Sat Jun 11, 2022 9:20 am

Re: Export contour in gcode

Post by AdyV94 »

sliptonic wrote: Sun Jun 12, 2022 2:17 pm Sorry. I made an error as moderator and edited the first post instead of replying with quote. :oops:
I reverted what I could but may have lost part of the original post.

I was trying to ask OP about the reason for wanting absolute arc centers. To my knowledge, the request hasn't come up before and I don't see an advantage. I'm just curious about the use-case.
It is a Wire EDM from 1996 and it doesn't know much relative coordinates, the whole program goes on absolute coordinates, at x and y it knows some relative coordinates but it automatically converts them to absolute. For i and j it's a hassle, only absolute coordinates work. So basically I would just need an outline with absolute coordinates including i and j.
Post Reply