Fehler im Konturfräsen V17 ?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Fehler im Konturfräsen V17 ?
Yeah I noticed that - there's definitely something wrong.
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Fehler im Konturfräsen V17 ?
At first glance there's nothing in findShapeOutline() that uses Vector2d or BoundBox2d. The outline in Taschen.fcstd is still wrong (should be rectangle), but I'm not sure the fix for issue #2858 broke it.sliptonic wrote:Look at the image I added on the ticket. Besides the extra internal line (which shouldn't be there) theres also a small spurious segment in the top corner. This wreaked havoc with that part contour.
Can you post the file that generated the snapshots, please?
wf
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Fehler im Konturfräsen V17 ?
attached.
I select the Pocket002 object and run this macro
I select the Pocket002 object and run this macro
Code: Select all
import TechDraw
from FreeCAD import Vector
sel = Gui.Selection.getSelectionEx()[0]
obj = sel.Object.Shape
contourwire = TechDraw.findShapeOutline(obj,1, Vector(0,0,1))
myObject = FreeCAD.ActiveDocument.addObject("Part::Feature","myObject")
myObject.Shape = contourwire
- Attachments
-
- profiletorturetest.fcstd
- (124.31 KiB) Downloaded 22 times
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Fehler im Konturfräsen V17 ?
Nasty, nasty bug. Involves comparison of bounding boxes and this OCC issue: http://opencascade.blogspot.ca/2009/04/ ... g-box.html
Doesn't seem to be strictly deterministic. I got this from ProfileTortureTest.fcstd: But this from Taschen.fcstd: Anyway, the fix is to not use the bounding boxes to determine relative sizes, but to use the actual enclosed area of the wires.
MIght be a little slower, but should be accurate.
PR will be along shortly.
Doesn't seem to be strictly deterministic. I got this from ProfileTortureTest.fcstd: But this from Taschen.fcstd: Anyway, the fix is to not use the bounding boxes to determine relative sizes, but to use the actual enclosed area of the wires.
MIght be a little slower, but should be accurate.
PR will be along shortly.
Re: Fehler im Konturfräsen V17 ?
The ticket issue #0002858 was opened by wandererfan but I am not sure if there was real problem with the old behaviour. However, it looks like there is now a problem with the new behaviour.
So, for me it's OK to revert the changes and introduce a method isEqual(Vector2d, double) where a tolerance can be passed. IIRC for example the gp_Pnt class of OCC also does an exact check of the coordinates.
So, for me it's OK to revert the changes and introduce a method isEqual(Vector2d, double) where a tolerance can be passed. IIRC for example the gp_Pnt class of OCC also does an exact check of the coordinates.
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Fehler im Konturfräsen V17 ?
I like that.
The new behavior is causing a problem in several of the Path operations that don't use the TechDraw findShapeOutline function. I've been trying to isolate exactly where but it's eluding me so far.
The new behavior is causing a problem in several of the Path operations that don't use the TechDraw findShapeOutline function. I've been trying to isolate exactly where but it's eluding me so far.
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Fehler im Konturfräsen V17 ?
This is the change that breaks findShapeOutline:wmayer wrote:The ticket issue #0002858 was opened by wandererfan but I am not sure if there was real problem with the old behaviour. However, it looks like there is now a problem with the new behaviour.
So, for me it's OK to revert the changes and introduce a method isEqual(Vector2d, double) where a tolerance can be passed. IIRC for example the gp_Pnt class of OCC also does an exact check of the coordinates.
in Base/Vector3D.h
- static inline float_type epsilon() { return FLT_EPSILON; }
+ static inline float_type epsilon() { return DBL_EPSILON; }
FLT_EPSILON 1E-5
static const Standard_Real Precision_Confusion = 1.e-7;
DBL_EPSILON 1E-9
Our test for zero is finer than our calculations.
As far as I can tell Path/CAM doesn't use the FreeCAD Vector2d, so this is probably causing the trouble there too.
Re: Fehler im Konturfräsen V17 ?
Using FLT_EPSILON for a Vector3d which internally uses double (not float) is too rough. So, I will revert the above changes and introduce an isEqual method where you can pass an arbitrary tolerance. This way we will be consistent to OCC's gp_Pnt class.This is the change that breaks findShapeOutline:
in Base/Vector3D.h
- static inline float_type epsilon() { return FLT_EPSILON; }
+ static inline float_type epsilon() { return DBL_EPSILON; }
- wandererfan
- Veteran
- Posts: 6326
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Fehler im Konturfräsen V17 ?
Comparison with tolerance is a good addition to Vector2d and Vector3d.
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Fehler im Konturfräsen V17 ?
Has this been reverted yet? Should I create an issue to track it?wmayer wrote:Using FLT_EPSILON for a Vector3d which internally uses double (not float) is too rough. So, I will revert the above changes and introduce an isEqual method where you can pass an arbitrary tolerance. This way we will be consistent to OCC's gp_Pnt class.This is the change that breaks findShapeOutline:
in Base/Vector3D.h
- static inline float_type epsilon() { return FLT_EPSILON; }
+ static inline float_type epsilon() { return DBL_EPSILON; }