[engraving] - Twice Gcode in the file

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
Russ4262
Posts: 216
Joined: Sat Jun 30, 2018 3:22 pm

Re: [engraving] - Twice Gcode in the file

Postby Russ4262 » Sat May 04, 2019 12:50 am

Evening Gents,
I looked into the code. I found the issue for double path generation. I am waiting to consult with
sliptonic wrote:@Sliptonic
about which solution to employ. We'll get it rightly divided ... (by 2! -- LOL). Anyhow, the problem code has been found.
nemesis wrote:@Nemesis
Regardless, the sentence still has 25,000 lines of gcode, and just the "Inspect gcode" tool takes 5+ minutes to load completely. I have not attempted post-processing yet.
chrisb wrote:Can this be the source of the doubled gcodes?
I don't think so. There is a second IF statement in the opExecute() PathEngrave method that is re-processing model objects processed just a few lines above in another set of IF, ELIF statements. I have already run tests with a couple different solutions in the code. I just need to collaborate with someone who knows more about the possible test cases being considered with the second IF statement causing the duplication.

If I simply comment out the second IF statement, the duplication disappears; however, it looks like it is a fall-back of sorts if test cases in the first IF-ELIF set don't find anything. I need more information before employing one of the possible solutions I have tested.

Thanks,
Russell

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16616 (Git)
Build type: Release
Branch: master
Hash: f94cdfd798d0c493efe9c7d45084ad2c5dd18caf
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
User avatar
nemesis
Posts: 342
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [engraving] - Twice Gcode in the file

Postby nemesis » Sat May 04, 2019 9:55 am

Russ4262 wrote:
Sat May 04, 2019 12:50 am
Regardless, the sentence still has 25,000 lines of gcode, and just the "Inspect gcode" tool takes 5+ minutes to load completely. I have not attempted post-processing yet.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16616 (Git)
Build type: Release
Branch: master
Hash: f94cdfd798d0c493efe9c7d45084ad2c5dd18caf
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)

with the release bellow I don't have any double code, so it sounds the problem is already fixed no?
OS: Debian GNU/Linux buster/sid (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16540 (Git) AppImage
Build type: Release
Branch: master
Hash: 554985dede771f9a6694baba2372cc60db86f17b
Python version: 3.7.1
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
For the post processing time, it is about 5 to 10 minute with this version. but does not work with the debian package version.
I'll try with the appimage 0.18.1 (don't know if the debian version is 0.18 or 0.18.1)
kkremitzki wrote: ping
[EDIT]
so I tried with
OS: Debian GNU/Linux buster/sid
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16110 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.18.1)
Hash: f7dccfaa909e5b9da26bf50c4a22ccca9bb10c40
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
and it works without issue.(5min+ export)

tried again with my debian version and it run endlessly.
python version issue?
User avatar
Russ4262
Posts: 216
Joined: Sat Jun 30, 2018 3:22 pm

Re: [engraving] - Twice Gcode in the file

Postby Russ4262 » Sat May 04, 2019 8:50 pm

Afternoon,
Today, [user_id=708]@Sliptonic[/quote] and I dove deeper into the PathEngrave.py scirpt.
nemesis wrote:ping
We found a part of the problem is that this particular use case was being processed twice.
chrisb wrote:
Sun Apr 28, 2019 12:14 pm
Can this be the source of the doubled gcodes?
And after redacting my previous "I don't think so, Chrisb" and apologize for my dismissal of your knowledgeable suggestion for a previous response, I will change that to a

"Yes, Chrisb, that is also a part of the problem."

Looking at the shapestring while zoomed in, one can visibly see multiple edge lines in the more acute curves. Images attached.

So, @Sliptonic and I are working on a solution for the duplicate processing; He is understands the larger coding picture much better than I. Likewise, @Chrisb's suggestion of selecting a font with only a single edge would also be beneficial. Perhaps that is what is occurring on some of the Linux machines that are processing the job much faster.

