sketcher: wrong redundancy solving with symmetry
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
sketcher: wrong redundancy solving with symmetry
In recent discussions about the sketcher symmetry handling I mentioned an issue I think it is incorrect. Here it is:
- open the attached sketch:
The solver tells you there are redundant constraints.
- now delete the symmetry constraint
The redundancy message is now gone but you get 1 degree of freedom. To eliminate it it is sensible to set the symmetry constraint you just deleted.
It is in my opinion a bug that one cannot set here the symmetry. (I am aware that there are workarounds but for the later development I need a symmetry constraint here, not a dimensional one.)
Can anybody reproduce this?
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17331 (Git)
Build type: Release
Branch: master
Hash: cf18161dc26267c259ac21675cb9637263bf4152
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
- open the attached sketch:
The solver tells you there are redundant constraints.
- now delete the symmetry constraint
The redundancy message is now gone but you get 1 degree of freedom. To eliminate it it is sensible to set the symmetry constraint you just deleted.
It is in my opinion a bug that one cannot set here the symmetry. (I am aware that there are workarounds but for the later development I need a symmetry constraint here, not a dimensional one.)
Can anybody reproduce this?
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17331 (Git)
Build type: Release
Branch: master
Hash: cf18161dc26267c259ac21675cb9637263bf4152
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Re: sketcher: wrong redundancy solving with symmetry
Sorry but (IMO) you're wrong and the solver is correct.
The top arc of your example is redundantly constrained because it's center is coincident to the origin.
This geometrically imposes that :
I see 2 simple ways of being geometrically correct :
The top arc of your example is redundantly constrained because it's center is coincident to the origin.
This geometrically imposes that :
- If its both endpoints are on the same horizontal, the horizontal distance from each endpoint to Y axis is equal
- Oppositely, if its both endpoints are at the same distance from Y axis, they are on the same horizontal (modulo 90° to be strictly precise)
I see 2 simple ways of being geometrically correct :
- Either only apply an horizontal constraint between the 2 arc endpoints => IMO this is the best way
- Or keep the symmetry, remove the coincidence between arc center & origin, then only constraint the arc center to be on the X axis with a point-on-line
Re: sketcher: wrong redundancy solving with symmetry
What baffles me is that solver doesn't complain with the following simple example (arc center is coincident with origin) :
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16110 (Git)
Build type: Release
Branch: (HEAD detached at upstream/releases/FreeCAD-0-18)
Hash: f7dccfaa909e5b9da26bf50c4a22ccca9bb10c40
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
At least with my version :OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16110 (Git)
Build type: Release
Branch: (HEAD detached at upstream/releases/FreeCAD-0-18)
Hash: f7dccfaa909e5b9da26bf50c4a22ccca9bb10c40
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: French/France (fr_FR)
Re: sketcher: wrong redundancy solving with symmetry
More precisely :
- Sketch an arc with its center coincident to origin => Solver says 3 DoF (OK)
- Add a symmetry between its 2 endpoints against the Y axis => Solver says 1 DoF (NOK)
- Drag the arc with mouse => Solver says 2 DoF (OK !!) but doesn't complain (NOK)
Re: sketcher: wrong redundancy solving with symmetry
Here my Solver says 2 DOF remaining.
OS: Ubuntu 18.04.2 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19. <== date is 2019/07/08
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
Re: sketcher: wrong redundancy solving with symmetry
Thanks for having a look. But I cannot follow your argumentation because when I delete the symmetry constraint I get 1 DOF. Then I can change the horizontal and y-position. An example: But as you write: "symmetry against Y axis imposes both conditions (same horizontal + same distance to Y axis)" and this is exactly what I need.
The second one is intuitive and requires additional work -> breaking workflow. The first one is not an option because I need the sypmmetry (sketch will later CCed, arc cut etc.)openBrain wrote: ↑Tue Jul 16, 2019 1:02 pm I see 2 simple ways of being geometrically correct :
- Either only apply an horizontal constraint between the 2 arc endpoints => IMO this is the best way
- Or keep the symmetry, remove the coincidence between arc center & origin, then only constraint the arc center to be on the X axis with a point-on-line
Same here and that fits perfectly to my understanding of the the symmetry constraint .
Re: sketcher: wrong redundancy solving with symmetry
With 0.18 not 0.19 I get correctly only 2 DOF.
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17331 (Git)
Build type: Release
Branch: master
Hash: cf18161dc26267c259ac21675cb9637263bf4152
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
and
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Re: sketcher: wrong redundancy solving with symmetry
My Solver messages report that the Sketch is Over Constrained (not that there are Redundant Constraints).
Other Constraints should be favored over the Symmetry Constraint so to me it would be more sensible to:
1. Apply the Equality Constraint to the two vertical edges, or less desirably,
2. Apply the Symmetry to upper right and lower left vertices, or to upper left and lower right vertices, and the Y-Axis.
Interestingly, if I apply the Symmetry Constraint before the 4mm Horizontal Distance Constraint, there is no problem (one of the Conflicting Constraints probably got deleted).
(I had to make sure I was dealing with the original file)
Re: sketcher: wrong redundancy solving with symmetry
Thanks for testing with 0.19. I expect some things have move on between 0.18 & 0.19. But still the solver doesn't complain, which is weird.
Yep. It depends on whether you use 0.18 or 0.19. I think both are acceptable.
No. There is only one DoF because x & y positions are linked by an equation. You can see the (only) remaining DoF as being the arc apex angle, or the arc chord length.
The question here isn't what you need. The solver don't care of that.But as you write: "symmetry against Y axis imposes both conditions (same horizontal + same distance to Y axis)" and this is exactly what I need.
The question is that constraint set is mathematically (precisely geometrically) correct.
And in this case (an arc with center coincident with origin and with endpoints symmetric against Y axis) there is clearly some redundancy.
UnintuitiveThe second one is intuitive and requires additional work -> breaking workflow. The first one is not an option because I need the sypmmetry (sketch will later CCed, arc cut etc.)
With both of them you have the symmetry. Not displayed for sure, but geometrically imposed by constraint set.
Unfortunately their is no "intuitive" constraint set where you can get the symmetry constraint used as is.
Here again this isn't about how you figure out a symmetry but about what mathematical relation it implies.Same here and that fits perfectly to my understanding of the the symmetry constraint .
If you want to get some idea, sketch an arc and just constraint its 2 endpoints with a symmetry against Y axis(nothing else).
Then try to wiggle everything (the arc, its endpoints, its center) => You absolutely can't have a valid solution where the center is out of the Y axis. Thus any other constraint that will also constraint the center on the Y axis (typically coincidence to origin is one of them) is redundant.
Re: sketcher: wrong redundancy solving with symmetry
Yes, sorry for being incorrect.
1. is no option because I need the symmetry for later actions (sketch will be CCed and the arc will go in the new sketch...)
2. leads here to an over constrained error.
Last edited by uwestoehr on Tue Jul 16, 2019 5:45 pm, edited 1 time in total.