Commit Graph

18418 Commits

Author SHA1 Message Date
Patrick F
db6beca1ff Abort changes 2021-01-02 01:34:53 +01:00
Patrick F
959fdddbec Merge branch 'master' of https://github.com/FreeCAD/FreeCAD into leadinout_gui 2021-01-01 22:53:27 +01:00
sliptonic
907adc95b3 Merge pull request #4224 from realthunder/FixPathCrash
Path: fix crash on edit
2021-01-01 15:24:26 -06:00
sliptonic
4c1ae19069 Merge pull request #4214 from mlampert/bugfix/dangling-signal-registration
[Path]: bugfix/dangling signal handler error
2020-12-31 14:14:44 -06:00
Russell Johnson
949e6154b9 Path: Fix isinstance() item.Proxy error
Some items in `objectList` do not contain a `Proxy` child and cause a fatal error in post processing with this post module.
2020-12-31 08:50:38 -06:00
Zheng, Lei
ca1f799a7d Path: fix crash on edit
Many Path object forward its editing operation to the job object. It is
possible that some editing option change may lead to removing of the
editing object (e.g. changing stock type) causing crash. It is possible
to just open the task panel without setting any editing object by
returning False in ViewProvider.setEdit()
2020-12-31 21:07:56 +08:00
mlampert
4a59255fd9 Merge branch 'master' into bugfix/dangling-signal-registration 2020-12-30 18:32:26 -08:00
donovaly
e54f4fc086 [TD] fix regression for balloon text separators
as reported here: https://forum.freecadweb.org/viewtopic.php?f=35&t=53664 the balloon text separation no longer works.

The regression was introduced by commit 76357b3fc . The mistake thereby was that the textHeight is already handled before the separators and that rectangular balloons behave differently because of the separator feature.
2020-12-30 23:59:15 +01:00
mlampert
cdcb84136b Merge branch 'master' into bugfix/dangling-signal-registration 2020-12-30 13:33:29 -08:00
donovaly
4011e7f129 [TD] cleanup preferences
as discussed here: https://forum.freecadweb.org/viewtopic.php?f=35&t=53680&p=461356#p461349

* change default tolerance scale to 0.8
* the tolerance scale is directly applied, thus it must have non-italic label
* move tolerance scale to "Dimensions" tab
* move Fuzz settings to "Advanced" tab
* move Conventions to General tab since e.g. the projection angle is an important general setting
* add a note for the label font that this is also used for dimensions and that it there only has an effect for new ones
* use more useful step size of 0.1 for some scaling spinboxes
* sort UI fields in the C++ code to avoid doubled or missing entries (there were 2 doubled entries)
* uniform width of all preferences dialogs
* better alignment for the HLR dialog
2020-12-30 20:22:27 +01:00
Abdullah Tahiri
8e871412a9 Sketcher: Fix lock constraint reference mode
============================================

Fixes:
https://forum.freecadweb.org/viewtopic.php?p=461600#p461517
2020-12-30 20:20:20 +01:00
Abdullah Tahiri
c0e06f7f19 Sketcher/GCS: New Block constraint fixes
========================================

Previous versions relied on a heuristic that proved insufficient for cummulative use of the Block constraint.
The effect is that Block constraints stopped blocking, which is a major bug, as it lead to inadvertedly moving
geometry that was supposed to be blocked.

Fixes:
https://forum.freecadweb.org/viewtopic.php?f=13&t=53515&start=30#p461215
(Thanks Chaospilot)

Know problems with old block constraint (v0.18):
1. If driving constraints were present, they were ignored if inserted before the block constraint (to avoid
redundancy/conflicting). They resulted in

Principles of Working of the new block constraint:
1. Handling of the new block constraint is based two processes, a pre-analysis and a post-analysis. Pre-analysis
works *before* diagnosing the system in the solver. Post-analysis works *after* diagnosing the system in the solver.

2. Pre-analysis is directed to detect geometries affected *exclusively* by a block constraint. This is important
because these geometries can be pre-fixed when creating the solver geometry and constraints before GCS::diagnose()
via initSolution() AND because if no other constraint affects the geometry, the geometry parameters won't even appear
in the Jacobian of GCS, so they won't be reported as dependent parameters (for which post-analysis would be of no use).

