The problem is not with the placement of the of the model itself, but where the CNC path ends up. That's why it is a little bit hard to describe. I did say that the location of stepdown is important in the original post though. This means that just changing to a different tool diameter can lead to (or remove) a buggy path depending on where the path ends up to be. The same is true for the extra offset that can be specified for a profile operation. If it makes the profile's CNC path start fall onto an axis, you get the buggy path.
[BUG] Profile with stepdown buggs out when CNC path startpoint is on x=0 or y=0
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: [BUG] Profile with stepdown buggs out when CNC path startpoint is on x=0 or y=0
Re: [BUG] Profile with stepdown buggs out when CNC path startpoint is on x=0 or y=0
The problem is that OCC is not managing Path entities that usually relies when creating a path on LibArea, but the real internal working is not clear to me actually.
suppose "profile" and "pockets" are calculated by "libArea" for what I know and from the description in:
https://github.com/danielfalck/libarea
"3d operation" are using "OpenCamLib"
https://wiki.freecadweb.org/OpenCamLib
There are some discussion in this forum about some improvement, and standardization, modularisation of the code base, sadly there are no "in deep explanation" on how things are calculated (how path are calculated in the code) around, or maybe I have missed something.
EDIT:
Some analysis lead me to find this in:
https://github.com/FreeCAD/FreeCAD/blob ... hAreaOp.py
around line 225
and in around line 271
But as usual without some intervention of @sliptonic these are only suppositions, even if these are the real point where the start point is set is a mere suppostion, as it is difficult to follow the workflow of Path creation.
Some information could be guessed from Getting Path from Shape in wiki page:
https://wiki.freecadweb.org/Path_scripting
But in this case is it not clear if the Path obtained is simply a path derived from the wire, it seems not taking in account tool diameter so it is more an engraving path than a profile path.
Regards
Carlo D.
suppose "profile" and "pockets" are calculated by "libArea" for what I know and from the description in:
https://github.com/danielfalck/libarea
"3d operation" are using "OpenCamLib"
https://wiki.freecadweb.org/OpenCamLib
There are some discussion in this forum about some improvement, and standardization, modularisation of the code base, sadly there are no "in deep explanation" on how things are calculated (how path are calculated in the code) around, or maybe I have missed something.
EDIT:
Some analysis lead me to find this in:
https://github.com/FreeCAD/FreeCAD/blob ... hAreaOp.py
around line 225
Code: Select all
if self.endVector is not None:
pathParams['start'] = self.endVector
elif PathOp.FeatureStartPoint & self.opFeatures(obj) and obj.UseStartPoint:
pathParams['start'] = obj.StartPoint
and in around line 271
Code: Select all
if self.endVector is None:
V = hWire.Wires[0].Vertexes
lv = len(V) - 1
pathParams['start'] = FreeCAD.Vector(V[0].X, V[0].Y, V[0].Z)
if obj.Direction == 'CCW':
pathParams['start'] = FreeCAD.Vector(V[lv].X, V[lv].Y, V[lv].Z)
else:
pathParams['start'] = self.endVector
Some information could be guessed from Getting Path from Shape in wiki page:
https://wiki.freecadweb.org/Path_scripting
But in this case is it not clear if the Path obtained is simply a path derived from the wire, it seems not taking in account tool diameter so it is more an engraving path than a profile path.
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/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: [BUG] Profile with stepdown buggs out when CNC path startpoint is on x=0 or y=0
I believe LibArea was replaced several years ago with PathArea.
Gene
Gene
Re: [BUG] Profile with stepdown buggs out when CNC path startpoint is on x=0 or y=0
Evening,
I put in a Python fix for this, PR #5343, Path: Fix open edge zero value start point.
If some of the C++ coders want to fix this upstream, please feel free. The proposed PR fixes this in the Python, in the PathArea module in the _buildProfileOpenEdges() method.
Thanks,
Russell
I put in a Python fix for this, PR #5343, Path: Fix open edge zero value start point.
Thanks for reporting this bug!
If some of the C++ coders want to fix this upstream, please feel free. The proposed PR fixes this in the Python, in the PathArea module in the _buildProfileOpenEdges() method.
Thanks,
Russell
Re: [BUG] Profile with stepdown buggs out when CNC path startpoint is on x=0 or y=0
I took a look at the C++ code and made, what I believe is, a fix here (description in the commit message). It tries to fix the root cause of the issue. But since it changes the behavior of Path.fromShapes and toPath it's hard to know what its effects on other operations are. The nice thing about Russ' fix is that it's very localized to the open edge code.
I would be grateful if someone with more experience with the FreeCAD code could take a look at and comment on my suggested fix.
I would be grateful if someone with more experience with the FreeCAD code could take a look at and comment on my suggested fix.
Re: [BUG] Profile with stepdown buggs out when CNC path startpoint is on x=0 or y=0
Evening.
Thanks for taking a look at the C++, the source of the bug. I am completely in favor of fixing this in the C++ rather than on the python side. Unfortunately, my C++ skills are almost null, apart from the zero knowledge I have of the C++ source code for FreeCAD. I also ask that those comfortable with the C++ source take a look and review your proposed fix.
Great work!
Russell