Bug: Assembly 4 and Path job creation incompatability

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!
I_am_the_Carl
Posts: 1
Joined: Mon May 29, 2023 6:25 am
Contact:

Bug: Assembly 4 and Path job creation incompatability

Post by I_am_the_Carl »

Okay, maybe a bug. I'll let you guys confirm or deny that.

First all the version information:

Code: Select all

OS: Pop!_OS 22.04 LTS (pop:GNOME/pop)
Word size of FreeCAD: 64-bit
Version: 2023.521.0.14555 (Git shallow) AppImage
Build type: Release
Branch: HEAD
Hash: f428979aa87456d1ce57e2ea78ee9d70dc7595e4
Python 3.11.3, Qt 5.15.8, Coin 4.0.1, Vtk 9.2.5, OCC 7.7.1
Locale: English/United States (en_US)
Installed mods: 
  * freecad.gears 1.0.0
  * Assembly4 0.50.2
Did I find this issue when searching the forum? No.
Did I find this issue when searching the issue tracker? No, not in the FreeCAD issue tracker or the Assembly 4 issue tracker.

The issue I am having:
The exact error I get depends on the version of FreeCAD I use but it all relates to Assembly 4's Local Coordinate Systems. If one is present in the project tree, the "Job" button (in the Paths workbench) will fail to create a job. Remove all local coordinate systems and the job button works just fine.

I enabled all of the logging and have gotten the following error message and stack trace:

Code: Select all

02:46:25  Origin "DrumGear#Origin" doesn't contain feature with role "XY_Plane"
02:46:25  Origin "DrumGear#Origin" doesn't contain feature with role "XY_Plane"
02:46:25  Job.ERROR: creation of box failed
02:46:25  Traceback (most recent call last):
02:46:25    File "/tmp/.mount_FreeCAIZrmJ1/usr/Mod/Path/Path/Main/Gui/Job.py", line 1643, in Create
    obj = PathJob.Create("Job", base, template)
02:46:25    File "/tmp/.mount_FreeCAIZrmJ1/usr/Mod/Path/Path/Main/Job.py", line 863, in Create
    obj.Proxy = ObjectJob(obj, models, templateFile)
02:46:25    File "/tmp/.mount_FreeCAIZrmJ1/usr/Mod/Path/Path/Main/Job.py", line 240, in __init__
    self.setupStock(obj)
02:46:25    File "/tmp/.mount_FreeCAIZrmJ1/usr/Mod/Path/Path/Main/Job.py", line 388, in setupStock
    obj.Stock = PathStock.CreateFromBase(obj)
02:46:25    File "/tmp/.mount_FreeCAIZrmJ1/usr/Mod/Path/Path/Main/Stock.py", line 390, in CreateFromBase
    obj.Proxy.execute(obj)
02:46:25    File "/tmp/.mount_FreeCAIZrmJ1/usr/Mod/Path/Path/Main/Stock.py", line 222, in execute
    shape = Part.makeBox(self.length, self.width, self.height, self.origin)
02:46:25  Part.OCCDomainError: creation of box failed
And you can find that exact problematic line on github: https://github.com/FreeCAD/FreeCAD/blob ... ck.py#L222
I think this has to do with the creation of the stock but I haven't dug quite that deep into it yet.

So, is this a bug?
If yes, which issue tracker do I report it on? I suspect assembly 4 since I've tried with a few older versions of FreeCAD and gotten very different errors relating to missing fields, which makes me think there's something wrong with the local coordinate system objects.

Edit: Clarified which workbench the jobs button is under to improve clarity.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Bug: Assembly 4 and Path job creation incompatability

Post by Zolko »

I_am_the_Carl wrote: Mon May 29, 2023 6:54 am it all relates to Assembly 4's Local Coordinate Systems. If one is present in the project tree, the "Job" button (in the Paths workbench) will fail to create a job. Remove all local coordinate systems and the job button works just fine.
The LCS that Assembly4 uses are standard FreeCAD PartDesign Datum objects. Can you try to make a Path job based on a PartDesign::Body with a PartDesign::CoordinateSystem, without using Assembly4 ?
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Bug: Assembly 4 and Path job creation incompatability

Post by Zolko »

I_am_the_Carl wrote: Mon May 29, 2023 6:54 am First all the version information:

Code: Select all

Version: 2023.521.0.14555 (Git shallow) AppImage
The exact error I get depends on the version of FreeCAD I use
You're using LinkStage version. I just tried with FreeCAD 0.19 and 0.21 and they both work : I can create an assembly, create a Body, import the Body, and create a job and contour on that Body.
path_lcs.png
path_lcs.png (318.69 KiB) Viewed 3031 times
try the Assembly4 workbench for FreCAD — tutorials here and here
wjr
Posts: 28
Joined: Wed Mar 13, 2024 6:37 pm

Re: Bug: Assembly 4 and Path job creation incompatability

Post by wjr »

