request: detect and show where in the sketch constraints are missing

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!
Jee-Bee
Posts: 2145
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: request: detect and show where in the sketch constraints are missing

Postby Jee-Bee » Tue Sep 01, 2020 12:57 pm

It is a request that pop up once in a while.
What i can remember from previous request it sounds easy, for the solver it is more difficult.

Basically it is a ## equations, ## unknowns problem.
For every line segment 4 constraints (X_start,Y_start,x_end, y_end) are needed and for every arc 5(x_center, y_center, radius, angle_start, angle_end) or 6(X_start,Y_start,x_end, y_end, x_center, y_center) constraints(X_start,Y_start,x_end, y_end, x_center, y_center).
So 100 or more equations is easaly reached.
I remember that @Abdullah said that it was possible but it requested more from the solver (becomes slower). And that it was not high on his priority list.

If you think it is interesting and you want to spend your time in it... It would be great. But the sketcher solver isn't easy i guess
abdullah
Posts: 3583
Joined: Sun May 04, 2014 3:16 pm

Re: request: detect and show where in the sketch constraints are missing

Postby abdullah » Sun Sep 06, 2020 5:13 pm

chrisb wrote:
Tue Sep 01, 2020 11:40 am
ldries46 wrote:
Tue Sep 01, 2020 10:03 am
An element that is not constraint is white. If it is a line then if only the direction is known the line is green, the endpoints red. for each point if the position of then point is fully constraint that point is green else red. This means that during sketching and later on constraining you can immediately see where constraining is still necessary.
If an element is overconstrained it becomes purple.
That doesn't sound bad - probably with different colors, but let's hear Abdullah if that matches the concept of the current Sketcher/solver.
Abdullah wrote:ping
The idea is very nice. Incorporating that concept into the sketcher in its current form requires substantial work though.

I am in favour of making a ticket for a feature request.

This year is becoming an annus horribilis for my FreeCAD Sketcher Development as do not manage to make free time for programing. There is a long time that I want to bring multilayer support (in part to improve carbon copy) and defining external geometry, but I simply fail to. Let's hope for October...
abdullah
Posts: 3583
Joined: Sun May 04, 2014 3:16 pm

Re: request: detect and show where in the sketch constraints are missing

Postby abdullah » Sun Sep 06, 2020 5:22 pm

Jee-Bee wrote:
Tue Sep 01, 2020 12:57 pm
I remember that @Abdullah said that it was possible but it requested more from the solver (becomes slower). And that it was not high on his priority list.
You are a good listener.

Apart from requiring major work, there is the issue of the QR sparse vs dense factorisation, which involves a runtime penalty (I did not manage to obtain the necessary information from sparse QR, which is substantially faster as the sketcher becomes complex). I have some ideas, such as running a dense QR decomposition in a separate thread in parallel with the sparseQR+Dogleg/LM (vague idea at this point), or having a checkbox to enable/disable the feature if the user detects the solving drags the design (even better autoenabling/disabling the feature depending on previous solver execution times)...
chrisb
Posts: 29060
Joined: Tue Mar 17, 2015 9:14 am

Re: request: detect and show where in the sketch constraints are missing

Postby chrisb » Mon Sep 07, 2020 4:06 pm

ldries46 wrote:
Tue Sep 01, 2020 10:03 am
...
Can you create the feature request and crosslink it to this topic?
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.