Bug #2729 False 'redundant constrains' message

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Bug #2729 False 'redundant constrains' message

Post by Kunda1 »

Participants in issue #2729 please continue the thread here. Thank you
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
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Bug #2729 False 'redundant constrains' message

Post by DeepSOIC »

The sketch in question contains tangent connection made by Tangent + Coincident constraint combination. This is very likely the cause of unstable behavior. Such combination is bad for solver, and should be replaced with tangent applied to endpoints (and no need for coincident).
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Bug #2729 False 'redundant constrains' message

Post by cox »

DeepSOIC wrote:Such combination is bad for solver, and should be replaced with tangent applied to endpoints (and no need for coincident).
Could such a combination ever be useful, or is it always unwanted. If the latter case, could such a combination, when detected be converted automatically to equivalent working variety "tangent applied to endpoints"?

I understand that overriding user choices could be a slippery slope. But could there be situations when it could be valuable?
Need help? Feel free to ask, but please read the guidelines first
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug #2729 False 'redundant constrains' message

Post by chrisb »

Every now and then I need both constraints. The attached file shows an existing tangential constraint which works as expected only if I add a coincident constraint as well. If I use polyline to create a sketch (as usual) the problem does not occur.
Attachments
tangentWithoutCoincidence.FCStd
(4.64 KiB) Downloaded 78 times
tangent.png
tangent.png (9.2 KiB) Viewed 3114 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Bug #2729 False 'redundant constrains' message

Post by sgrogan »

chrisb wrote:Every now and then I need both constraints. The attached file shows an existing tangential constraint which works as expected only if I add a coincident constraint as well. If I use polyline to create a sketch (as usual) the problem does not occur.
Isn't this expected. If tangent is applied to the line and arc. The extension of the line segment is tangent to the extension of the arc segment?
Delete the tangent and apply tangent at point works as expected.
Don't delete and apply tangent at point works. Shouldn't tangent be marked as redundant?
This reminds me of the false missing coincidence constraints when using the sketch validate tool if tangent at point or perpendicular are point are used. I thought I had made a feature request on the tracker but I can not find it.
"fight the good fight"
chrisb
Veteran
Posts: 54213
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug #2729 False 'redundant constrains' message

Post by chrisb »

sgrogan wrote:Isn't this expected. If tangent is applied to the line and arc. The extension of the line segment is tangent to the extension of the arc segment?
Delete the tangent and apply tangent at point works as expected.
You are right, it was my fault applying tangent to arc/line and not to the points. I finally understood the concept of tangent-on-points :oops: . In fact it turned out, that until now I didn't get the concept, because I had missed that the tangent applies not only to the extension of the line but to the extension of the arc as well.
So I am sorry to have this turned somehow in a help topic but thank you very much for the explanations.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Bug #2729 False 'redundant constrains' message

Post by DeepSOIC »

cox wrote:
DeepSOIC wrote:Such combination is bad for solver, and should be replaced with tangent applied to endpoints (and no need for coincident).
Could such a combination ever be useful, or is it always unwanted. If the latter case, could such a combination, when detected be converted automatically to equivalent working variety "tangent applied to endpoints"?
Should be possible, I think. There might be unexpected complications, though.
Chukharev
Posts: 9
Joined: Sun Feb 12, 2017 10:35 am

Re: Bug #2729 False 'redundant constrains' message

Post by Chukharev »

DeepSOIC wrote:The sketch in question contains tangent connection made by Tangent + Coincident constraint combination. This is very likely the cause of unstable behavior. Such combination is bad for solver, and should be replaced with tangent applied to endpoints (and no need for coincident).
IMHO known combinations with unstable behaviour should at least be warned about, better yet if a warning suggests an alternative.
A possible way to somwhat improve the solver stability might be trying to reiterate with a small random displacement of points.
I see where a tangent on extension constrain is useful, and I could not find a situation when the combination in hand is different from a tangent on end points constrain.
Please do not forget a constrain on two arcs, and also arcs of ellipse, spline etc.

PS. I was asked to respond in this thread, so bear with me, please.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Bug #2729 False 'redundant constrains' message

Post by DeepSOIC »

Chukharev wrote:A possible way to somwhat improve the solver stability might be trying to reiterate with a small random displacement of points.
Unacceptable. This will cause creep with underconstrained sketches (typically, those are hand-tweaked sketches).
Chukharev wrote:and I could not find a situation when the combination in hand is different from a tangent on end points constrain
An abstract example. A circle tangent to an ellipse can intersect an ellipse at another point, not the point it is tangent at.
coincident-tangent.png
coincident-tangent.png (68.19 KiB) Viewed 3028 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug #2729 False 'redundant constrains' message

Post by Kunda1 »

DeepSOIC wrote:ping
What is in your opinion the fate of issue #2729 then?
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
Post Reply