Zolko wrote: Wed Jun 07, 2023 8:41 am I just tried with FreeCAD 0.19 and 0.21 and they both work :
hm.... sorry to say that I have the same issue in 0.21 stable AppImage.

May that depend on if I rotate / manipulate the stock piece in Assembly?

I simply want to drill the holes in two pieces of Angle aluminum, after I have fit the position fo the holes in another assembly cascade. So my Idea was to place them adjacent (did not work) or to palce them onto a piece of prepared dummy stock. Neither worked. Might it be a workaround to use the stock without special attachment?

Or ist there any proper recommended workflow around for this (imho quite basic) task?


Code: Select all

<class 'Part.OCCDomainError'>: creation of box failed
13:49:43  Traceback (most recent call last):
  File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Stock.py", line 231, in onChanged
    self.execute(obj)
  File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Stock.py", line 222, in execute
    shape = Part.makeBox(self.length, self.width, self.height, self.origin)
<class 'Part.OCCDomainError'>: creation of box failed
13:49:43  Job.ERROR: creation of box failed
13:49:43  Traceback (most recent call last):
13:49:43    File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Gui/Job.py", line 1643, in Create
    obj = PathJob.Create("Job", base, template)
13:49:43    File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Job.py", line 863, in Create
    obj.Proxy = ObjectJob(obj, models, templateFile)
13:49:43    File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Job.py", line 240, in __init__
    self.setupStock(obj)
13:49:43    File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Job.py", line 386, in setupStock
    obj.Stock = PathStock.CreateFromTemplate(obj, json.loads(stockTemplate))
13:49:43    File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Stock.py", line 563, in CreateFromTemplate
    return CreateFromBase(job, neg, pos, placement)
13:49:43    File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Stock.py", line 390, in CreateFromBase
    obj.Proxy.execute(obj)
13:49:43    File "/tmp/.mount_freecavIlBSp/usr/Mod/Path/Path/Main/Stock.py", line 222, in execute
    shape = Part.makeBox(self.length, self.width, self.height, self.origin)
13:49:43  Part.OCCDomainError: creation of box failed

Code: Select all

OS: Debian GNU/Linux 10 (buster) (LXDE/LXDE)
Word size of FreeCAD: 64-bit
Version: 0.21.2.33771 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.21.2)
Hash: b9bfa5c5507506e4515816414cd27f4851d00489
Python 3.10.13, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.6, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods: 
  * fasteners 0.5.13
  * slic3r-tools
  * Pyramids-and-Polyhedrons
  * A2plus 0.4.64
  * Assembly3 0.12.2
  * Assembly4 0.50.9
  * FeedsAndSpeeds 0.5.0
  * dodo 1.0.1
  * frame 0.1.1
  * freecad.gears 1.2.0
  * Manipulator 1.5.7
  * MOOC 2022.4.21
  * Help 1.0.3
  * ose-piping
  * QuickMeasure 2022.10.28
  * sheetmetal 0.4.2
  * ThreadProfile 1.89.0
  * SteelColumn
  * Estimate 0.1.2
  * DynamicData 2.60.0
  * parts_library
  * btl 0.9.9
  * AnimationFreeCAD 1.0.0 (Disabled)
Attachments
mill_plan_X.FCStd
(92.98 KiB) Downloaded 4 times
no_path_job.png
no_path_job.png (125.42 KiB) Viewed 335 times
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Bug: Assembly 4 and Path job creation incompatability

Post by onekk »

wjr wrote: Wed Mar 20, 2024 1:21 pm ...
See:viewtopic.php?t=86110

User you quoted is not reachable anymore in this forum.

A little question, why you are using a result of an Assembly WB to make CAM operations?

Kind regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
wjr
Posts: 28
Joined: Wed Mar 13, 2024 6:37 pm

Re: Bug: Assembly 4 and Path job creation incompatability

Post by wjr »

onekk wrote: Wed Mar 20, 2024 5:06 pm A little question, why you are using a result of an Assembly WB to make CAM operations?
Isn't this the most natural way to do? Use CAD to prepare a part in the place where it is supposed to be in the final assembly, and then use CAM to really produce it such that it actually will fit in the end?

Images say more than words:

ttc450_xrail.png
ttc450_xrail.png (54.15 KiB) Viewed 223 times

Just my current case (still more toying...): TTC450 is a nice hobby mill, but not sturdy enough when I want to perform light steel work with a 700-W-router attached. The X-Z-Axis connection is a particular weak part. So I go to enhance it with linear rails. I draft the rails to the position of the X-beam an Z-beam and graphically fit two pieces of aluminum-L 60x40x5. I started e.g. with two identical copies of the fixture angles, to find that I need a smaller part at the bottom due to space restrictions.

Next I have created another assembly with the same aluminum angles, but now arranged at a piece of dummy stock, with saw cut markers and spacing between, just the way I would process them. Of course, this might be done different as well, but when I work with assembly4 (and I really like this way) to continue with this routine appears to be the most obvious workflow for me.

mill_plan.png
mill_plan.png (124.09 KiB) Viewed 223 times


