chrisb wrote: ↑Sat Apr 13, 2019 11:08 pm

The example is nevertheless interesting: I can add a coincidence constraint between the rightmost point of the rectangle and the origin. Before applying the skecth has 1 DOF, the coincidence consumes 2, so the sketch should be overconstrained. Alas it is not.

abdullah wrote: ↑Fri Apr 12, 2019 5:13 pm

ping

This is another example of a

partially redundant constraint.

Sketcherwise a constraint is redundant when the constraint may be removed and arrive to the same DoF.

A sketcher coincident constraint removes 2 DoF. A solver constraint removes 1 DoF. The Sketcher Coincident constraint is implemented as 2 solver constraints.

What can be done does not depend only on the constraint added, but also the preexisting constraints. Let me try to illustrate it with an example. The starting point of the DoF is the same as in this example (only one DoF is missing).

Case A (this case):

I add the coincidence constraint and no other constraint may be removed fully, i.e. there is no other constraint that "removes" just 1 DoF, which is redundant with the coincidence constraint.

You are right to observe that

a part of the coincident constraint is redundant with other constraints. However,

there is no solution from a point of view of the Sketcher with the Sketcher constraints you are using.

There would be two possible ways of working for the solver here:

a) Annoy the user telling him that it does not like the coincidence constraint and asking the user to find another solution. We could provide some list of usual changes. For example, instead of a coincidence constraint, you could have put a horizontal alignment constraint.

b) Transparently remove the redundant part of the coincidence constraint while solving. This is what the solver currently does. It tells you here:

Code: Select all

```
EigenSparseQR, Threads: 1, Vectorization: On, Pivot Threshold: 1e-13, Params: 17, Constr: 18, Rank: 17
DL: tolg: 1e-80, tolx: 1e-80, tolf: 1e-10, convergence: 1e-10, dogLegGaussStep: FullPivLU, xsize: 17, csize: 17, maxIter: 100
DL: stopcode: 1, Success
Sketcher::RedundantSolving-DogLeg-
[b]Sketcher Redundant solving: 1 redundants[/b]
Sketcher::setUpSketch()-T:0
```

It goes like:

* hey there! I have got a rank 17 system with 18 solver constraints. I have made my math and I know I can safely remove one of this solver redundant constraints, because without it the solution converges, so I am doing it transparently just for you. I do this because I know you cannot remove that solver redundant constraint without affecting other solver constraints that are not redundant by removing sketcher constraints.*
So far, in my experience, this (b) is a good solution. If there are corner cases, we could consider to convey this information to the solver messages dialog (solved with partially redundant constraints or something less technical). The thing is that there may be something to be done, like in this case "change coincidence with vertical alignment", but it is not obvious for a user and the solver cannot easily help here, at least as far as the current implementation goes (we could detect that the redundant is a solver horiz part of a coincidence and generate some custom message... maybe). Sometimes there may be no solution with alternative sketcher constraints.

Case B:

I add the coincidence constraint and another constraint may be removed fully, i.e. there is another sketcher constraint that "removes" just 1 DoF, which is redundant with the coincidence constraint. In this case, this sketcher constraint will me marked as redundant and removed either by the user or by the autoremove mechanism.

Bear with me for an example with this sketch.

- Screenshot_20190414_095631.png (44.93 KiB) Viewed 145 times

Do the following modifications to it.

a) Disable redundant autoremoval.

b) Add a horizontal alignment and a vertical alignment constraints between those points (i.e. implement a coincidence constraint with a vertical and a horizontal alignment constraints). The sketcher will complain about redundant, just ignore it.

c) delete the symmetry constraint.

At this point you are missing

**1 DoF**.

e) Readd the symmetry constraint.

At this moment you have

one redundant constraint, the horizontal alignment one. But the solver knows you as a user can get rid of it because it is a

fully redundant sketcher constraint. So it invites you to remove it (if you had the automatic removal option on, it would have been automatically removed).

f) Remove the redundant constraint

Now you have a fully constrained sketch with no partially redundant sketcher constraint:

Code: Select all

```
EigenSparseQR, Threads: 1, Vectorization: On, Pivot Threshold: 1e-13, Params: 17, Constr: 17, Rank: 17
Sketcher::setUpSketch()-T:0
DL: tolg: 1e-80, tolx: 1e-80, tolf: 1e-10, convergence: 1e-10, dogLegGaussStep: FullPivLU, xsize: 11, csize: 11, maxIter: 100
DL: stopcode: 1, Success
Sketcher::Solve()-DogLeg-T:0
```

Hope it makes sense...