Commit Graph

23559 Commits

Author SHA1 Message Date
donovaly
30fcddae40 [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
81a5ec5e55 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
0f31c87cc9 Boost: [skip ci] Fix build warnings from deprecated Boost headers (v1.75) 2020-12-29 15:34:25 +01:00
wmayer
ed3acd466d SMESH: [skip ci] fix -Wdelete-non-virtual-dtor 2020-12-29 10:36:07 +01:00
Mateusz Skowroński
2559f2d29c 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
4ea97faa5b 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
Mateusz Skowroński
5dca59d824 Fix GCC warnings: type qualifiers ignored on cast result type [-Wignored-qualifiers] 2020-12-28 23:17:26 +01:00
Mateusz Skowroński
6075ba3085 Fix GCC warnings: catching polymorphic type by value [-Wcatch-value=] 2020-12-28 23:17:26 +01:00
luz paz
4327243a0a Sketcher: Fix typos and code linting [skip ci] 2020-12-28 23:15:22 +01:00
luz paz
472168fc15 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
b318426cd7 Sketcher: fix -Wextra-semi 2020-12-28 11:36:24 +01:00
wmayer
ae0742c748 Sketcher: fix layout by removing minimumSize property from labels 2020-12-28 11:33:02 +01:00
donovaly
cc29af4da3 [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
6b017f9a16 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
64774bc1fe 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
1d56289c79 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
8e3b6be0e7 Sketcher: Trigger elements widget update on toggle/set construction geometry 2020-12-27 08:24:43 +01:00
Abdullah Tahiri
733b7bde90 Sketcher: encapsulate Sketch::SolveTime and RecalculateInitialSolutionWhileMovingPoint members 2020-12-27 08:24:43 +01:00
Abdullah Tahiri
18ecd174a8 Sketcher: make Sketch::calculateNormalAtPoint const 2020-12-27 08:24:43 +01:00
Abdullah Tahiri
a790e32605 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
c2ab51314d 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
67e5f9c3e9 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
38cafc57a5 Sketcher: typo in function name 2020-12-27 06:08:01 +01:00
sliptonic
72ec38be5d Merge pull request #4161 from bryanbendall/adaptive-work
Path: Adaptive work
2020-12-26 06:49:56 -06:00
donovaly
f2d17774e8 [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
ef8831ff25 [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
Fabio Rossi
c6eda6dca7 [PythonConsole] Fixed pasting using middle mouse button on Linux 2020-12-24 17:07:48 +01:00
Zheng, Lei
0e2ab08121 Gui: temporary fix of preference menu in macos
QAction defaults menu role to TextHeuristicRole, which causes qt to
guess the menu role based on action title. And titles start with
'Config', 'Options', 'Settings', etc. will be considered as preference
menu. It seems some non-english translation causes the wrong action be
chosen as preference, such as 'Treeview actions'.

This commit just applied a temporary fix to default to QAction::NoRole
for GroupCommand. If there is ever some GroupCommand need to be a
system menu item on macos, we could add some command bit flag for that
purpose.
2020-12-24 16:58:18 +01:00
Yorik van Havre
4a9da93e67 Doc: Cosmetic fixes for doxyhen-generated doc
The documentation generated with 'make WebDoc' is now a git repo at
https://github.com/FreeCAD/SourceDoc and can be read online via
https://freecad.github.io/SourceDoc/ - The page at
https://freecadweb.org/api now redirects to it.
2020-12-24 13:24:37 +01:00
Yorik van Havre
145fa6bfa1 Merge pull request #4186 from luzpaz/typos
Fix typos [skip ci]
2020-12-24 12:07:15 +01:00
Abdullah Tahiri
af605e4066 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
197a234357 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
dfda68be11 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
5cfef45561 Sketcher: Additional debug code for new block constraint 2020-12-24 11:59:51 +01:00
luz paz
ff96cb301e Fix typos [skip ci]
Found via `codespell v2.1.dev0`
2020-12-23 14:32:38 -05:00
wmayer
d89cd953a2 Path: [skip ci] fix Python 3.9 deprecation warning 2020-12-23 17:41:30 +01:00
wmayer
ed0a5af0d6 Mesh: [skip ci] fix -Wrange-loop-construct 2020-12-23 17:39:02 +01:00
Yorik van Havre
799a2e1f5d Reverting files wrongly committed with 5a974f824 2020-12-23 15:21:43 +01:00
Yorik van Havre
5a322d75cb Merged crowdin translations 2020-12-23 15:13:05 +01:00
Yorik van Havre
5a974f824c Updated ts files 2020-12-23 14:51:04 +01:00
Yorik van Havre
6754e2b37e Merge pull request #4117 from robot-army/master
Update README.md
2020-12-23 14:43:47 +01:00
Yorik van Havre
7da7955255 Merge pull request #4142 from DinoMesina/master
Draft: Correct placementFromDXFOCS()
2020-12-23 14:24:21 +01:00
Yorik van Havre
a891c04229 Merge pull request #4175 from donovaly/TD-unit-dimension-fix
[TD] fix unit conversion for dimensions
2020-12-23 14:10:04 +01:00
Yorik van Havre
b617ebfa20 Merge pull request #4172 from tomate44/fcinfo
fcinfo: support backup files
2020-12-23 14:08:46 +01:00
Yorik van Havre
99a6c0a0a8 Merge pull request #4176 from dbpatankar/indian_standard_profiles
[Arch] Indian standard H and U profiles added to profiles.csv
2020-12-23 14:07:05 +01:00
wmayer
23073c14da Py2: fix Py2 build failure 2020-12-23 14:04:14 +01:00
Aapo
b66c895bb8 [Part] AppPartPy.cpp Python 3.9 Unicode warning fixes. 2020-12-23 13:51:52 +01:00
Aapo
107ed94d8f CXX, Objects.hxx: Python 3.9 Unicode compilation warning fixes suggested by wmayer on the FC forum. 2020-12-23 13:51:52 +01:00
David Osterberg
cbbbe942ea Apply style suggestions from @abdullahtahiriyo 2020-12-23 06:23:17 +01:00
David Osterberg
73fa304685 Sketcher: Fix issue #4513 - SketchObject::addSymmetric
This fixes issue
https://tracker.freecadweb.org/view.php?id=4513

addSymmetric will now only transfer Vertical and Horizontal constraints if the reference axis is either
 - the HAxis
 - the VAxis
 - a Vertical line
 - a Horizontal line
2020-12-23 06:23:17 +01:00