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

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

Postby freman » Mon Nov 18, 2019 3:53 pm

Hi,

about 6mo ago I made this file and engraved it very successfully. I now want to do a similar job but can't remember all the incantations I needed to do get to the state this file in.

It does not seem to match some of the demos and tutorials I've found now on using shapestring.

There is sketch in there which was something to do with pegging the text to a sketch, but I can pick up the pieces still floating around on backup storage about how all this is supposed to work.

It really would be nice if there was a more direct way of doing this but I suppose for now we're stuck with jumping through the hoops and remembering how to get to the fish. They say omega-3 is good for the brain but apparently I have not even enough fish yet.

Can some kind sole point me in the right direction?

TIA.

OS: Fedora 31 (Thirty One) (LXDE/LXDE)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18754 (Git)
Build type: Release
Branch: master
Hash: a5019828cf263ccdec3b6885f845b1ab1c35ac11
Python version: 3.7.5
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Attachments
engrave-example.FCStd
(92.61 KiB) Downloaded 17 times
Last edited by freman on Tue Nov 19, 2019 3:01 pm, edited 1 time in total.
openBrain
Posts: 3054
Joined: Fri Nov 09, 2018 5:38 pm

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

Postby openBrain » Mon Nov 18, 2019 5:39 pm

Is your problem about engraving during model design, or with Path ?
User avatar
freman
Posts: 904
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Mon Nov 18, 2019 6:13 pm

Thanks, the problem is understanding how I got the text in that position, and tied to what? I know this had something to do with the sketch-location but I've lost the thread of how it goes.

It's also not encouraging that someone seems to have changed that way things work and pulled the rug on something which was created with 0.19 only a few months ago. Is there no policy to maintain b/w compatibility any more? This is really annoying, I would at least expect to open that file and it would be clean and working.

Since everything is borked I don't suppose I'll be able to reuse those paths to produce Gcode either. I thought I had a working model archived and now I open it, it's turned to mud. It's not even any use as a reference to make a similar item by editing and moving the text.

I really would appreciate not having to re-invent the wheel every time I need one.

Is there enough there for you to see how I did it? I can make the body and the shapeString objects but IIRC, they all need to be part of one part to be able to make a path.
chrisb
Posts: 21295
Joined: Tue Mar 17, 2015 9:14 am

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

Postby chrisb » Mon Nov 18, 2019 7:06 pm

Well, that's the nature of a development version. The better is the enemi of the good. And I don't see that your model is garbled.

After all it's not such a big thing:
- Select e.g. Shape51
- create a Job, Shape51 is preselected, select the appropriate tool or do so later
- confirm
- click the engrave icon
- confirm
finished!

Creating a template with the appropriate tool and post processor speeds things up.

Please test if you can select more than one shape for an engraving job.

If you are successful with your engraving, please add to the wiki so that others can benefit from it - and you too in half a year or so.
User avatar
freman
Posts: 904
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Mon Nov 18, 2019 9:08 pm

Thanks Chris but you missed the point of my request. As I explained to openBrain above it is how I got the ShapeStrings into a state I make a path job on that I was stuck on.

when I open the file I get this on report view:

Code: Select all

grbl_post: GCode postprocessor loaded.
Part::Part2DObjectPython / ShapeString002: Links go out of the allowed scope
Part::Part2DObjectPython / ShapeString003: Links go out of the allowed scope
Part::Part2DObjectPython / ShapeString003: Links go out of the allowed scope
grbl_post: GCode postprocessor loaded.
grbl_post: GCode postprocessor loaded.
Traceback (most recent call last):
  File "/~/freecad-master-qt5-build/Mod/Draft/Draft.py", line 3756, in onChanged
    if vobj.RootNode.getChild(2).getChildren().getLength() > 0:
<class 'AttributeError'>: 'NoneType' object has no attribute 'getLength'
Engraving Select Mode
Free Select
Traceback (most recent call last):
  File "/~/freecad-master-qt5-build/Mod/Path/PathScripts/PathOpGui.py", line 946, in reject
    PathUtil.clearExpressionEngine(self.obj)
  File "/#/freecad-master-qt5-build/Mod/Path/PathScripts/PathUtil.py", line 99, in clearExpressionEngine
    if hasattr(obj, 'ExpressionEngine'):
<class 'ReferenceError'>: Cannot access attribute 'ExpressionEngine' of deleted object
Engraving Select Mode
Free Select
Enumeration index -1 is out of range, ignore it
Traceback (most recent call last):
  File "/~/freecad-master-qt5-build/Mod/Path/PathScripts/PathOp.py", line 204, in onDocumentRestored
    if FeatureBaseGeometry & features and 'App::PropertyLinkSubList' == obj.getTypeIdOfProperty('Base'):
<class 'AttributeError'>: Property container has no property 'Base'
:(
I also had exclamation marks on all the paths. Those are not showing now so maybe closing and reopening has somehow brought it more into line with the current version. Strange but I'm not going to complain. It does indeed look usable to reproduce the existing model, which is great news. All is not lost.

I found this thread from when I did the 'area 51' job.

https://forum.freecadweb.org/viewtopic. ... 10#p313427
I needed to select string object, hit engrave tool icon then select which job it went into.
Then go straight to the Base Geometry tab and ensure it is not empty. If empty: delete and start again. It seems that you can not select such a text object manually and hit add , unless you want to pick out each segment of each letter one at a time!
That does not seem to work on the new job. No chance to select a job and base geometry is empty: which is failure condition.

Here I used PartWB , Part | Attachment to place the shapeString. That may not be what I did last time, or the Matrix has been rearranged since then.

I suspect this is still just a "string" and not something I can get a path from. I must be missing a trick.
Attachments
125-string-test.FCStd
(27.11 KiB) Downloaded 9 times
chrisb
Posts: 21295
Joined: Tue Mar 17, 2015 9:14 am

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

Postby chrisb » Mon Nov 18, 2019 9:54 pm

As mentioned above, you have to select the ShapeString from the 2D models, not the body from the 3D solids.
User avatar
freman
Posts: 904
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Mon Nov 18, 2019 10:03 pm

Thanks, I'd just sussed that but even on that basis I get this when I try to engrave.

This happens at the moment I hit "apply " in the path dialogue:

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
Traceback (most recent call last):
  File "/~/freecad-master-qt5-build/Mod/Path/PathScripts/PathUtils.py", line 64, in new_function
    res = function(*args, **kwargs)
  File "/~/freecad-master-qt5-build/Mod/Path/PathScripts/PathOp.py", line 518, in execute
    result = self.opExecute(obj) # pylint: disable=assignment-from-no-return
  File "/~/freecad-master-qt5-build/Mod/Path/PathScripts/PathEngrave.py", line 130, in opExecute
    self.buildpathocc(obj, shape.Wires, self.getZValues(obj))
  File "/~/freecad-master-qt5-build/Mod/Path/PathScripts/PathEngraveBase.py", line 78, in buildpathocc
    edges = copy.copy(PathOpTools.orientWire(offset).Edges)
  File "/~/freecad-master-qt5-build/Mod/Path/PathScripts/PathOpTools.py", line 145, in orientWire
    return PathGeom.flipWire(wire)
  File "/~/freecad-master-qt5-build/Mod/Path/PathScripts/PathGeom.py", line 557, in flipWire
    return Part.Wire(edges)
<class 'TypeError'>: item is not a shape
21685 <App> Document.cpp(3462): Failed to recompute plate#Engrave: item is not a shape
Recompute failed! Please check report view.
I do see an entry in Base Geometry and set my depths etc but Apply btn barfs.
User avatar
freman
Posts: 904
Joined: Tue Nov 27, 2018 10:30 pm

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

Postby freman » Mon Nov 18, 2019 10:59 pm

Sorry , that's not accurate as it reads. I can get a path on 125-test but if I add a second string it fails.

see new file with two string "12.5" and "default". I can get a path on the numbers but not on default.

There may be some detail I'm over looking here, but it seems most odd.
chrisb
Posts: 21295
Joined: Tue Mar 17, 2015 9:14 am

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

Postby chrisb » 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.
chrisb
Posts: 21295
Joined: Tue Mar 17, 2015 9:14 am

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

Postby chrisb » Mon Nov 18, 2019 11:30 pm

I can confirm that it is not possible to have more than one ShapeString in an engraving Job. Two Jobs with one engraving operation in each works.