v.0.18 Sketcher detects redundant constraints vs. v.0.17

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!
otoien
Posts: 87
Joined: Sun Aug 13, 2017 2:38 am

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by otoien »

Interesting - so many possibilities. The mirror will not work with KiCad Stepup though (It is a board outline) as it needs to work directly with the sketch.

As an exercise, I tried to recreate your figure, it seems it is based on arcs and lines used directly instead of fillets. I got pretty far (lots of mouse clicks!), however I could not figure out how you centered the midpoint on the larger arcs. The horizontal constraint mark on the midpoint differs from that of a constraint between two points. It seems related to your comment:
chrisb wrote: Fri Jul 06, 2018 7:24 am I forgot: there is another trick: I applied a vertical constraint to the two points to align them vertically, when I added the additional point on the arc.
Also I am not able to set the radiuses equal to each other without getting redundant constraint errors, same with the tangents between the two arc halves. I have attached the file as far as I got.
Test-sketch-005.FCStd
(6.82 KiB) Downloaded 50 times
-
Edit: I now see that there is a tiny line segment between the arcs (almost zero length lines ;) ) that the horizontal constraint of the "midpoint" of the arc belongs to. Gives me something to work on.
Edit2: But wait, I am obviously confusing myself on which version I am comparing to. Only the first one had two arc halves, so I need to reconsider the steps as the second one has a continuous arc.
-
Edit3: With continuous arcs I was able to create the fully constrained sketch. I now also understand what the quoted comment refers to.
Test-sketch-007.FCStd
Fully constrained solution, simple arcs
(15.36 KiB) Downloaded 46 times
Last edited by otoien on Sat Jul 07, 2018 1:30 am, edited 4 times in total.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by abdullah »

otoien wrote: Fri Jul 06, 2018 12:02 am
Edit: After going through and correcting all the sketches in the project I can confirm that deleting reference constraints will lead to correct identification of the redundant constrains even with quite complicated sketches.

Edit2: In my attempt to play the devils advocate I found one state of editing TestSketch-002 where I had a number of restraints deleted (as I knew which ones to delete from my previous edit attempts) but leaving reference constraints in, with one redundant constraint remaining. Then in the next step of the attached file (TestSketch-004) select and delete reference constraints only and the project changes to report 9 degrees of freedom. Deleting any single of the the 7 reference constraints cannot accomplish this, all 7 have to be deleted.
-
Test-sketch-004.FCStd
-
Thank you! this narrows down a lot the possible issues. The solver has changed considerably in v0.18 to accommodate new functionality, and it must have forgotten something when handling reference constraints.

Bad reporting of DoFs cannot be related to this.

Yes the ticket thing is for Chrisb, he is always helping me with this things :)
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by abdullah »

chrisb wrote: Thu Jul 05, 2018 10:03 pm [I have condensed two examples which might make it easier to search for the bugs.
Thank you !! :D
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by chrisb »

otoien wrote: Fri Jul 06, 2018 11:56 am Edit3: With continuous arcs I was able to create the fully constrained sketch. I now also understand what the quoted comment refers to.
I'm sorry I didn't answer your questions, but you made it! Congratulations.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by chrisb »

I have reworked my proposal, because without the tiny stretches the construction lines were no longer needed. They were only used to define the length of them.
abdullah wrote: Fri Jul 06, 2018 12:33 pm Bad reporting of DoFs cannot be related to this.
And now I see a warning in report view:

Code: Select all

Equality constraints between line and arc are not supported.
I don't see this message in the solver.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by abdullah »

chrisb wrote: Sat Jul 07, 2018 4:43 am And now I see a warning in report view:

Code: Select all

Equality constraints between line and arc are not supported.
I don't see this message in the solver.
The solver is very wise to make you aware of this, look at constraint80, you have an equality between an arc and an axis, that the solver conveniently ignores for you.

Bug: The UI should not allow this to happen, if it is reproducible is a bug for the tracker.

Feature/Improvement for tracker:
- The solver is nice to report it, but it could just tell which constraint number is the offending one (and avoid me the effort of going through all the list of equality constraint in the constraint widget and asking for the elements that the equality is constraining).

What a job you are doing unveiling the little bugs :D :D
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by chrisb »

abdullah wrote: Sat Jul 07, 2018 5:44 am (and avoid me the effort of going through all the list of equality constraint in the constraint widget and asking for the elements that the equality is constraining).
Which should have been my responsibility. I had forgotten about the extended information where edge number -2 should have raised my suspicion.
What a job you are doing unveiling the little bugs :D :D
Thanks, and I have found some other issues concerning selections - which might be worth a new topic, please tell me if you prefer this:
  • When I select with a rectangle selection I don't get all constraints. In the attached image I have made a rectangle selection and none of the tangents was selected.
    selectRect.png
    selectRect.png (8.08 KiB) Viewed 1542 times
  • when I select a single point it doesn't show in 3D view (it's the point in the middle of the arc)
    Bildschirmfoto 2018-07-07 um 10.16.11.png
    Bildschirmfoto 2018-07-07 um 10.16.11.png (12.67 KiB) Viewed 1542 times
  • vice versa it's similar: selecting the point in 3D view doesn't show in the list.
  • if I select a coincidence with the rectangle selection it doesn't show in the list. This works vice versa.
    Bildschirmfoto 2018-07-07 um 10.41.58.png
    Bildschirmfoto 2018-07-07 um 10.41.58.png (26.05 KiB) Viewed 1542 times
