2D job creation fails.

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!
User avatar
freman
Veteran
Posts: 2198
Joined: Tue Nov 27, 2018 10:30 pm

2D job creation fails.

Post by freman »

It's been a while since I did wood engraving, so I guess I should expect the goalposts have moved since I last learnt it.

So I thought : RTFM.
https://wiki.freecadweb.org/Path_Engrave

oops. Never mind.

I found a simple tutorial (based on v0.19) which seemed straight forward.
https://www.youtube.com/watch?v=juzDSwGya1E

I recall it was more complicated last time , so I thought I'd go this route which seemed more logical.

I have my shapeString but when I try to define a job and select the 2D element "ecole", it dumps out saying : ValueError: height of box too small.

Code: Select all

21:58:10  This job contains Legacy tools. Legacy tools are deprecated. They will be removed after version 0.20Traceback (most recent call last):
  File "/~/freecad-build-master/Mod/Path/PathScripts/PathStock.py", line 231, in onChanged
    self.execute(obj)
  File "/~/freecad-build-master/Mod/Path/PathScripts/PathStock.py", line 222, in execute
    shape = Part.makeBox(self.length, self.width, self.height, self.origin)
<class 'ValueError'>: height of box too small
21:59:52  PathJobGui.ERROR: height of box too small
21:59:52  Traceback (most recent call last):
21:59:52    File "/~/freecad-build-master/Mod/Path/PathScripts/PathJobGui.py", line 1640, in Create
    obj = PathJob.Create("Job", base, template)
21:59:52    File "/~/freecad-build-master/Mod/Path/PathScripts/PathJob.py", line 863, in Create
    obj.Proxy = ObjectJob(obj, models, templateFile)
21:59:52    File "/~/freecad-build-master/Mod/Path/PathScripts/PathJob.py", line 242, in __init__
    self.setupStock(obj)
21:59:52    File "/~/freecad-build-master/Mod/Path/PathScripts/PathJob.py", line 388, in setupStock
    obj.Stock = PathStock.CreateFromTemplate(obj, json.loads(stockTemplate))
21:59:52    File "/~/freecad-build-master/Mod/Path/PathScripts/PathStock.py", line 557, in CreateFromTemplate
    return CreateFromBase(job, neg, pos, placement)
21:59:52    File "/~/freecad-build-master/Mod/Path/PathScripts/PathStock.py", line 384, in CreateFromBase
    obj.Proxy.execute(obj)
21:59:52    File "/~/freecad-build-master/Mod/Path/PathScripts/PathStock.py", line 222, in execute
    shape = Part.makeBox(self.length, self.width, self.height, self.origin)
21:59:52  ValueError: height of box too small
21:59:52  
It seems like this should work, so what is going on ? Regression ? Bug ?

Is there some doc which works with my v0.20 ?

TIA.

Code: Select all

OS: Fedora Linux 35 (Thirty Five) (LXQt//usr/share/xsessions/lxqt)
Word size of FreeCAD: 64-bit
Version: 0.20.28738 (Git)
Build type: Release
Branch: master
Hash: ea5e9538da30749ac54afd7e311851540281a20d
Python 3.10.4, Qt 5.15.2, Coin 4.0.0, OCC 7.5.0
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * FreeCAD_Assembly4 0.11.10
  * FreeCAD_assembly3
Attachments
ecole.png
ecole.png (215.35 KiB) Viewed 992 times
ecole.FCStd
(22.64 KiB) Downloaded 11 times
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: 2D job creation fails.

Post by GeneFC »

freman wrote: Mon Jul 18, 2022 8:19 pm It seems like this should work, so what is going on ?
The Job does not reference the correct element in the model. It appears you set up the Job to use some sort of extrusion instead of the Shape String.

Worked fine for me when I created a Job based on the Shape String.

Gene
User avatar
freman
Veteran
Posts: 2198
Joined: Tue Nov 27, 2018 10:30 pm

Re: 2D job creation fails.

Post by freman »

Thanks for taking a look.

The job you see is indeed something else. The attempt to make a job from the shapeString failed and was not created. I should have made that clearer.

It seems odd that I attempt a job for 2D object and it complains the height is too small !

To reproduce it you will need to try to create a job for that string object.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: 2D job creation fails.

Post by GeneFC »

freman wrote: Tue Jul 19, 2022 6:42 am To reproduce it you will need to try to create a job for that string object.
That is exactly what I did.

Worked fine.

Possibly a recent version 0.21 thing.

Code: Select all

OS: Windows 7 SP 1 (6.1)
Word size of FreeCAD: 64-bit
Version: 0.21.29485 (Git)
Build type: Release
Branch: master
Hash: a236ca843fdd6674afb6d7ed1454fbd3b547f5ea
Python 3.8.13, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: English/United States (en_US)
Installed mods: 
  * FeedsAndSpeeds 0.4.0
  * FeedsAndSpeeds-master.zip
  * Help 1.0.3
  * offline-documentation
[Edit] Just tried with the official released version 0.20. Still works fine.

Gene
User avatar
freman
Veteran
Posts: 2198
Joined: Tue Nov 27, 2018 10:30 pm

Re: 2D job creation fails.

Post by freman »

Thanks, there is definitely a problem here.

I just rebuild opencascade 7.5.0 ( for which I had previously used the the distro build ). Did a git pull on master, rebuilt and got the same issue.

I used the AppImage 0.20 and worked as you say.

I closed and reopened file with master and try to redo the same job creation and fails as I initially found.
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: 2D job creation fails.

Post by GeneFC »

May be a problem with libraries. I recall there was some issue with OCC 7.5.x, where x is 0 to 2. Could also be a problem with Python 3.10. I do not think that has yet been used very much in FreeCAD development.

Gene
User avatar
freman
Veteran
Posts: 2198
Joined: Tue Nov 27, 2018 10:30 pm

Re: 2D job creation fails.

Post by freman »

Hi.

Code: Select all

  File "/~/freecad-build-master/Mod/Path/PathScripts/PathStock.py", line 222, in execute
    shape = Part.makeBox(self.length, self.width, self.height, self.origin)
<class 'ValueError'>: height of box too small
Not convinced this is libs. That is clearly trying to make stock with zero height and it's barfing on that value.
If I look at the successful 2D job , the stock goes from -1 to +1 mm .

When you initially tested , before using the release version what build were you using ?

Thx
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: 2D job creation fails.

Post by GeneFC »

As shown above, Version: 0.21.29485 (Git).

About a week old.

Gene
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: 2D job creation fails.

Post by GeneFC »

I do not know if you have reconfigured your Job yet, but the original cannot possibly work. The Job is built around the "Extrude-block", and there is no connection at all to the Shape-string.

I do not think that Path even knows the Shape-string is there. It certainly does not reference it at all.

Take a look at the Dependency Graph. It shows the Shape-string standing alone in the wilderness.

Gene
User avatar
freman
Veteran
Posts: 2198
Joined: Tue Nov 27, 2018 10:30 pm

Re: 2D job creation fails.

Post by freman »

I started with a fresh file to avoid confusion. Here is the newest .

I just deleted the build tree and rebuilt. Still getting the original error.

thx.
Attachments
ecole.FCStd
(53.76 KiB) Downloaded 13 times
Post Reply