3. Post-analysis is directed to detect Geometries affected *not only* by a block constraint. This is important
because pre-fixing these geometries would lead to redundant constraints. The post-analysis, enables to fix just the
parameters that fulfil the dependacy groups.

4. Post-analysis basically identifies which parameters shall be fixed to make geometries having blocking constraints
fixed, while not leading to redundant/conflicting constraints. These parameters must belong to blocked geometry. This
is, groups may comprise parameters belonging to blocked geometry and parameters belonging to unconstrained geometry. It
is licit that the latter remain as dependent parameters. The former are referred to as "blockable parameters". Extending
this concept, there may be unsatisfiable groups (because they do not comprise any bloackable parameter), and it is the
desired outcome NOT to satisfy such groups. It must be emphasised that there is not a single combination of fixed parameters
from the blockable parameters that satisfy all the dependency groups. However:
     1) some combinations do not satisfy all the dependency groups that must be satisfied (e.g. fixing one group containing
        two blockable parameters with a given one may result in another group, fixable only by the former, not to be satisfied).
        This leads, in a subsequent diagnosis, to satisfiable unsatisfied groups.
     2) some combinations lead to partially redundant constraints, that the solver will silently drop in a subsequent diagnosis,
        thereby reducing the rank of the system fixing less than it should.

5. The implementation rationale is as follows:
     1) The implementation is on the order of the groups provided by the QR decomposition used to reveal the parameters
        (see System::identifyDependentParameters in GCS). Zeros are made over the pilot of the full R matrix of the QR decomposition,
        which is a top triangular matrix.This, together with the permutation matrix, allow to know groups of dependent parameters
        (cols between rank and full size). Each group refers to a new parameter not affected by the rank in combination with other free
        parameters intervening in the rank (because of the triangular shape of the R matrix). This results in that each the first column
        between the rank and the full size, may only depend on a number of parameters, while the last full size colum may dependent on
        any amount of previously introduced parameters.
     2) Thus the rationale is to start from the last group (having **potentially** the larger amount of parameters) and selecting as blocking
        for that group the latest blockable parameter. Because previous groups do not have access to the last parameter, this can never
        interfere with previous groups. However, because the last parameter may not be a blockable one, there is a risk of selecting a parameter
        common with other group, albeit the probability is reduced and probably (I have not demonstrated it though and I am not sure), it
        systematically leads to the right solution in one iteration.

GCS: Change dependency group from std::set to std::vector to prevent reordering of parameters.
2020-12-30 18:59:15 +01:00
Aapo
e20a21a97d [TD] DrawViewDimension Tolerances, print zero tolerances without plus sign and decimals. 2020-12-30 18:49:59 +01:00
donovaly
665a1106f7 [TD] fix bug with angular and small values
* angular as reported here: https://forum.freecadweb.org/viewtopic.php?f=35&t=53473&start=10#p461507
* small values: since we convert to e.g. mm, we must then not output e.g. 'µm'
* also a code optimization, fix a typo, removal of a meanwhile misleading comment
2020-12-30 16:20:27 +01:00
Yann Diorcet
ae68147d0b LinearPattern: Support 1 occurrence
When using linear pattern with expression, this can be usefull to have only one
occurence (the original one), which can't be done with the following
implemenation. This commit change this behaviour by allowing this value.
2020-12-30 14:49:54 +01:00
wmayer
eac4062b3f Boost: [skip ci] Fix build warnings from deprecated Boost headers (v1.75) 2020-12-29 15:34:25 +01:00
Mateusz Skowroński
98f63ba60f Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
Abdullah Tahiri
ff77ffe7d1 Sketcher: check for BSpline knot instead of construction point
==============================================================

Previously construction points was used to code bspline knots.
Now construction points are normal sketcher points, which can be
made defining.

This commit renames and adapts the checks for fixed geometry.