Sorry I am still stuck with this slightly outdated version. There is a problem with the compile process.

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.13976 (Git)
Build type: Release
Branch: (HEAD detached at fae0de5)
Hash: fae0de58581694157a97d567c151bdce75d387dc
Python version: 2.7.15
Qt version: 5.11.0
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by chrisb »

otoien wrote: Fri Jul 06, 2018 11:56 am Interesting - so many possibilities.
The fact that you had used more constraints than I made me curious. I found that you have used tangency+coincidence, see the last image above. You should delete both of them, select the endpoints and apply tangency. That gives you the desired result in the intended way.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
otoien
Posts: 87
Joined: Sun Aug 13, 2017 2:38 am

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by otoien »

chrisb wrote: Sat Jul 07, 2018 8:51 am
otoien wrote: Fri Jul 06, 2018 11:56 am Interesting - so many possibilities.
The fact that you had used more constraints than I made me curious. I found that you have used tangency+coincidence, see the last image above. You should delete both of them, select the endpoints and apply tangency. That gives you the desired result in the intended way.
I only used coincidence on one of the arcs where I needed to place a reference point at the middle of the arc, so that I could set a 10mm distance constraint + some cases where it disconnected from the line (see below). However I believe those coincidence constraints are automatically deleted the the tangent is applied (according to the displayed message). I am not sure I understand, when I turn on visibility of all constraints they look identical to me (except that I unintentionally managed to place the construction lines at the bottom higher - should not matter as those lines were placed last and due to the vertical constraint of connecting lines).
-
Left Chris' version, right my version
Left Chris' version, right my version
Clipboard07.jpg (214.79 KiB) Viewed 1536 times
-
Left Chris' version, right my version
Left Chris' version, right my version
Clipboard09.jpg (105.98 KiB) Viewed 1536 times
-
However you are right that the seam in the middle of the arc only displays on your version in 3D view when initially opened. However an error mark is displayed in Combo view (mouse hovering on the mark just displays "error" and nothing is displayed in report view). Turning on display of all constraints and saving under a new name makes the error to go away and so does the seam.
Your version before and after re-saving:
-
Error and seam goes away after resaving.
Error and seam goes away after resaving.
Clipboard08.jpg (151.02 KiB) Viewed 1536 times
-
I made a test, trying to mark both both endpoints of an arc attached to two lines and apply tangency, but got rather unexpected result (arc became circle) or if lines had vertical constraints I got a plethora of duplicate constraint message. During my edit I applied tangent to each end of arc by marking arc and one connecting line and then applied tangent, repeat for the other end.

When doing the edits sometimes line endpoints get disconnected from each other and it is necessary to connect again by applying a coincident constraint (perhaps that is where you point out that tangency can be applied directly?).
-
When I select with a rectangle selection I don't get all constraints. In the attached image I have made a rectangle selection and none of the tangents was selected.
The rectangle selection does not seem to select any constraints to me, only Elements.
--
I updated to the latest development version early today, so I am posting version info again.
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14014 (Git)
Build type: Release
Branch: master
Hash: f0252c80c2f6408e9c64120c24b9de6091ec57fb
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
chrisb
Veteran
Posts: 53933
Joined: Tue Mar 17, 2015 9:14 am

Re: v.0.18 Sketcher detects redundant constraints vs. v.0.17

Post by chrisb »

otoien wrote: Sat Jul 07, 2018 10:55 am I only used coincidence on one of the arcs where I needed to place a reference point at the middle of the arc, so that I could set a 10mm distance
That's not coincidence, thats point-on-object, which is in fact point-on-line-or-arc.

I am not sure I understand, when I turn on visibility of all constraints they look identical to me
Coincidence cannot be identified in 3D view ( except by pulling one of the connected elements)


When doing the edits sometimes line endpoints get disconnected from each other and it is necessary to connect again by applying a coincident constraint (perhaps that is where you point out that tangency can be applied directly?).
That's exactly how it happens. From a geometric point of view it is no problem to have both, because the coincident point lies on both connected lines and lies thus on a tangent of both. However internally there can rise problems because the points are represented with finite precision.

That's why you should select the endpoints when applying tangency in these cases.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply