Is this a bug with tangency?

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
sliptonic
Veteran
Posts: 3450
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Is this a bug with tangency?

Post by sliptonic »

If I create two unconnected segments both with a horizontal constraint on them, select them, and apply a tangent (co-linear) constraint, the constraint seems to be applied but not solved. No error either.

However, If the segments don't have the horizontal contraints applied, it works as expected. Applying the horizontal constraint after continues to work.

If the segments both have the horiz constraint and I select one segment and a vertex from the other, the constraint is applied and solved as expected.

Bottom line, one way or the other, I can get two segments to be co-linear, but the behavior isn't consistent. I'm wondering if this is intended behavior or a bug. If the latter, I'll add a report on mantis.
wmayer
Founder
Posts: 20113
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Is this a bug with tangency?

Post by wmayer »

OK, I can confirm what you observed. The important point is that you select the lines and apply the tangency. If you select the end points instead then the tangency always works independent of the horizontal constraint set or not.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Is this a bug with tangency?

Post by abdullah »

Feel free to create a mantis ticket and assign it to me. I will come back to it when I have some coding time available.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Is this a bug with tangency?

Post by triplus »

sliptonic wrote:If I create two unconnected segments both with a horizontal constraint on them, select them, and apply a tangent (co-linear) constraint, the constraint seems to be applied but not solved. No error either.

However, If the segments don't have the horizontal contraints applied, it works as expected. Applying the horizontal constraint after continues to work.

If the segments both have the horiz constraint and I select one segment and a vertex from the other, the constraint is applied and solved as expected.

Bottom line, one way or the other, I can get two segments to be co-linear, but the behavior isn't consistent. I'm wondering if this is intended behavior or a bug. If the latter, I'll add a report on mantis.
This sound similar to what was discussed here:

viewtopic.php?f=10&t=12599#p101204
User avatar
sliptonic
Veteran
Posts: 3450
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Is this a bug with tangency?

Post by sliptonic »

issue #0002284 created. Either I don't have permission to assign or I don't have a clue how to do that :oops: Thanks abdullah.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Is this a bug with tangency?

Post by jmaustpc »

sliptonic wrote:bug 0002284 created. Either I don't have permission to assign or I don't have a clue how to do that :oops: Thanks abdullah.
Assigned to Abduallah...
thanks for writing up the ticket...

Jim
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Is this a bug with tangency?

Post by abdullah »

I am with this now. There are several issues:

1. No error is shown when there is obviously an issue

2. There is a problem with the solver. As DeepSOIC says this introduces a redundancy in the linear system. We are aware that these cases exist and are not easy to fix. However, having a collection of sketches that make the solver misbehave is the only way of actually eventually solving them... Thanks for reporting this.

NOTE to Mantis adms: Is there a way of creating a tag "solver issues" or similar, so that we can actually tag mantis tickets and retrieve them easily?

I will debug 1 now.

Unrelated to the bug itself, if I want co-linearity between horizontal lines, I normally use point on object (one end of one line, on the other line). I try to minimize the usage of tangency except when absolutely necessary. No reason, however why it should not work.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Is this a bug with tangency?

Post by abdullah »

About 1)

Branch contains a fix:
https://github.com/abdullahtahiriyo/Fre ... ue_0002284

so that it is shown like this:
Solver_errors.png
Solver_errors.png (47.24 KiB) Viewed 3103 times
I have changed the text colour for solved and unsolved so that it can be seen more clearly :).

Please check if this behaviour is acceptable, so that I do a pull request.

About 2)

Definitely the solvers have a problem with that definition of tangency. As all solvers have it, maybe the definition of the constraint (error/gradient) does not work great in that specific situation. The fact that selecting the points tangency, which is implemented using DeepSOIC's AngleViaPoint also seems to point in that direction. This issue remains for further investigation, when we revisit the solvers.
Post Reply