Commit Graph

116 Commits

Author SHA1 Message Date
wmayer
21d01fe6fc Replace Base::Exception with appropriate subclass 2018-11-14 19:27:52 +01:00
Markus Lampert
e13c09235f Changed all catch types to references for polymorphic exceptions. 2018-08-08 15:45:30 +02:00
Abdullah Tahiri
b320f15909 Solver: Support for Diameter constraint 2018-07-30 00:47:20 +02:00
wmayer
5ff103615f fix -Wmaybe-uninitialized 2018-06-09 12:05:19 +02:00
wmayer
443dde8d6c fix const correctness 2018-05-31 12:49:23 +02:00
Abdullah Tahiri
040923fcef 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
f88daf23cc Solver: Solver Sketch level dependent parameters and solver geometric element management 2018-05-31 11:39:15 +02:00
Abdullah Tahiri
e97e616686 Sketcher: Fix crash on applying dimensional constraint to external element 2018-05-27 19:43:05 +02:00
wmayer
b780ba650f fix scan coverity issues 2018-02-10 14:29:49 +01:00
luz.paz
9ca8f2a3d2 Sketcher: comment typos
Found via `codespell`
[skip ci]
2018-01-25 18:47:34 -02:00
wmayer
c65585ccaf improve whitespace, fix const correctness 2018-01-23 00:40:41 +01:00
Abdullah Tahiri
46aa2c6356 Sketcher: Change nomenclature relating to Block constraint 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
41fe55bda3 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
7d2aab853e Sketcher: Blocked Constraint solver level 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
e85da016fe Sketcher: Solver angle -pi,pi conversion corrected
fixes #3288
2018-01-01 20:28:53 +01:00
wmayer
125329f0bd simplify debugging of changing datum constraints 2017-12-31 11:48:44 +01:00
luzpaz
4eb5a431fa Sketcher: comment typos 2017-12-25 10:59:48 +01:00
Abdullah Tahiri
f2cca2e05a 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
a309e417fc Sketcher: New Setting for improved dragging mode 2017-12-12 22:20:27 +01:00
Abdullah Tahiri
a014c1cbc1 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
7b086ba8b2 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
9612c31572 fixes #0003176: Sketcher: always over-constrained when referencing external B-Spline 2017-12-02 13:02:42 +01:00
luzpaz
35ec477426 More typos, grammar fixes, uniformity 2017-11-15 10:46:43 -05:00
Abdullah Tahiri
968f01e206 Sketcher: Force solver to return non-driving angles in [-pi,pi] 2017-04-23 06:00:40 +02:00
Abdullah Tahiri
be09213bfb 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
5f86aae9a5 fix scan coverity issues 2017-04-11 19:01:32 +02:00
wmayer
ca343c43ab fix scan coverity issues: unchecked dynamic_cast 2017-04-11 12:45:02 +02:00
wmayer
35884fd3c2 fix -Wsign-compare 2017-04-08 13:57:29 +02:00
Abdullah Tahiri
5072938482 Sketcher: OCC checks for knot functionality 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
28396fdd54 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
33be143f48 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
65b7e606e5 Sketcher: Construction points added as fixed parameters 2017-04-08 12:58:06 +02:00
Abdullah Tahiri
c46c66d48a Sketcher: Bspline solver knot support - unfinished 2017-04-08 12:58:06 +02:00
Kunda
9410e751e9 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
Abdullah Tahiri
c1620e7a87 Sketcher: BSpline - avoid tiny circles on removal of equality 2017-01-26 23:41:02 +01:00
wmayer
d065c2fe5b fix whitespaces 2017-01-20 19:22:50 +01:00
Abdullah Tahiri
4dfacb9888 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
73e797ffa0 Sketcher: Enable BSpline edge and enpoints movement 2017-01-14 01:23:04 +01:00
Abdullah Tahiri
f2c3ef61b0 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
Abdullah Tahiri
4d7a468373 Sketcher: Contraint class extension
===================================

An additional index for internal geometry elements is introduced, to be stored only Internal Aligment constraint and backwards compatible.
2017-01-11 23:00:43 +01:00
Abdullah Tahiri
167240e197 Sketcher: BSpline solver Internal Geometry for poles 2017-01-10 23:34:49 +01:00
Abdullah Tahiri
b0dc19eca9 Part: Fixes triggered by Werner's comments on my branch 2017-01-10 20:05:18 +01:00
Abdullah Tahiri
41889bab50 Sketcher: BSpline solver sketch basic implementation
====================================================

Creation of solver geometry definitions from Part::BSpline geometries and update of solved geometry back.
2017-01-05 12:01:11 +01:00
wwmayer
52a65710f8 Merge pull request #401 from abdullahtahiriyo/parabola_2017
Parabola 2017
2016-12-28 13:48:13 +01:00
Abdullah Tahiri
11808acad1 Sketcher: Parabola solver equality constraint 2016-12-24 02:39:02 +01:00
Abdullah Tahiri
84b6e97f2d Sketcher: Point on Object solver constraint 2016-12-24 01:14:15 +01:00
Abdullah Tahiri
4f3d3ff68a Sketcher: Parabola Skech geometry update fix 2016-12-22 16:10:53 +01:00
Abdullah Tahiri
3932a2f37d Sketcher: Focus solver internal geometry 2016-12-22 16:10:52 +01:00
Abdullah Tahiri
bb068fa7a4 Sketcher: Parabola Arc rules solver constraint 2016-12-22 16:10:33 +01:00
wmayer
90b9ba81cf fix CIDs 154877, 154878, 154879, 154880, 154881, 154882, 154885 2016-12-18 12:15:26 +01:00