Ticket #6232 - Gcode generated by Path engrave skips some lines

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!
munther_hindi
Posts: 28
Joined: Tue Apr 21, 2020 4:21 pm

Ticket #6232 - Gcode generated by Path engrave skips some lines

Post by munther_hindi »

I produced a sketch part of which is imaged here:
https://drive.google.com/file/d/1tDqX03 ... sp=sharing
sketcher_lines.png
sketcher_lines.png (32.01 KiB) Viewed 1830 times
When I create a Path Job with an an engrave operation on the sketch some segments of sketch are missing from the generated Gcode:
https://drive.google.com/file/d/1RL4aA_ ... sp=sharing
Path-engrave-gcode.png
Path-engrave-gcode.png (61.11 KiB) Viewed 1830 times
(Note the missing upper part of the '6' on the last line and the missing part part of the "upsilon" on the last line and else where. There are many more such characters that are missing the same part in the Gcode.)

System details:

OS: Fedora 33 (Workstation Edition) (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.Unknown
Build type: Unknown
Python version: 3.9.4
Qt version: 5.15.2
Coin version: 4.0.0a
OCC version: 7.5.0
Locale: English/United States (en_US)

Any ideas? I'd be happy to provide more details.
Last edited by Kunda1 on Fri Feb 11, 2022 12:59 pm, edited 1 time in total.
Reason: Added ticket number to thread title
chrisb
Veteran
Posts: 54183
Joined: Tue Mar 17, 2015 9:14 am

Re: Gcode generated by Path engrave skips some lines

Post by chrisb »

Can you upload the FreeCAD file? The "6" would be enough. I assume an error in the sketch.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
munther_hindi
Posts: 28
Joined: Tue Apr 21, 2020 4:21 pm

Re: Gcode generated by Path engrave skips some lines

Post by munther_hindi »

Thanks for the quick reply.

Here is a FreeCAD file just containing the "6":
https://drive.google.com/file/d/1ahe75V ... sp=sharing

Note that the file contains a Path Job that references a tool in my local files system, so you might get an error there. Just delete the job. I included the Job in the file to double check that the problem is still there, and it is. Th generated engrave path does not have the upper part:
https://drive.google.com/file/d/1r51c3k ... sp=sharing

By looking at the number of degrees of freedom in the sketch I see that the point where the upper part meets the "circle" is there twice. My guess is that this the cause of the problem.

If I export the sketch as a dxf file and then use dxf2gcode I get the total correct "6". So this may be a problem in how Path workbench handles self crossing polygons. I am just guessing.

The sketches I am generating are produced by a python script I wrote to draw Hershey fonts (available publicly). There are several hundreds of characters and it would be quite a job to go and eliminate duplicate points (assuming this is the cause of the problem). It seems to me Path should handle this, as does dxf2gcode.

Thanks again for looking into this.
chrisb
Veteran
Posts: 54183
Joined: Tue Mar 17, 2015 9:14 am

Re: Gcode generated by Path engrave skips some lines

Post by chrisb »

munther_hindi wrote: Tue Jun 15, 2021 7:43 pm Here is a FreeCAD file just containing the "6":
https://drive.google.com/file/d/1ahe75V ... sp=sharing
The file seems to be empty. Did you forget o save?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
munther_hindi
Posts: 28
Joined: Tue Apr 21, 2020 4:21 pm

Re: Gcode generated by Path engrave skips some lines

Post by munther_hindi »

Woops! Sorry about that. I uploaded the file again.
https://drive.google.com/file/d/1ahe75V ... sp=sharing
munther_hindi
Posts: 28
Joined: Tue Apr 21, 2020 4:21 pm

Re: Gcode generated by Path engrave skips some lines

Post by munther_hindi »

I think the "9" also has common points and it does not suffer from that problem. May be the way Path sorts the edges?
chrisb
Veteran
Posts: 54183
Joined: Tue Mar 17, 2015 9:14 am

Re: Gcode generated by Path engrave skips some lines

Post by chrisb »

If I make the points coincident with a constraint, the path looks still as yours. If I make them distinct, I get an additional line from the last to the first point:
SnipScreenshot-ce51ad.png
SnipScreenshot-ce51ad.png (22.05 KiB) Viewed 1974 times
mlampert wrote: pinged by pinger macro
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
munther_hindi
Posts: 28
Joined: Tue Apr 21, 2020 4:21 pm

Re: Gcode generated by Path engrave skips some lines

Post by munther_hindi »

It seems you are getting the upper segment of the "6" (starting with Line segment 1 in the sketch). I don't get the Lines 1-7 drawn at all in my Path. I am using the latest stable version that Fedora 33 provides. What version of FreeCAD are you using?
chrisb
Veteran
Posts: 54183
Joined: Tue Mar 17, 2015 9:14 am

Re: Gcode generated by Path engrave skips some lines

Post by chrisb »

I have this version:
OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.25065 (Git)
Build type: Release
Branch: master
Hash: 4de2ad46b2b9c78ac2721a0dbea7c19306261095
Python version: 3.9.4
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: C/Default (C)

I had another look and have to admit that the path shown was created slightly differently: I had selected all edges and added them to the BaseGeometry. (I had thought I had deleted them before my last post, als I was wrong).
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
munther_hindi
Posts: 28
Joined: Tue Apr 21, 2020 4:21 pm

Re: Gcode generated by Path engrave skips some lines

Post by munther_hindi »

Just to be clear, if you do not touch the sketch and just make an engraving Path out of it, do you get what I get? If so, then the version you have behaves the same as mine and I would think this is a bug. Do you agree? Again, if I export the sketch as a dxf file and process that with with another program (dxf2gcode), it produces the complete "6".
Post Reply