Bug #2729 False 'redundant constrains' message

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
Kunda1
Posts: 3237
Joined: Thu Jan 05, 2017 9:03 pm

Bug #2729 False 'redundant constrains' message

Postby Kunda1 » Fri Jan 13, 2017 12:05 am

Participants in issue #2729 please continue the thread here. Thank you
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
DeepSOIC
Posts: 6076
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Bug #2729 False 'redundant constrains' message

Postby DeepSOIC » Fri Jan 13, 2017 12:53 am

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: 950
Joined: Wed Nov 26, 2014 11:37 pm

Re: Bug #2729 False 'redundant constrains' message

Postby cox » Sun Jan 15, 2017 11:43 am

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
Posts: 11420
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug #2729 False 'redundant constrains' message

Postby chrisb » Sun Jan 15, 2017 5:36 pm

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 26 times
tangent.png
tangent.png (9.2 KiB) Viewed 1369 times
User avatar
sgrogan
Posts: 4563
Joined: Wed Oct 22, 2014 5:02 pm

Re: Bug #2729 False 'redundant constrains' message

Postby sgrogan » Sun Jan 15, 2017 5:58 pm

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.
chrisb
Posts: 11420
Joined: Tue Mar 17, 2015 9:14 am

Re: Bug #2729 False 'redundant constrains' message

Postby chrisb » Sun Jan 15, 2017 6:41 pm

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.
DeepSOIC
Posts: 6076
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Bug #2729 False 'redundant constrains' message

Postby DeepSOIC » Sun Jan 15, 2017 7:28 pm

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

Postby Chukharev » Sun Feb 12, 2017 11:33 am

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.
DeepSOIC
Posts: 6076
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Bug #2729 False 'redundant constrains' message

Postby DeepSOIC » Sun Feb 12, 2017 1:17 pm

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 1283 times
User avatar
Kunda1
Posts: 3237
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug #2729 False 'redundant constrains' message

Postby Kunda1 » Wed May 10, 2017 12:03 pm

DeepSOIC wrote:ping
What is in your opinion the fate of issue #2729 then?
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features