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: 2738
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug #2729 False 'redundant constrains' message

Postby Kunda1 » Thu Jun 15, 2017 4:52 pm

Chukharev wrote:IMHO known combinations with unstable behaviour should at least be warned about, better yet if a warning suggests an alternative.
DeepSOIC wrote:ping
Should FC provide a warning in this scenario?
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: 5906
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Bug #2729 False 'redundant constrains' message

Postby DeepSOIC » Sat Jun 17, 2017 9:21 am

Kunda1 wrote:Should FC provide a warning in this scenario?
I think yes, it can be done.
abdullah
Posts: 2425
Joined: Sun May 04, 2014 3:16 pm

Re: Bug #2729 False 'redundant constrains' message

Postby abdullah » Sat Jun 17, 2017 10:40 am

A while ago I thought about automatic conversion too, but I discarded the idea because exactly what DeepSOIC shows in his screenshot. There is no way to my knowledge for the solver or the sketcher code to know whether the user intends the tangency at the endpoint or not, unless and endpoint-to-endpoint tangency is used.

Solutions can go into the following directions:
a) Change the solver edge tangency constraint to another expression that does not show the behaviour, if such alternative expression exists => (probability of happening under 1/1000).

b1) Every time a redundant constraint happens and there are edge tangencies with endpoints, annoy the user with a pop-up with an hypothesis of why this may be happening that is not always accurate. Potentially, the pop up can have a button "stop annoying me, I already learned the lesson" (Probability of happening under 1/1000).

b2) Alternatively make the tangency button disabled until the user reads the documentation of tangency, with three confirmation "ok" buttons one after the other and making sure the user read the whole by scrolling no more than 1 line every 30 seconds and requiring to scroll until the end of the explanation (commercial software license style). (Probability of happening: zero, but it was fun thinking about it :lol: )

c) Educate the user somehow (forum, documentation, tutorials, linking a help webpage about redundant constraints directly in the solver messages,...) (Probability of happening => it is happening!! Everyday tens of satisfied new users learn the lesson thanks to the forum and the documentation. Let's be honest, mostly the forum. I guess some of the regular educators there already have a written paragraph stored in the computer for this one).

Now seriously, I think we cannot close the ticket because we do have a bug (unless we close with "won't fix", which I really do not like). It is the kind of ticket that is waiting for an inspired smart guy (TM), along with all the other solver tickets that create trouble.
Jee-Bee
Posts: 1210
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Bug #2729 False 'redundant constrains' message

Postby Jee-Bee » Sat Jun 17, 2017 7:48 pm

I don't know if this is a solution in this case... Makes it sense to make a difference in the solver for two cases:
  • if selected two lines or one line and one point it creates just a normal tangend
  • if selected two points it creates a end point to end point tangend
abdullah
Posts: 2425
Joined: Sun May 04, 2014 3:16 pm

Re: Bug #2729 False 'redundant constrains' message

Postby abdullah » Mon Jun 19, 2017 11:16 pm

Jee-Bee wrote:
Sat Jun 17, 2017 7:48 pm
I don't know if this is a solution in this case... Makes it sense to make a difference in the solver for two cases:

if selected two lines or one line and one point it creates just a normal tangend
if selected two points it creates a end point to end point tangend
The solver clearly understands those two cases. The user is the one that does not understand that there are two separate tangency implementations in the solver and that the solver can not switch to the one that the user intends as it does not know which one the user intends.

The problem, afaiu, arises when an endpoint tangency is intended, but instead of using the endpoint workflow, the user selects an edge to edge tangency followed by an endpoint-to-endpoint coincidence. While it is "easy" to detect this edge-to-edge tangency + coincidence, it is not easy to determine whether the user intended it or created it by mistake.

It is always an option to increase the verbosity of the solver to raise the issue, but it is something like "hey guy! You have got a redundant. I have no clue whether this tangency + coincidence that you have here (see constraints 30, 31) is the issue or not because I have no clue what you actually want to do, sometimes it is, sometimes it is not". I just do not think such a solution is refined enough as to be implemented.
Jee-Bee
Posts: 1210
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Bug #2729 False 'redundant constrains' message

Postby Jee-Bee » Tue Jun 20, 2017 6:27 am

Thanks @abdullah i understand it know
User avatar
Kunda1
Posts: 2738
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bug #2729 False 'redundant constrains' message

Postby Kunda1 » Wed Jun 28, 2017 2:32 pm

Kunda1 wrote:
Wed May 10, 2017 12:03 pm
DeepSOIC wrote:ping
What is in your opinion the fate of issue #2729 then?
@DeepSOIC when I get a moment, would you mind weighing back in on this issue? Thanks!
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
Chukharev
Posts: 9
Joined: Sun Feb 12, 2017 10:35 am

Re: Bug #2729 False 'redundant constrains' message

Postby Chukharev » Mon Sep 11, 2017 11:52 am

IMNSHO if (1) a message 'redundant constraints' is shown, (2) an edge tangent constraint is used, and (3) a coincident constraint is used, then a longer explanation can be added to the message. Something like "Edge Tangent + Coincident combination causes solver instability. When possible, use Endpoint Tangent constraint or some other combinations."
Probably, an extra condition might be used: (4) none endpoint tangent constraint used .

This is the same as abdullah mentions as point b1). I do not understand what pop-ups have to do with this, I see the messages in the 'Solver messages' window only, and they are not annoying at all. There is always some message there...
DeepSOIC wrote:
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).
Out of curiosity, do you have an example, how an under-constrained sketch can be accepted by the solver if the re-iteration is only applied to over-constrained sketches?
I did use an intentional misalignment of the points in my scripts while being unaware of existence of the endpoint tangent. Can this workaround be recommended in the above discussed message?
abdullah
Posts: 2425
Joined: Sun May 04, 2014 3:16 pm

Re: Bug #2729 False 'redundant constrains' message

Postby abdullah » Fri Apr 27, 2018 9:59 am

In the meantime the tangecy+coincident automatic conversion to endpoint tangency was implemented and merged into master. This should then be fixed.
Jee-Bee
Posts: 1210
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Bug #2729 False 'redundant constrains' message

Postby Jee-Bee » Fri Apr 27, 2018 12:46 pm

abdullah wrote:
Fri Apr 27, 2018 9:59 am
In the meantime the tangecy+coincident automatic conversion to endpoint tangency was implemented and merged into master. This should then be fixed.
I would say it is the other way around... end point tangency is tangecy + coincident... isn't it?