Sketcher 180°-constraints irritating visual feedback

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Sketcher 180°-constraints irritating visual feedback

Post by ulrich1a »

I am using 180°-constraints in the sketcher for resilient design purposes. I am observing annoying issues with these constraints. I made a polyline and applied 3 times 180°-constraints as shown in the picture below.
180°-Constraints at polyline
180°-Constraints at polyline
constraint180_600x400.png (10.66 KiB) Viewed 3599 times
At adding an additional equality constraint to two of the polylines, all 180°-constraints are not more located at the polyline. They are sitting at the origin in a way not showing any usable information. See picture below:
180°-constraints sitting at origin
180°-constraints sitting at origin
constraints180_origin_600x400.png (5.79 KiB) Viewed 3599 times
If I am applying the equality constraints before making the 180°-constraints, the representation of the 180°-constraints is more confusing. At applying at a zig-zag-line, the original angle is displayed.
constraint180_equality_first_600x400.png
constraint180_equality_first_600x400.png (9.03 KiB) Viewed 3599 times
Do others have the same experience?

Ulrich

OS: Debian GNU/Linux 7.5 (wheezy)
Platform: 32-bit
Version: 0.14.3564 (Git)
Branch: master
Hash: 3f4cbc421766b841cebcdf57a3de9a2c8211070c
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0

edit: made Subject more serious
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sketcher 180°-constraints irritating visual feedback

Post by ulrich1a »

Is it considered an allowed practice to make a 180°-constraint to two parallel lines with no common vertex? This will create sometimes a constraint symbol millions of km away from the sketch. So clicking on "Fit the whole content on screen" will produce a millions km viewport.

Ulrich
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Sketcher 180°-constraints irritating visual feedback

Post by wmayer »

For me the angle constraint also have weird behaviour. But only if the angle is exactly 180 deg. If it's slightly different then everything works normally.
Is it considered an allowed practice to make a 180°-constraint to two parallel lines with no common vertex?
No.
This will create sometimes a constraint symbol millions of km away from the sketch. So clicking on "Fit the whole content on screen" will produce a millions km viewport.
Actually the algorithm should check if the two lines are parallel and give an error message.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sketcher 180°-constraints irritating visual feedback

Post by ulrich1a »

wmayer wrote:Actually the algorithm should check if the two lines are parallel and give an error message.
I am thinking there is some logic that checks for parallel lines and put the 180°-angle-constraint at the origin in this case. But this logic is not working correct.

The 180°-angle-constraint between two lines with a parallel distance is a very useful feature, that allows to make a constraint set without multiple solutions. For example issue http://www.freecadweb.org/tracker/view.php?id=1519 can be solved easily with a 180°-angle-constraint with the horizontal sketch axis, instead of using a horizontal constraint.

Ulrich
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Sketcher 180°-constraints irritating visual feedback

Post by wmayer »

I am thinking there is some logic that checks for parallel lines and put the 180°-angle-constraint at the origin in this case. But this logic is not working correct.
This could mean that there is some round-off errors so that the algorithm find an intersection point of the two lines which of course is far, far away. And next to this intersection point the angle symbol might be added. Just an idea...
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Sketcher 180°-constraints irritating visual feedback

Post by wmayer »

The 180°-angle-constraint between two lines with a parallel distance is a very useful feature, that allows to make a constraint set without multiple solutions. For example issue http://www.freecadweb.org/tracker/view.php?id=1519 can be solved easily with a 180°-angle-constraint with the horizontal sketch axis, instead of using a horizontal constraint.
Therefore you don't need a 180 deg angle-constraint. The same can be achieved by using a 90 deg angle-constraint with a horizontal line and the Y axis.
Is it considered an allowed practice to make a 180°-constraint to two parallel lines with no common vertex?
An angle is only defined between two intersecting lines. Parallel lines don't have an intersection point and thus it makes no sense to define an angle. This must be forbidden by the software.
I am thinking there is some logic that checks for parallel lines and put the 180°-angle-constraint at the origin in this case. But this logic is not working correct.
No, there is no logic. I stepped through the code and what happens is that due to some round-off errors you get two lines which are not 100% parallel. That's why you get an intersection point far outside (~20 km) of the sketch.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Sketcher 180°-constraints irritating visual feedback

Post by ulrich1a »

wmayer wrote:An angle is only defined between two intersecting lines. Parallel lines don't have an intersection point and thus it makes no sense to define an angle. This must be forbidden by the software.
I have filed a bug report. http://www.freecadweb.org/tracker/view.php?id=1550

Ulrich
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Sketcher 180°-constraints irritating visual feedback

Post by wmayer »

The angle constraints issues should be fixed now.
Post Reply