Russell
Attachments
TestEngrave_DblEdge-2.png
High zoom
TestEngrave_DblEdge-2.png (180.64 KiB) Viewed 266 times
TestEngrave_DblEdge-1.png
Mild zoom
TestEngrave_DblEdge-1.png (176.73 KiB) Viewed 266 times
User avatar
sliptonic
Posts: 1557
Joined: Tue Oct 25, 2011 10:46 pm

Re: [engraving] - Twice Gcode in the file

Postby sliptonic » Sat May 04, 2019 10:03 pm

Russ and I have been digging on this and I'm learning all kinds of interesting things today about those CamBam stick fonts.

Take a look here:http://www.mrrace.com/CamBam_Fonts/

Note the text

"Your cutter will go over each letter twice, once in each direction, and exactly on the same path no matter what size you engrave, even if they are 12 inches high!"
chrisb
Posts: 17545
Joined: Tue Mar 17, 2015 9:14 am

Re: [engraving] - Twice Gcode in the file

Postby chrisb » Sat May 04, 2019 11:59 pm

Russ4262 wrote:
Sat May 04, 2019 8:50 pm
chrisb wrote:
Sun Apr 28, 2019 12:14 pm
Can this be the source of the doubled gcodes?
And after redacting my previous "I don't think so, Chrisb" and apologize for my dismissal of your knowledgeable suggestion for a previous response, I will change that to a

"Yes, Chrisb, that is also a part of the problem."
There is nothing to apologize, "I don't think so" does not sound like an insult to me :) . And I'm sure, that you were right, because you didn't thought so at that time :) .
User avatar
nemesis
Posts: 342
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [engraving] - Twice Gcode in the file

Postby nemesis » Mon May 06, 2019 5:29 pm

sliptonic wrote:
Sat May 04, 2019 10:03 pm
Russ and I have been digging on this and I'm learning all kinds of interesting things today about those CamBam stick fonts.

Take a look here:http://www.mrrace.com/CamBam_Fonts/

Note the text

"Your cutter will go over each letter twice, once in each direction, and exactly on the same path no matter what size you engrave, even if they are 12 inches high!"
hi,
I was aware of the double travel in each direction, the issue is not here.
as stated in my first post there is a go/return on each letter and it is normal according the font. but this block of code is repeated again after the tjeoretical end of the gcode.
so it make the machine come back to 0,0,0 and start again the milling.
again it only appears on 0.18 debian package for me
it is ok with the 0.19 appimage
User avatar
Russ4262
Posts: 216
Joined: Sat Jun 30, 2018 3:22 pm

Re: [engraving] - Twice Gcode in the file

Postby Russ4262 » Tue May 07, 2019 1:01 am

Evening, Nemisis.
Good news. Recently @Sliptonic made a PR #2141 to address the duplicate path information.
nemesis wrote:
Mon May 06, 2019 5:29 pm
so it make the machine come back to 0,0,0 and start again the milling.
again it only appears on 0.18 debian package for me
it is ok with the 0.19 appimage
I verified the same duplication in the Windows x64 release of 0.19. It should be fixed for all OS's in current releases built after PR #2141 above.

Thanks for the feedback.
Russell
User avatar
nemesis
Posts: 342
Joined: Tue Mar 25, 2014 11:24 pm
Location: France, Lyon

Re: [engraving] - Twice Gcode in the file

Postby nemesis » Thu May 16, 2019 6:31 pm

Russ4262 wrote:
Tue May 07, 2019 1:01 am
I verified the same duplication in the Windows x64 release of 0.19. It should be fixed for all OS's in current releases built after PR #2141 above.

Thanks for the feedback.
Russell
thanks a lot!
it works great and I finally get the engraving correct :D

EDIT :
And for the recods here is the result, and also my first 3D Milling thanks to freecad !!!
Awsome! I'm like a kid in front of box of lego !

20190519_114637.jpg
20190519_114637.jpg (176.29 KiB) Viewed 89 times
clearly I need to adjust the speeds for the 3D milling, but it is quite a nice first shot! (need to make the finishing passes now)
20190519_114628.jpg
20190519_114628.jpg (166.72 KiB) Viewed 89 times
Russ4262 wrote:
thanks again, again and again!