sketcher: wrong redundancy solving with symmetry

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: sketcher: wrong redundancy solving with symmetry

Post by uwestoehr »

bejant wrote: Tue Jul 16, 2019 2:29 pm 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).
Many thanks, this works! :o :
Sketch-symmetry-issue3.FCStd
this works
(9.88 KiB) Downloaded 17 times
So what I want is possible but it matters in which order you apply the constraints. I insist that this cannot be correct. So either it is mathematically over constrained or not. It cannot be that the same set of constraints lead to 2 different results. (I am no mathematician but this is weird for an engineer ;) )

openBrain wrote: Tue Jul 16, 2019 3:43 pm The question here isn't what you need. The solver don't care of that. :)
Sure but apparently the solver can do. I have no clue why the order matters.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: sketcher: wrong redundancy solving with symmetry

Post by openBrain »

uwestoehr wrote: Tue Jul 16, 2019 5:44 pm Sure but apparently the solver can do. I have no clue why the order matters.
It's a bug ! It works but it shouldn't !
Just delete the symmetry on your file and you see 1 DoF while deleting a symmetry should release 2 of them. ;)

EDIT: this is exactly (IMO) the bug I described on this previous post. ;)
openBrain wrote: Tue Jul 16, 2019 1:08 pm
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: sketcher: wrong redundancy solving with symmetry

Post by uwestoehr »

openBrain wrote: Tue Jul 16, 2019 6:27 pm It's a bug ! It works but it shouldn't !
I like this bug :D .

Seriously, do you report the bug or do I?
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: sketcher: wrong redundancy solving with symmetry

Post by chrisb »

There is no need to report this bug, as we have discussed it before. It is one of these "silently drop a redundant constraint" issues.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: sketcher: wrong redundancy solving with symmetry

Post by chrisb »

A correct way of constraining this is to apply a horizontal constraint instead of symmetry. With the center of the arc being on the Y-axis this mathematically implies symmetry.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: sketcher: wrong redundancy solving with symmetry

Post by uwestoehr »

chrisb wrote: Tue Jul 16, 2019 10:48 pm There is no need to report this bug, as we have discussed it before. It is one of these "silently drop a redundant constraint" issues.
I don't agree. The same set of constraints cannot result one time on an over-constraint one time not. This is not how a solver should work. Using the same input parameters it must find the same solution.
chrisb wrote: Tue Jul 16, 2019 10:51 pm A crrect way of constraining this is to apply a horizontal constraint instead of symmetry. With the center of the arc being on the Y-axis this mathematically implies symmetry.
But I already explained twice in this thread why I need a symmetry constraint and not some other methods.
A symmetry is more or less 2 constraints in one and there are good reasons to use this and not a set of 2 other constraints.
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: sketcher: wrong redundancy solving with symmetry

Post by chrisb »

uwestoehr wrote: Tue Jul 16, 2019 10:57 pm
chrisb wrote: Tue Jul 16, 2019 10:48 pm There is no need to report this bug, as we have discussed it before. It is one of these "silently drop a redundant constraint" issues.
I don't agree.
What is it you don't agree with. That we discussed this before? That a bug report is already filed?

But I already explained twice in this thread why I need a symmetry constraint and not some other methods.
Not true. You said it twice, but never explained it.

A symmetry is more or less 2 constraints in one and there are good reasons to use this and not a set of 2 other constraints.
The symmetry is implied if you use a horizontal constraint without redundancies. So it is mathematically there. These points are symmetric.
What you seem to want is to have an additional anticipatory constraint which you can use later when changing something in a carbon copied sketch. That's not how the solver works and not how it should work. In my view it is not sensible to overload a sketch with additional constraints just in case that another sketch may use a more or less reasonable subset of them.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
bejant
Veteran
Posts: 6075
Joined: Thu Jul 11, 2013 3:06 pm

Re: sketcher: wrong redundancy solving with symmetry

Post by bejant »

I went back to the original file that uwestoehr posted, and started to recreate the Sketch (my recreation is Sketch001 in the attached file). Before applying the 4 mm Horizontal Distance Constraint between the upper left Endpoint and the Origin, and before applying a Symmetry Constraint between two Endpoints of one of the Arcs and the Vertical Axis, I applied the Equality Constraint to the two Line Segments. Sketcher reports one remaining DOF, and I agree:

20190716b.png
20190716b.png (31.99 KiB) Viewed 753 times

Using the constraint style of the original Sketch, the missing Constraint is the 4 mm Horizontal Distance Constraint between the upper left Vertex and the Origin.

The centers of both Arcs are Constrained onto the origin, the Arcs are Constrained to have equal radii, and both the Line Segments are Constrained to be Vertical and to be Equal. This creates Symmetry about both the Vertical Axis and the Horizontal Axis, and I can animate that if I drag any Endpoint.

When I apply a Symmetry Constraint between the Endpoints of one Line Segment and the Horizontal Axis, the Solver correctly informs that I've created a Redundant Constraint. This happens for the other line segment too.

But, I can apply a Symmetry Constraint between both Endpoints of one Arc and the Vertical Axis, and the Solver doesn't recognize that I have just created a Redundant Constraint. I think a bug is that the Solver doesn't recognize the forced Symmetry that exists horizontally before that Symmetry Constraint is applied.

20190716a-Sketch-symmetry-issue.FCStd
(11.38 KiB) Downloaded 14 times

Same FC version as before.
kisolre
Veteran
Posts: 4166
Joined: Wed Nov 21, 2018 1:13 pm

Re: sketcher: wrong redundancy solving with symmetry

Post by kisolre »

As I understood from another thread where Abdullah explained it the solver reports redundant constraints IF they can be removed and not add extra DOF. It tries to find such constraints and if fails it silently removes that redundancy from the constraint that caused it (for the symmetry the horizontal part probably).
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: sketcher: wrong redundancy solving with symmetry

Post by openBrain »

uwestoehr wrote: Tue Jul 16, 2019 10:17 pm I like this bug :D .
I figured it out from the beginning of this thread. :lol:
Seriously, do you report the bug or do I?
I think the best at this point it to get the honor of abdullah's opinion. ;) I'll ask for it in a subsequent post so he hasn't too much to read. :)
chrisb wrote: Tue Jul 16, 2019 10:51 pm A correct way of constraining this is to apply a horizontal constraint instead of symmetry. With the center of the arc being on the Y-axis this mathematically implies symmetry.
You're looping back the discussion to its beginning. :?
chrisb wrote: Tue Jul 16, 2019 11:56 pm
uwestoehr wrote: Tue Jul 16, 2019 10:57 pm
chrisb wrote: Tue Jul 16, 2019 10:48 pm There is no need to report this bug, as we have discussed it before. It is one of these "silently drop a redundant constraint" issues.
I don't agree.
What is it you don't agree with. That we discussed this before? That a bug report is already filed?
Sorry chrisb but I also agree we have to do something with this (except if this case is already known and documented). That's OK that the solver can't automatically remove redundant in that case (kisolre's explanation makes sense). But there is something weird that the solver doesn't detect and warn about the redundant constraining. ;)
Post Reply