Path from ShapeString fails : bug in master c. sept 2019

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
freman
Posts: 904
Joined: Tue Nov 27, 2018 10:30 pm

Re: engraving: help , how did I do this?

Postby freman » Tue Nov 19, 2019 6:55 am

chrisb wrote:
Mon Nov 18, 2019 11:19 pm
freman wrote:
Mon Nov 18, 2019 10:59 pm
see new file with two string "12.5" and "default".
There is no new file attached.
sorry, don't know how that happened.

Using separate jobs is what I did on the Area 51 job. That still boots up but I have not tried ( dared ) to modify it.

The file (hopefully) attached here has two shapeStrings. I can not get a path on the second whatever way I do it. The first one seems to work. I must be over looking something but I can't see any difference , can you?
Attachments
12.5-string-test.FCStd
(59.26 KiB) Downloaded 10 times
Syres
Posts: 439
Joined: Thu Aug 09, 2018 11:14 am

Re: engraving: help , how did I do this?

Postby Syres » Tue Nov 19, 2019 9:10 am

This is quite bizarre as I spent 5 hours yesterday attempting to clean up the error handling in Path>Engraving but in 0.18.4 particularly around helping new users who get caught out by the BSpline issue but also just trying to reduce the excess quantity (IMHO) of red in the Report View. When I'd got some rough code working I thought best to just check a Shapestring is still working and sure enough in 0.18.4 it's fine but in 0.19.18760 it is not so I class that as a regression and I don't use PartDesign just so people are aware.

Using:

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)

the Report View output is:

Code: Select all

Engraving Select Mode
Free Select
Using:

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18760 (Git)
Build type: Release
Branch: master
Hash: ef73ab5f3a330d3c44138f23290f8c9f7a334caf
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)

the Report View output is:

Code: Select all

Engraving Select Mode
PathGeom.WARNING: <class 'Part.BezierCurve'> not support for flipping
PathGeom.WARNING: <class 'Part.BezierCurve'> not support for flipping
PathGeom.WARNING: <class 'Part.BezierCurve'> not support for flipping
PathGeom.WARNING: <class 'Part.BezierCurve'> not support for flipping
PathGeom.WARNING: <class 'Part.BezierCurve'> not support for flipping
PathGeom.WARNING: <class 'Part.BezierCurve'> not support for flipping
PathGeom.WARNING: <class 'Part.BezierCurve'> not support for flipping
Traceback (most recent call last):
  File "E:\Data\My Downloads\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathUtils.py", line 64, in new_function
    res = function(*args, **kwargs)
  File "E:\Data\My Downloads\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathOp.py", line 518, in execute
    result = self.opExecute(obj) # pylint: disable=assignment-from-no-return
  File "E:\Data\My Downloads\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathEngrave.py", line 130, in opExecute
    self.buildpathocc(obj, shape.Wires, self.getZValues(obj))
  File "E:\Data\My Downloads\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathEngraveBase.py", line 78, in buildpathocc
    edges = copy.copy(PathOpTools.orientWire(offset).Edges)
  File "E:\Data\My Downloads\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathOpTools.py", line 145, in orientWire
    return PathGeom.flipWire(wire)
  File "E:\Data\My Downloads\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\FreeCAD_0.19.18760_x64_LP_12.1.2_PY3QT5-WinVS2015\Mod\Path\PathScripts\PathGeom.py", line 557, in flipWire
    return Part.Wire(edges)
<class 'TypeError'>: item is not a shape
0 <App> Document.cpp(3462): Failed to recompute ShapeStringTest#Engrave: item is not a shape
Recompute failed! Please check report view.
for the exact same 'Default' text in size 10.0 using Arail.ttf font at position 0,0,0.

Note: I'm still working on polishing the 0.18.4 error handling to include the translate dialog boxes and Report View output and will submit a PR in the next day or two for the 0.18 branch. I'm holding off a PR for master until what appears as a C++ bug is fixed.
chrisb
Posts: 21295
Joined: Tue Mar 17, 2015 9:14 am

Re: engraving: help , how did I do this?

Postby chrisb » Tue Nov 19, 2019 9:19 am