onekk wrote: Wed Mar 20, 2024 5:06 pm User you quoted is not reachable anymore in this forum.

oopsie, this is real bad news :?

I think that the problem at hand arises somewhere between Assembly4 and Path tool. So, broken communications between the developers involved is a really bad thing :? :? :?

I think I could narrow down the issue:

The Assembly is shown in the Path Plan preparation wizard as 2D. If I include this (or nothing) in the selection, the wizard fails with "creation of box failed". When I add a dummy cube to the scene, I can include this as a 3D part. So next I have to extract the relevant features of the assembly and feed it somehow into the Path model area. This worked alread with simpler test cases, but not wiht the assembly. I'll keep trying....
wjr
Posts: 28
Joined: Wed Mar 13, 2024 6:37 pm

Re: Bug: Assembly 4 and Path job creation incompatability

Post by wjr »

  • can create a PartDesign_SubShapeBinder from all sketches on XY-plane in the assembly
  • move this into the Model tree of a Path Job
  • view them in a Drill Job wizard
  • even click on the holes of drilled parts in 3D (not in the mere sketched spacer ones)
  • but when I click "add", nothing happens in the drill wizard.
Looks like I haven't yet found the proper format :?
xemul
Posts: 393
Joined: Tue Mar 21, 2023 9:35 pm

Re: Bug: Assembly 4 and Path job creation incompatability

Post by xemul »

Edit: my proposal can not be applied to the invented workflow
Last edited by xemul on Fri Mar 22, 2024 9:21 am, edited 1 time in total.
wjr
Posts: 28
Joined: Wed Mar 13, 2024 6:37 pm

Re: Bug: Assembly 4 and Path job creation incompatability

Post by wjr »

The good news: Finally, I got what looks like a working drillplan - at least for the XY plane:

xy_drillplan_simulation.png
xy_drillplan_simulation.png (86.41 KiB) Viewed 174 times

The not so good news: It's hard to figure out what I have done in a reproducible way. Anyway, give it a try:
  • tidy up my "saw cut" sketches so they could serve for hole drilling (hide construction lines, no holes over boundary)
  • add a sketch with rectangle around the SubShapeBinder to invert it from hole driller to pad creator (there may be alternatives, of course)
  • combine the rectangle sketch and the binder with all the holes to another SubShapeBinder and pad it up - if it succeeds without "multiple solids" error, we are half way done
  • move the body containing all that stuff out of the enclosing "Asy 4 part", which may be the culprit (as of my current assumption) of Asm4 - Path incompatibility
  • (why do I believe so? if I don't, path fails, finding only 2D, if I move it out, path wizard offers me a 3D)
  • create a Path Job with the resulting padded binder as 3D; select it as stock as well, adjust the heighths...
  • start a Path_Drilling dialogue and individually click all drill edges in the padded binder (this is really tedious ...)
  • ... enjoy ... 8-)
I'll try the ZY now and keep you up to date
wjr
Posts: 28
Joined: Wed Mar 13, 2024 6:37 pm

Re: Bug: Assembly 4 and Path job creation incompatability

Post by wjr »

  • good news A: I think I have drill plans to mill my parts tomorrow
  • good news B: I think I could roughly draft a protocol how I arrived there
  • bad news: I don't thnik that this is a workable template for skd of everyday workflow, yet
My personal conclusion: still a lot of "tbd" between Assembly4 and Path ...
  • unfold the assembly and make all sketches pertaining to YZ drill job visible
  • ... and select them:

    drillplan_YZ_02_subshapes.png
    drillplan_YZ_02_subshapes.png (250.64 KiB) Viewed 131 times
  • create a PartDesign SubShapeBinder from those sketches

    drillplan_YZ_05_sketch_attach.png
    drillplan_YZ_05_sketch_attach.png (54.05 KiB) Viewed 131 times
  • create a sketch with rectangle around the holes
  • adjust sketch and subShape binders Y alginment, and combine both to another SubShapeBinder

    drillplan_YZ_06_creator_refine_true.png
    drillplan_YZ_06_creator_refine_true.png (227.22 KiB) Viewed 131 times
  • patch it to create a solid - hoping it does...
  • create a body (asy4 - not a part!!!) and move the body out of any asy4 part (may still be in parts list, however)
  • tick "refine = true", if not, I got "multiple solids" error
  • create a Path job, including the body just created (should be selectable as 3D part)
  • rotate both stock and .... for futher operation
  • create drill operation, enjoy that most holes are selected automagically, but not the saw cut indicators - still stuff not yet properly understood

    drillplan_YZ_09_drill_opration_add_holes.png
    drillplan_YZ_09_drill_opration_add_holes.png (252.97 KiB) Viewed 131 times
  • run simulation, and if stock is properly rotated and all option selected correctly, finally enjoy:
    drillplan_YZ_0a_simulation.png
    drillplan_YZ_0a_simulation.png (77.22 KiB) Viewed 131 times
Post Reply