Splines to Gcode from dxf file

More
08 Jan 2022 23:02 - 08 Jan 2022 23:08 #231190 by Matt Hat
Finally I can show some G5 code that actually runs in linuxCNC. Against my previous posts, the parameters I,J,P, Q are indeed given relatively to the start and end points. This should give a circle of Radius 10 mm:
G0 X10 G5 X0.000 Y10.000 I0.000 J5.200 P5.200 Q0.000
G5 X-10.000 Y0.000 I-5.200 J0.000 P0.000 Q5.200
G5 X0.000 Y-10.000 I0.000 J-5.200 P-5.200 Q0.000
G5 X10.000 Y0.000 I5.200 J0.000 P0.000 Q-5.200
and this an ellipse of size 20x10 mm:
G0 X10 G5 X0.000 Y5.000 I0.000 J2.600 P5.200 Q0.000
G5 X-10.000 Y0.000 I-5.200 J0.000 P0.000 Q2.600
G5 X0.000 Y-5.000 I0.000 J-2.600 P-5.200 Q0.000
G5 X10.000 Y0.000 I5.200 J0.000 P0.000 Q-2.600

Details on github with some reorganization of the files.
github.com/Matttab/spline-examples/tree/main/linuxCNCsplineTest
Last edit: 08 Jan 2022 23:08 by Matt Hat.

Please Log in or Create an account to join the conversation.

More
09 Jan 2022 00:19 - 09 Jan 2022 00:21 #231202 by robertspark
if you have a spline in a DXF file there are normally a few options to change it to a simple entity (polyline) which is recognisable by post processing software.

I normally use "splineedit" if I am using AutoCAD / bricscad and only dealing with 1 spline, and convert it to a polyline entity, with a high curve fit number ( but you will end up with a lot of entities / segments).

option 2 if I have more than 1 spline..... I create a new linetype called "splines" or whatever and make it my current layer.  I then use "qselect" to select all spline entities and place them on their own layer I just created.  I then turn off all layers except the one I am working on via "-la" , "*", "off" 

I then used "pedit" (polyline edit) and "m" (multiple) and then select all the splines with a mouse sweep of the screen followed by selecting "splines to polylines" and again give it a high precision, and then save the file as a DXF for sheetcam / estlcam to post process to gcode.

I have also read that you can save the DXF as an old r12 DXF file format and it will do a similar thing as r12 DXF does not recognise splines and will convert them to polylines..... although I've just read this and not tried it out.

3d splines can be a pia as they have elevation, so if you have bricscad ot full autocad you can run commands such as "flatten" and "overkill" to flatten the objects to the same plane "Z0" and remove overlaid or multiple stacked entities one on top of each other.

librecad will do some of the above but I don't think it has overkill or flatten commands.
Last edit: 09 Jan 2022 00:21 by robertspark.

Please Log in or Create an account to join the conversation.

More
10 Jan 2022 16:47 - 10 Jan 2022 16:53 #231320 by Matt Hat
G0 X10
G5 X0.000 Y10.000 I0.000 J5.200 P5.200 Q0.000
G5 X-10.000 Y0.000 I-5.200 J0.000 P0.000 Q5.200
G5 X0.000 Y-10.000 I0.000 J-5.200 P-5.200 Q0.000
G5 X10.000 Y0.000 I5.200 J0.000 P0.000 Q-5.200
These G5 commands will give the following circle when loaded to linuxCNC. 
Attachments:
Last edit: 10 Jan 2022 16:53 by Matt Hat.

Please Log in or Create an account to join the conversation.

More
10 Jan 2022 16:51 - 10 Jan 2022 16:54 #231321 by Matt Hat
G0 X10
G5 X0.000 Y5.000 I0.000 J2.600 P5.200 Q0.000
G5 X-10.000 Y0.000 I-5.200 J0.000 P0.000 Q2.600
G5 X0.000 Y-5.000 I0.000 J-2.600 P-5.200 Q0.000
G5 X10.000 Y0.000 I5.200 J0.000 P0.000 Q-2.600

These G5 commands will give the following ellipse when loaded to linuxCNC. 
Attachments:
Last edit: 10 Jan 2022 16:54 by Matt Hat.

Please Log in or Create an account to join the conversation.

More
10 Jan 2022 18:33 #231327 by jtc
Replied by jtc on topic Splines to Gcode from dxf file
In axis you can go to File and next Proprieties (or gcode proprieties, can't remember the correct name ) and you can see the respective length of the Spline(s).

This value can be compared if matches the length of the Spline on CAD program. Its a quick way to confirm is its correct.

João

Please Log in or Create an account to join the conversation.

More
25 Jan 2022 10:36 #233048 by rishab
This is helpful, thanks for sharing.

Please Log in or Create an account to join the conversation.

More
10 Feb 2022 06:35 #234465 by HaroldH
Thank you for nice post.

Please Log in or Create an account to join the conversation.

Time to create page: 0.152 seconds
Powered by Kunena Forum