Sketcher: Invalid Constraint error when dimensioning a line, after applying symmetry constraint

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
Dr_Romeo_Chair
Posts: 4
Joined: Fri Jul 15, 2016 4:46 am

Sketcher: Invalid Constraint error when dimensioning a line, after applying symmetry constraint

Post by Dr_Romeo_Chair »

In Sketcher, I get an invalid constraint error when making a horizontal or vertical line symmetric about an axis and then trying to dimension it.

However, if I dimension the line first and then apply the symmetry constraint, all is good.

Steps to reproduce:

1) create new drawing, select Part Design workbench
2) Task Tab->Start Part->Create body
3) Task Tab->Start Body->Create Sketch
4) Select Plane (I chose XY)
5) Draw a horizontal or vertical line
6) Select the vertices of the line, then the axis it would intersect (X for vertical line, Y for horizontal)
7) apply the symmetry constraint
8) Select appropriate vertical or horizontal dimension constraint (or the general length constraint) and apply to the line
9) Enter length, e.g. 20mm and click OK
10) Dimensional Constraint Error Dialog appears ("Datum 20.0 mm for the constraint with index 3 is invalid"):
2022-08-01-freecad-constraint-error01.png
2022-08-01-freecad-constraint-error01.png (100.72 KiB) Viewed 720 times

If you delete the symmetry constraint, dimension the line first and then apply the symmetry constraint, it works perfectly. Also, with a non-horizontal or non-vertical line, it doesn't happen.

Is this a known issue? It seems like a very common operation and I'm seeing it in both 0.19 and 0.20. FWIW, I did try to search for it, but the terms involved are so generic that I got too many hits to sort.

Should I learn how to file a bug and report this?

Thanks
drmacro
Veteran
Posts: 8868
Joined: Sun Mar 02, 2014 4:35 pm

Re: Sketcher: Invalid Constraint error when dimensioning a line, after applying symmetry constraint

Post by drmacro »

Try fixing the redundant error first.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Dr_Romeo_Chair
Posts: 4
Joined: Fri Jul 15, 2016 4:46 am

Re: Sketcher: Invalid Constraint error when dimensioning a line, after applying symmetry constraint

Post by Dr_Romeo_Chair »

Yep, that did it.. thanks
User avatar
mfro
Posts: 663
Joined: Sat Sep 23, 2017 8:15 am

Re: Sketcher: Invalid Constraint error when dimensioning a line, after applying symmetry constraint

Post by mfro »

This is one of the cases where "Auto remove redundants" is meant to make your life easier.

Line endpoint symmetry to a horizontal line implies the line itself must be vertical.
Cheers,
Markus
User avatar
Shalmeneser
Veteran
Posts: 9475
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Sketcher: Invalid Constraint error when dimensioning a line, after applying symmetry constraint

Post by Shalmeneser »

7) apply the symmetry constraint
At this step, you should have a "Redundant constraints" message in the Solver messages window because symmetry implies verticality.
You should use "Auto remove redundants". It's not a bug but a correct behavior of the Sketcher solver.
Post Reply