fixes:
https://forum.freecadweb.org/posting.php?mode=quote&f=3&p=461472#pr461472
2020-12-29 07:22:21 +01:00
Markus Lampert
8e4843b3ae Remove event registration when task panel is destroyed. 2020-12-28 19:45:08 -08:00
Mateusz Skowroński
b8c26c0273 Fix GCC warnings: type qualifiers ignored on cast result type [-Wignored-qualifiers] 2020-12-28 23:17:26 +01:00
Mateusz Skowroński
90c4ffceec Fix GCC warnings: catching polymorphic type by value [-Wcatch-value=] 2020-12-28 23:17:26 +01:00
luz paz
c89e6eec13 Sketcher: Fix typos and code linting [skip ci] 2020-12-28 23:15:22 +01:00
luz paz
f497f09238 Fix typos [skip ci]
Typos ffound via `codespell v2.1.dev0`  
Also includes fixes in deprecated code of `src/Mod/Assembly`
2020-12-28 23:14:04 +01:00
wmayer
b7128a8f52 Sketcher: fix -Wextra-semi 2020-12-28 11:36:24 +01:00
wmayer
b835e64d8d Sketcher: fix layout by removing minimumSize property from labels 2020-12-28 11:33:02 +01:00
donovaly
a1d02ce109 [Sketch] remove unused code
fixes bug #4522

as discussed in https://forum.freecadweb.org/viewtopic.php?f=10&t=53587&p=460823#p460777

also remove superfluous verticalSpacer
2020-12-28 11:28:26 +01:00
Abdullah Tahiri
6dc20d2b68 Sketcher: ViewProvider - fix crash due to invalidated geomety pointer
=====================================================================

Finish checks with geometry pointer before calling initTemporaryMove(), as the pointer may change as a result of the solve() operation.
2020-12-27 08:24:43 +01:00
Abdullah Tahiri
56f3db079f Sketcher: Fix crash on constraint rename
========================================

Report:
https://github.com/FreeCAD/FreeCAD/pull/4183
https://github.com/realthunder/FreeCAD_assembly3/issues/387

Problem:
renameConstraint() previously implemented exclusively in SketchObjectPyImp.cpp,
will change the Constraints property without updating the solver. A prospective
drag operation would rely on a deleted pointer constraint which leads to the
crash.

Solution:
- mark the solver status as needing an update
- leverage new through sketchobject r/w interface to ensure solver is synchronised
before the temporary move operation starts

Bonus:
move the core of the function to SketchObject.cpp so that input data validity
check on constraint change is inhibited.
2020-12-27 08:24:43 +01:00
Abdullah Tahiri
04bbae80cf Sketcher: restric ViewProviderSketch access to the solver
=========================================================

-> Split read and read/write operations

New interface to access the solver object (Sketch) of SketchObject is now read only (const):

const Sketcher::Sketch &getSolvedSketch(void) const;

-> Encapsulate solver r/w access in SketchObject

Rationale:

- r/w access (access to non-const functions of the solver) leads to unsynchronised solver status.

- Before this commit there was a non-enforceable shared responsibility between ViewProviderSketch
and SketchObject.

- This commit centralises r/w access in SketchObject and SketchObject takes responsibility for doing whatever
necessary so that the solver is synchronised as appropriate.

- For read-only access (const functions) it is possible to use at ViewProviderSketch getSolvedSketch() returning
a const reference to the solver object.

- As it regards the advanced solver configuration dialog, it has been modified to configure by const-casting that reference. This
is not optimal, but it is deemed acceptable, because it should be rewritten sooner or later to include only useful information
and the configuration probably centralised in an individual configuration object, possibly compatible with several solvers
(e.g. DeepSOIC's ConstraintSolver too).
2020-12-27 08:24:43 +01:00
Abdullah Tahiri
5c8e65728f Sketcher: Trigger elements widget update on toggle/set construction geometry 2020-12-27 08:24:43 +01:00
Abdullah Tahiri
b6729a41d7 Sketcher: encapsulate Sketch::SolveTime and RecalculateInitialSolutionWhileMovingPoint members 2020-12-27 08:24:43 +01:00
Abdullah Tahiri
84a8bb5741 Sketcher: make Sketch::calculateNormalAtPoint const 2020-12-27 08:24:43 +01:00
Abdullah Tahiri
99c530bcf1 GCS: Const correctness and override qualifier
=============================================

Make several functions operate as const.
Use the override qualifier
2020-12-27 08:24:43 +01:00
Abdullah Tahiri
4d6257895d GCS: Return a zero sized reduced Jacobian if only driven constraints present
=============================================================================

The reduced Jacobian defaults to the size of the full Jacobian, where driven constraints
and parameters are not considered to build the reduced Jacobian and thus empty rows remain.

This is generally not a problem as QR decomposition ignores this rows, except in case where
only driven constraints exist. In such a case no QR decomposition is necessary, and in fact
relying on the size of the QR decomposition leads to the incorrect result that the sketch
is fully constraint, when the opposite is true.

This commit resizes an effectively empty reduced Jacobian to avoid this issue.

Fixes the problem that a line with a single reference constraint is shown as fully constraint.
2020-12-27 08:24:43 +01:00
Abdullah Tahiri
8217a168f2 Sketcher: Make select-constraint select-elements mode consistent with select-element select-constraint
======================================================================================================

https://forum.freecadweb.org/viewtopic.php?f=13&t=53515&p=461142#p460687

When using select-constraint then select elements, allow both point-line-point and point-point-line.
2020-12-27 08:19:23 +01:00
luz paz
7028017e8d Sketcher: typo in function name 2020-12-27 06:08:01 +01:00
Patrick F
daaed6f0ee Updated layout 2020-12-26 22:03:40 +01:00
Patrick F
13c42c936b Panel Start at creation 2020-12-26 21:11:27 +01:00
sliptonic
ce353a2fcc Merge pull request #4161 from bryanbendall/adaptive-work
Path: Adaptive work
2020-12-26 06:49:56 -06:00
donovaly
afa6866007 [Sketch] fix SnellsLaw dialog
- add missing class to UI file (found and automatically added by Qt Designer)
- add more sensible stepsize - you are dealing in practice with rations in the range 1.2 - 1.6 thus a stepsize of 1.0 is not helpful
2020-12-25 12:00:49 +01:00
donovaly
7bd39f6a33 [Sketch] improve wording for a color
as discussed here: the wording "datum color" does not make clear what it is about. It is in fact the color for dimensional constraints, thus name it as such

- also fix the dialog height (found and automatically corrected by Qt Designer)
2020-12-25 11:49:03 +01:00
Yorik van Havre
59c50bb684 Merge pull request #4186 from luzpaz/typos
Fix typos [skip ci]
2020-12-24 12:07:15 +01:00
Abdullah Tahiri
5d8172e190 GCS: Improve documentation about debug
======================================

Explicitly indicate that if parameter diagnosis must be silent=false in order to debug,
then the lauch policy during the debug must be set to deferred in order to avoid concurrent
access to Base::Console which is not thread-safe.
2020-12-24 11:59:51 +01:00
Abdullah Tahiri
19be9767fc Sketcher: Fix block constraint with several dependency groups
=============================================================

Fixes:
https://forum.freecadweb.org/viewtopic.php?f=8&t=53466&p=460513#p460270

When a parameter belonging to a blocked geometry is present in several
dependency groups and there are other fixed parameters one or more of
the dependency groups, it is not enough to remove that parameter, from
the one or more dependency groups. The removal of a parameter may only
satisfy one dependency group. Removing a single parameter creates a
new different dependency group.

Solution:
If the first blocked parameter in a group is already set for removal,
continue searching for other blocked parameters, until one not searched
for removal is found.
2020-12-24 11:59:51 +01:00
Abdullah Tahiri
fffbbf14c5 Sketcher: enable Block constraint with empty additional constraints
===================================================================

Fixes:
https://forum.freecadweb.org/viewtopic.php?f=13&t=53515&p=460523#p460406
2020-12-24 11:59:51 +01:00
Abdullah Tahiri
4f596d370f Sketcher: Additional debug code for new block constraint 2020-12-24 11:59:51 +01:00
luz paz
439bf8960d Fix typos [skip ci]
Found via `codespell v2.1.dev0`
2020-12-23 14:32:38 -05:00
wmayer
5cc43c0306 Path: [skip ci] fix Python 3.9 deprecation warning 2020-12-23 17:41:30 +01:00
wmayer
e173be6f86 Mesh: [skip ci] fix -Wrange-loop-construct 2020-12-23 17:39:02 +01:00
Yorik van Havre
bdd9c23af7 Reverting files wrongly committed with 11beceea8 2020-12-23 15:21:43 +01:00