I found the reason for the failure: Characters which have an inner enclosed part (sorry don't know how to express this better in English), such as D,e,a don't work. Characters having only an outline, such as f,l,t can be engraved.

For the letter D it is possible to select the edges of the outer outline for engraving, and for parts of the inner edges, but not all of it. This may be different with different fonts. I have tried with FreeSans and Arial.

Markus, I have seen that you are very busy creating great stuff (Machinekit, ToolBits), but you may have a quick glance at this, if it's worth a ticket.
mlampert wrote:ping
Syres
Posts: 439
Joined: Thu Aug 09, 2018 11:14 am

Re: engraving: help , how did I do this?

Postby Syres » Tue Nov 19, 2019 9:40 am

I'll just add one more bit of info that may assist, the letters of the Shapestring had visible faces certainly up to and including build 0.19.18284 (approx 24/9/2019) which could be changed using the Shape Color field and those faces disappeared in build 0.19.18351 (approx 28/9/2019). Could that account for the 'Item Is Not a Shape' error?
User avatar
freman
Posts: 904
Joined: Tue Nov 27, 2018 10:30 pm

Re: engraving: help , how did I do this?

Postby freman » Tue Nov 19, 2019 9:43 am

Thanks for the confirmation Syres, I was starting think I'm the only fool having this problem, or it was my lack of familiarity with ShapeStrings.

Chris. I almost suggested earlier that it was only the numbers which were working but this seems so stupid I didn't bother.

51 and 125 and 12.5 work , not because they are numbers but for the reason you state. Good catch.

BTW "Area" "keep out" all have inner profiles and were working on master (qt4) a few months back.
User avatar
freman
Posts: 904
Joined: Tue Nov 27, 2018 10:30 pm

Re: engraving: help , how did I do this?

Postby freman » Tue Nov 19, 2019 9:55 am

Chris , can you suggest a work around? It seems there are several ways to get an outline to engrave.

Yesterday I tried ShapeToSketch but it seemed to fail in a similar way when I tried to get a path.
Syres
Posts: 439
Joined: Thu Aug 09, 2018 11:14 am

Re: engraving: help , how did I do this?

Postby Syres » Tue Nov 19, 2019 10:14 am

Ignore my above post regarding the missing faces it's just that the default view is set to Wireframe instead of Flat Faces which happened around the same time as two commits were made to src\Mod\Path\PathScripts\PathEngraveBase.py around the end of September.

One commit is fine and I cannot find a detrimental effect therefore I've included the attached file but the one that appears to be causing the issue is https://github.com/FreeCAD/FreeCAD/comm ... 2860bc8e17
Therefore if you want a workaround, you can copy the attached file into your recent build, I've tested it with:

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18760 (Git)
Build type: Release
Branch: master
Hash: ef73ab5f3a330d3c44138f23290f8c9f7a334caf
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)

In the meantime I'll have a look at the commit and see if my brain will stretch to a fix but @mlampert can spot anything obvious then please feel free to advise.
Attachments
PathEngraveBase.py
(6.35 KiB) Downloaded 8 times
chrisb
Posts: 21295
Joined: Tue Mar 17, 2015 9:14 am

Re: engraving: help , how did I do this?

Postby chrisb » Tue Nov 19, 2019 10:30 am

freman wrote:
Tue Nov 19, 2019 9:55 am
Chris , can you suggest a work around?
You can extrude the ShapeString and create a "Profile from faces" operation with settings
- no compensation
- process Holes and process perimeter checked.
Snip macro screenshot-cb2119.png
Snip macro screenshot-cb2119.png (3.14 KiB) Viewed 162 times
I add the file, its using FreeSans, but probably in the wrong directory.
Attachments
engrave_cb.FCStd
(28.36 KiB) Downloaded 6 times
User avatar
freman
Posts: 904
Joined: Tue Nov 27, 2018 10:30 pm

Re: engraving: help , how did I do this?

Postby freman » Tue Nov 19, 2019 10:34 am

Wow, syres, you're an ace. Dropped that in and I'm back at work. :D

Many, many thanks for that fix. I've wasted so much time on this in the last few days, it's not true. Great work.

Also thanks to Chris for the alternative method. I'll look at that if I have further issues. Maybe I'll get to spend the day on the CNC for a change instead of doing battle with the computer.
chrisb
Posts: 21295
Joined: Tue Mar 17, 2015 9:14 am

Re: engraving: help , how did I do this?

Postby chrisb » Tue Nov 19, 2019 10:44 am

Syres wrote:
Tue Nov 19, 2019 10:14 am
Therefore if you want a workaround, you can copy the attached file into your recent build, I've tested it with:
This is of course a better solution. Are you going to make a pull request as well?