Boundary Dressup and Tag Dressup

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Post Reply
imm
Posts: 163
Joined: Wed Nov 03, 2021 1:00 pm

Boundary Dressup and Tag Dressup

Post by imm »

I was trying to use Tag Dressup to support the remains of a notch profile.

This was done as a profile cut with a boundary dressup afterwards....then I tried to apply the Tag Dressup on the result....
The process fails with a error....

Code: Select all

Traceback (most recent call last):
  File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathDressupTagGui.py", line 561, in Activated
    FreeCADGui.doCommand("PathScripts.PathDressupTagGui.Create(App.ActiveDocument.%s)" % baseObject.Name)
  File "<string>", line 1, in <module>
  File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathDressupTagGui.py", line 528, in Create
    obj = PathDressupTag.Create(baseObject, name)
  File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathDressupHoldingTags.py", line 1089, in Create
    dbo.setup(obj, True)
  File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathDressupHoldingTags.py", line 1041, in setup
    obj.Width = self.pathData.defaultTagWidth()
  File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathDressupHoldingTags.py", line 719, in defaultTagWidth
    width = self.shortestAndLongestPathEdge()[1].Length / 10
  File "C:\Program Files\FreeCAD 0.19\Mod\Path\PathScripts\PathDressupHoldingTags.py", line 601, in shortestAndLongestPathEdge
    return (edges[0], edges[-1])

list index out of range
Any work-arounds? ....or is stacking of Dressup scripts not good practice?
User avatar
sliptonic
Veteran
Posts: 3410
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Boundary Dressup and Tag Dressup

Post by sliptonic »

Please include your FreeCAD info and attach a file
imm
Posts: 163
Joined: Wed Nov 03, 2021 1:00 pm

Re: Boundary Dressup and Tag Dressup

Post by imm »

FreeCAD info is below

Code: Select all

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24291 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: 7b5e18a0759de778b74d3a5c17eba9cb815035ac
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)
The file attached is prior to applying the Tag Dressup. Open it and try to apply tag dressup with DressupPathBoundary selected.

It won't produce the gui ...and will error out.
Attachments
notch.FCStd
(25.89 KiB) Downloaded 43 times
User avatar
sliptonic
Veteran
Posts: 3410
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Boundary Dressup and Tag Dressup

Post by sliptonic »

I'm able to reproduce the error. I'll make an issue for it. However, you can work around it by applying the dressups in the other order. Put the tag dressup on first and then the boundary.
2021-11-03_14-58.png
2021-11-03_14-58.png (13.82 KiB) Viewed 1749 times
Russ4262
Posts: 932
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Boundary Dressup and Tag Dressup

Post by Russ4262 »

Morning.
There are a couple of issues going on here. First, the Boundary Dressup that is applied is cutting off the final pass of the Profile op. The Final Depth of the Profile op is about -0.99, whereas the Boundary Dressup is set to Extend Model BoundBox, and the lower Z extension is set to 0.0 mm. This eliminates the final pass at depth for the Profile op, making the new final pass in the Boundary Dressup as about 0.35 mm as seen when running the mouse over the bottom path of the Boundary Dressup paths. For some reason, the Tag Dressup is incorrectly identifying minimum Z height of the Boundary Dressup as 0.0. I have not found where this incorrect z-min is being calculated or identified.

Another issue is that once the Boundary Dressup is corrected for Z minimum, and the Tag Dressup applied, the original Boundary Dressup paths do not disappear from the viewport. Upon inspection of the gcode for the top Tag Dressup, it is correct. So, there is an error in the Tag Dressup that is not clearing the viewport representations from the base Boundary Dressup, but seems to be a scenegraph/display issue and not a gcode issue.

@imm, if you will set the Boundary Dressup lower Z extension to 1.0 mm, it will include the Final Depth pass of your Profile op, and allow the subsequent Tag Dressup to function, albeit manually.

Summary:
* The tag dressup will work on top of the boundary dressup, but the z-min extension of the boundary dressup needs to lowered to include the final pass of the profile op.
* There is a bug or two in the tag dressup that is incorrectly identifying the z-min value of the incoming boundary dressup paths in this case.
* There is a viewport issue in what I am calling the tag dressup that is not clearing the path of the child boundary dressup from the viewport after the tag dressup is successfully applied on top of the boundary dressup - at least in my testing.

I am still investigating, attempting to identify and reproduce the exact number and nature of bugs we are dealing with here.

Russell

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.28018 +1 (Git)
Build type: Release
Branch: mastersync
Hash: 176db30199db7617e3fab150a3c1783413022675
Python 3.8.6+, Qt 5.15.2, Coin 4.0.1, OCC 7.5.0
Locale: English/United States (en_US)
Installed mods: 
  * FC_SU
  * Z_MacroStartup
Russ4262
Posts: 932
Joined: Sat Jun 30, 2018 3:22 pm
Location: Oklahoma
Contact:

Re: Boundary Dressup and Tag Dressup

Post by Russ4262 »

Afternoon.
I found the root of the problem. The problem is that the Boundary Dressup is creating a G1 command for an initial retraction to SafeHeight, instead of a G0. I changed this and the Tag Dressup is now available on top of the Boundary Dressup.

PR in place: Path: Correct beginning retraction to safe height in Boundary Dressup, issue #6279 [Bug]

Additionally, we need to consider adding a warning to the Boundary Dressup that informs the user if the lower Z-boundary value is higher than the Final Depth of the base operation. I would imagine that the vast majority of Boundary Dressup users need X and Y boundaries, but not lower Z boundaries, as this should be set with a Final Depth value in the base operation. For this reason, I think we should add the warning.

The case mentioned in this thread is a good example. It would appear that @imm wants the Profile op to cut beyond the stock depth by a small amount to ensure a clean and full cut. However, the Boundary Dressup applied as it is, is removing the final profile pass below the stock. I do not think this is intended behavior for @imm, but rather a case where the operation should warn the user. Any thoughts?

Russell

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.28018 +1 (Git)
Build type: Release
Branch: fix/boundary_dressup_begin_safeheight_retraction
Hash: 176db30199db7617e3fab150a3c1783413022675 (of FreeCAD/master branch)
Python 3.8.6+, Qt 5.15.2, Coin 4.0.1, OCC 7.5.0
Locale: English/United States (en_US)
Installed mods: 
  * FC_SU
  * Z_MacroStartup
Post Reply