[fix included] 2DPocket error with activated outline option
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[fix included] 2DPocket error with activated outline option
Hi,
I'm trying to generate a gcode for a little bit complicated part and get errors with the latest appimage.
I try to break this down to isolate the problems. In the attaches project you see a simple 2D pocket OP with activated outline option.
Without everything is fine. But activated I get:
"9Standard_OutOfRange NCollection_Sequence::Value19Standard_OutOfRange NCollection_Sequence::ValueSomething unexpected happened."
and no path.
Bye
Thorsten
OS: KDE neon User Edition 5.19 (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22474 (Git) AppImage
Build type: Release
Branch: master
Hash: a44f8ffd427fa9b23b1f00dbf62d66cd152cd774
Python version: 3.8.5
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
I'm trying to generate a gcode for a little bit complicated part and get errors with the latest appimage.
I try to break this down to isolate the problems. In the attaches project you see a simple 2D pocket OP with activated outline option.
Without everything is fine. But activated I get:
"9Standard_OutOfRange NCollection_Sequence::Value19Standard_OutOfRange NCollection_Sequence::ValueSomething unexpected happened."
and no path.
Bye
Thorsten
OS: KDE neon User Edition 5.19 (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22474 (Git) AppImage
Build type: Release
Branch: master
Hash: a44f8ffd427fa9b23b1f00dbf62d66cd152cd774
Python version: 3.8.5
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)
- Attachments
-
- pocket2d_outline_error.FCStd
- (21.9 KiB) Downloaded 50 times
Last edited by schnebeck on Fri Sep 25, 2020 7:08 pm, edited 1 time in total.
Re: 2DPocket error with activated outline option
I got the same error, with a meaningless error message.
If I deselect the "Extensions", then everything seems to work correctly. I don't know what "extensions" do for this shape since there is really no place to "extend".
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22474 (Git)
Build type: Release
Branch: master
Hash: a44f8ffd427fa9b23b1f00dbf62d66cd152cd774
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Gene
If I deselect the "Extensions", then everything seems to work correctly. I don't know what "extensions" do for this shape since there is really no place to "extend".
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22474 (Git)
Build type: Release
Branch: master
Hash: a44f8ffd427fa9b23b1f00dbf62d66cd152cd774
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
Gene
Re: 2DPocket error with activated outline option
It extents the outer edges of the pocket. So you do not need to use fancy dress-up stuff to clean a pocket that reaches an outer geometry of the part.
I would like to have this extension config on other Ops, too. If this simply extents a known face or a closed loop of edges building a face, every Op should work with an extended face. E.g. Adaptive Op would profit from this config.
Bye
Thorsten
I would like to have this extension config on other Ops, too. If this simply extents a known face or a closed loop of edges building a face, every Op should work with an extended face. E.g. Adaptive Op would profit from this config.
Bye
Thorsten
Last edited by schnebeck on Mon Sep 21, 2020 8:49 pm, edited 2 times in total.
Re: 2DPocket error with activated outline option
Sorry.
I saw the rounded corners and did not look further.
Gene
I saw the rounded corners and did not look further.
Gene
Re: 2DPocket error with activated outline option
Hi,
some more infos:
I extracted the AppImage and activated debug output in PathPocketShape*.py.
This generates some in-process solids that shows an error in generating a valid edge-loop when using the outline option.
Without outline option I see this solid Its 90° cw rotated but perfectly structured.
Debug log looks like this:
With outline option I see this:
and got this debug messages:
Maybe someone can give a hint howto debug this further.
Bye
Thorsten
some more infos:
I extracted the AppImage and activated debug output in PathPocketShape*.py.
This generates some in-process solids that shows an error in generating a valid edge-loop when using the outline option.
Without outline option I see this solid Its 90° cw rotated but perfectly structured.
Debug log looks like this:
Code: Select all
18:32:18 Free Select
18:32:18 PathPocketShape.DEBUG: ----- areaOpShapes() in PathPocketShape.py
18:32:18 PathPocketShape.DEBUG: Processing... obj.Base
18:32:18 PathPocketShape.DEBUG: type() == Part.Plane
18:32:18 PathPocketShape.DEBUG: -isVertical()
18:32:18 PathPocketShape.DEBUG: Extension(Model-pocket2d-error, Face8, Wire(9,13,28), 2.50, 0
18:32:18 PathPocketShape.DEBUG: _getEdgeNumbers() -> ['9', '13', '28']
18:32:18 PathPocketShape.DEBUG: PathGeom.combineConnectedShapes shape.BoundBox.ZMin: -25.000000000000004
18:32:18 PathPocketShape.DEBUG: self.horizontal pre-shpZMin: -25.000000000000004
18:32:18 PathPocketShape.DEBUG: self.horizontal post-shpZMin: 25.000000000000004
18:32:18 PathPocketShape.DEBUG: Extent values are strDep: 0.0, finDep: -25.000000000000004, extrd: Vector (0.0, 0.0, 25.500000000000004)
Code: Select all
18:24:15 Free Select
18:24:15 PathPocketShape.DEBUG: ----- areaOpShapes() in PathPocketShape.py
18:24:15 PathPocketShape.DEBUG: Processing... obj.Base
18:24:15 PathPocketShape.DEBUG: type() == Part.Plane
18:24:15 PathPocketShape.DEBUG: -isVertical()
18:24:15 PathPocketShape.DEBUG: Extension(Model-pocket2d-error, Face8, Wire(9,13,28), 2.50, 0
18:24:15 PathPocketShape.DEBUG: _getEdgeNumbers() -> ['9', '13', '28']
18:24:15 PathPocketShape.DEBUG: PathGeom.combineConnectedShapes shape.BoundBox.ZMin: -25.000000000000004
18:24:15 PathPocketShape.DEBUG: PathGeom.combineConnectedShapes shape.BoundBox.ZMin: -25.000000000000004
18:24:15 PathPocketShape.DEBUG: self.horizontal pre-shpZMin: -25.000000000000004
18:24:15 PathPocketShape.DEBUG: self.horizontal post-shpZMin: 25.000000000000004
18:24:15 PathPocketShape.DEBUG: Extent values are strDep: 0.0, finDep: -25.000000000000004, extrd: Vector (0.0, 0.0, 25.500000000000004)
18:24:15 19Standard_OutOfRange NCollection_Sequence::Value19Standard_OutOfRange NCollection_Sequence::ValueSomething unexpected happened. Check project and tool config.
Bye
Thorsten
Re: 2DPocket error with activated outline option
This fixed it for me:
I do not have any knowledge about this stuff - this is just copied from other FreeCAD code fragments and tested.
So its just a "works for me"
HTH
Thorsten
Code: Select all
diff -u master/PathPocketShape.py my/PathPocketShape.py
--- master/PathPocketShape.py 2020-09-25 20:10:10.976224628 +0200
+++ my/PathPocketShape.py 2020-09-25 20:09:06.771990280 +0200
@@ -648,7 +648,19 @@
PathLog.debug('PathGeom.combineConnectedShapes shape.BoundBox.ZMin: {}'.format(shape.BoundBox.ZMin))
if obj.UseOutline:
wire = TechDraw.findShapeOutline(shape, 1, FreeCAD.Vector(0, 0, 1))
- wFace = Part.Face(wire)
+
+ elist = wire.Edges
+ mywire = Part.Wire(Part.__sortEdges__(elist))
+
+ uniqueEdges = []
+ for edge in mywire.Edges:
+ if any(PathGeom.edgesMatch(edge, e) for e in uniqueEdges):
+ continue
+ uniqueEdges.append(edge)
+ w = Part.Wire(uniqueEdges)
+
+ wFace = Part.Face(w)
+
if wFace.BoundBox.ZMin != shpZMin:
wFace.translate(FreeCAD.Vector(0, 0, shpZMin - wFace.BoundBox.ZMin))
self.horizontal.append(wFace)
So its just a "works for me"
HTH
Thorsten
Re: [fix included] 2DPocket error with activated outline option
Would be nice if someone from the "big guns" takes a look. If this fixes a problem maybe its useful for others toosliptonic wrote:ping
Bye
Thorsten
Re: [fix included] 2DPocket error with activated outline option
Hi Thorsten,
sorry about the late reply - I looked at your change and unfortunately I think there is a bit of hole. Part.sortEdges (AFAIK) does not necessarily return the outline as the first wire - yet the outline is what is required here. It seems to do the trick for your model but that cannot be generalised.
What we should try is figure out why the TechDraw.findOutlineShape does not return the correct outline.
sorry about the late reply - I looked at your change and unfortunately I think there is a bit of hole. Part.sortEdges (AFAIK) does not necessarily return the outline as the first wire - yet the outline is what is required here. It seems to do the trick for your model but that cannot be generalised.
What we should try is figure out why the TechDraw.findOutlineShape does not return the correct outline.
Maybe somebody from the TechDraw team can have a look.wandererfan wrote: ping
Re: [fix included] 2DPocket error with activated outline option
FTFY @mlampert
wandererfan wrote: pinged by pinger macro
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs