Commit Graph

127 Commits

Author SHA1 Message Date
Abdullah Tahiri
1f46b72491 Part: Geometry - encapsulate construction access 2020-10-25 03:52:51 +01:00
Abdullah Tahiri
31b1ad874f Sketcher: Augment malformed constraint messages
===============================================

Enable a user recomputing an object/document to identify which sketch has the malformed constraints.
2020-07-02 19:54:15 +02:00
wmayer
bb86fe18e6 Sketcher: [skip ci] fix -Wimplicit-fallthrough= 2020-06-10 13:09:58 +02:00
luz.paz
b2ffebf1c0 Sketcher: [skip ci] fix header uniformity
This PR fixes header uniformity across all Sketcher WB files
2019-12-22 01:00:29 +01:00
asapelkin
e951094af9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
Abdullah Tahiri
20a83b82f6 Sketcher: Solver interface of activated state 2019-06-22 08:26:31 +02:00
Abdullah Tahiri
95788dde71 Sketcher: PCH 2019-05-02 07:12:27 +02:00
Abdullah Tahiri
5f42b8216f Sketch: Verbose to console output malformed constraints that are ignored by the solver 2019-04-24 17:56:37 +02:00
wmayer
32c527c5a6 PVS: V547 Expression is always true/false 2019-03-12 18:33:26 +01:00
Abdullah Tahiri
88228d6d25 Fixes #3762 2019-02-15 19:08:44 +01:00
Abdullah Tahiri
7d8e566264 Sketcher: fixes #3762 2019-01-12 17:26:19 +01:00
wmayer
56db19824e Replace Base::Exception with appropriate subclass 2018-11-14 19:27:52 +01:00
Markus Lampert
0b40519f3f Changed all catch types to references for polymorphic exceptions. 2018-08-08 15:45:30 +02:00
Abdullah Tahiri
1e2df1054c Solver: Support for Diameter constraint 2018-07-30 00:47:20 +02:00
wmayer
b77b77c0de fix -Wmaybe-uninitialized 2018-06-09 12:05:19 +02:00
wmayer
63cefaf4a6 fix const correctness 2018-05-31 12:49:23 +02:00
Abdullah Tahiri
9926105643 Solver: solver sketch level support for driven constraints and parameters
- Support for addition of driving information to GCS constraints
- Support for keeping track of value parameters of driven constraints
- Support for getting which QR algoritm is being used at GCS level
2018-05-31 11:40:16 +02:00
Abdullah Tahiri
ed25902e12 Solver: Solver Sketch level dependent parameters and solver geometric element management 2018-05-31 11:39:15 +02:00
Abdullah Tahiri
468946bcde Sketcher: Fix crash on applying dimensional constraint to external element 2018-05-27 19:43:05 +02:00
wmayer
73522c3d10 fix scan coverity issues 2018-02-10 14:29:49 +01:00
luz.paz
23bf7f39a3 Sketcher: comment typos
Found via `codespell`
[skip ci]
2018-01-25 18:47:34 -02:00
wmayer
38da0c7312 improve whitespace, fix const correctness 2018-01-23 00:40:41 +01:00
Abdullah Tahiri
c7b137fe85 Sketcher: Change nomenclature relating to Block constraint 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
34f533b0e1 Sketcher: Block Constraint - Advanced redundant/conflict redundant handling
===========================================================================

Block constraint is naturally redundant/conflicting with almost any other constraint applied to an edge (certainly with constraints operating only on that element).

As such, a block constraint will have very little applicability in absence of a way to handle this redundancy/conflicting. For example, in the case of a BSpline all its
internal geometry (construction circles on poles and its constraints) would have to be removed before locking. This would mean that it is not possible to define the BSpline shape
and then block it, as when removing the internal geometry the shape would be lost. In other cases, like temporally blocking to avoid that a part of the sketch moves while performing some
operation with the idea of afterwards unblocking it, it would mean removing all constraints, to add the block constraint, then perform the action, then remove the block constraint and manually
constraint it again.

Handling this situation in a user expected way means ignoring certain constraints (those causing the redundancy/conflicting), so that the solver is not aware of them and does not complain. However,
generally ignoring those constraints has a negative effect, in that constraints applied by the user on already blocked geometry, or constraints that otherwise lead to a conflicting or redundant
situation as a consequence of actions (further constraining) after the Block constrain is applied are ignored, thereby not properly informing the user of this situation, which is undesirable.

This new mechanism takes account on the position of the constraints relative to the involved blocked constraint(s). As such, redundant/conflicting constraints that were added before the Block
constraint are ignored, whereas those constraints that lead to a redundant/conflicting situation and added AFTER the block constraint was already in place, those are not ignored and are reported
accordingly.
2018-01-22 22:52:56 +01:00
Abdullah Tahiri
48fc503364 Sketcher: Blocked Constraint solver level 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
ec678e234e Sketcher: Solver angle -pi,pi conversion corrected
fixes #3288
2018-01-01 20:28:53 +01:00
wmayer
88b5af4fe7 simplify debugging of changing datum constraints 2017-12-31 11:48:44 +01:00
luzpaz
048c787e32 Sketcher: comment typos 2017-12-25 10:59:48 +01:00
Abdullah Tahiri
9b781f9c54 Sketcher Solver: Means to reset the initilization of movement
=============================================================

Just amazed it was working "so well" without never reseting to zero this.

It might bring advantages and close bugs... who knows!
2017-12-12 22:20:27 +01:00
Abdullah Tahiri
ad855c99e3 Sketcher: New Setting for improved dragging mode 2017-12-12 22:20:27 +01:00
Abdullah Tahiri
023e319b84 Sketcher: Clean code and adapt previous solution only to non-relative cases
===========================================================================

Cleaning up ViewProviderSketch, as relative mode is never used for points.

Adapting the recalculation of the initial solution only to non-relative cases.

For relative movement cases (movePoint with relative=true) no cases where such a solution will be advantageous have been identified
and applying a similar solution involves changing the current behaviour too much, as to run the risk of introducing further bugs.

Decision to be revised if such cases where an advantage can be found are discovered.
2017-12-12 22:20:27 +01:00
Abdullah Tahiri
eff8529ec6 Sketcher: jumping while dragging - force recalculate initial solution
=====================================================================

fixes #1734

Upon dragging, the initial solution is first calculated and them DogLeg is left with the work of solving for a solution next to the initial solution.

When the change is too big and the gradients are no longer accurate to continue dragging, the dragging flips and jumps.

The solution offered here is, not to update always the solution, as this also creates artifacts, but update it if the dragging goes beyond 20 times the initial dragging distance.

https://forum.freecadweb.org/viewtopic.php?f=3&t=7589#p203580

https://forum.freecadweb.org/viewtopic.php?f=3&t=7589#p203712
2017-12-12 22:20:27 +01:00
wmayer
adfcd154c6 fixes #0003176: Sketcher: always over-constrained when referencing external B-Spline 2017-12-02 13:02:42 +01:00
luzpaz
987b8db0b5 More typos, grammar fixes, uniformity 2017-11-15 10:46:43 -05:00
Abdullah Tahiri
eefc51ee7a Sketcher: Force solver to return non-driving angles in [-pi,pi] 2017-04-23 06:00:40 +02:00
Abdullah Tahiri
4c3ffb57ca Sketcher: Fixes #3009 error with geompoints in sketcher
=======================================================

Introduction of construction points as fixed solver entities introduced this bug, as there was no specific code to check for points as they were by default construction.
2017-04-17 20:47:30 +02:00
wmayer
cababe1269 fix scan coverity issues 2017-04-11 19:01:32 +02:00
wmayer
292fdebe49 fix scan coverity issues: unchecked dynamic_cast 2017-04-11 12:45:02 +02:00
wmayer
3abc019af0 fix -Wsign-compare 2017-04-08 13:57:29 +02:00
Abdullah Tahiri
99da93192b Sketcher: OCC checks for knot functionality 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
d96c8421d4 Sketcher: Assertion on solver bspline control point creation to expose any potential index miscalculation and memory overflow 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
63ce5df76b Sketcher: Solver bypass of knotpoints
Internal geometry knot points, which were added as fixed parameters to the solver according to a previous commit, are tracked in the corresponding bspline as solver level,
without being a parameter to the solver, and upon solving, the position thereof is updated by means of OCC functionality.

This allows to show the knot points and solidarily move them when moving a bspline.
2017-04-08 12:58:06 +02:00
Abdullah Tahiri
4ace8e7b79 Sketcher: Construction points added as fixed parameters 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
2369112fb5 Sketcher: Bspline solver knot support - unfinished 2017-04-08 12:58:06 +02:00
Kunda
99c99006b8 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
Abdullah Tahiri
80e7ece429 Sketcher: BSpline - avoid tiny circles on removal of equality 2017-01-26 23:41:02 +01:00
wmayer
0955ccf594 fix whitespaces 2017-01-20 19:22:50 +01:00
Abdullah Tahiri
4da262dd33 Sketcher: BSpline solver improvement
===================================

In the unusual event that endpoint knot multiplicity is edited, avoid trying to force the bspline end-point
to match the corresponding control point (aka pole), as this leads to unsolvable sketches.
2017-01-15 01:49:45 +01:00
Abdullah Tahiri
512fd62c41 Sketcher: Enable BSpline edge and enpoints movement 2017-01-14 01:23:04 +01:00
Abdullah Tahiri
1b59e74568 Sketcher: Solver Simplification for basic case
==============================================

This commit is intended to allow to early merging to master of BSpline support. Parts of it will be reverted when a more advanced solver implementation is available.

The intention is to have an advances solver implementation in the future.

This commit cripples part of the potential functionality, but allows a very simplistic solver structure (no de Boor, no recursion).

In particular:
1. Knots are not solver parameters and the solver acts as if such a parameter did not exist.
2. For non-periodic case, the start point and the endpoint coincide with the first pole and the last pole respectively. This is only valid under certain first and last
knot multiplicity. If the user manually changes this multiplicities, the sketch will remain unsolved. For the periodic case, end and start points are not even solver
parameters as an end and start point is an ilusion and we really do not care where that happens. It is not reasonable to ask the user to constrain where this point should
be.
2017-01-13 23:42:57 +01:00