Commit Graph

623 Commits

Author SHA1 Message Date
Yorik van Havre
bcb75d5477 Updated translation files from crowdin 2016-03-17 23:29:11 -03:00
DeepSOIC
5c3024e9f8 Sketcher: negative constraint value avoidance
by swapping elements being constrained at creation time, should the
precalculated value happen to be negative.
2016-03-12 21:28:37 +01:00
DeepSOIC
e624a1d00d Sketcher: never ever hide constraint value sign, anymore 2016-03-12 21:28:22 +01:00
wmayer
b25ef6235d + on rename of contraint make sure that new name is different, on swap constraint names make sure they have user-defined names 2016-03-12 20:02:18 +01:00
wmayer
a17870c93c + fixes #0002471: In constraint context menu, 'Change Value' is always greyed out 2016-03-12 15:26:06 +01:00
wmayer
f124f6e70b + minor whitespace fix, fix warnings 2016-03-11 21:39:15 +01:00
wmayer
4fcb93b64e + issue #0001203: Allow User to Adjust Size of Constraint Points 2016-03-08 00:31:50 +01:00
Yorik van Havre
d1b4f23388 Added latest translations from crowdin 2016-03-06 14:50:07 -03:00
triplus
d432c72a15 Add SVG workbench icons 2016-02-26 23:17:43 +01:00
Yorik van Havre
28b6c82555 Added updated translations from crowdin - fixes #2443 2016-02-26 18:32:02 -03:00
Jonathan Wiedemann
f16a26662d Sketcher : Allow µm in sketcher grid size 2016-02-19 16:32:25 +01:00
Yorik van Havre
2e2192f88a Added slovenian language 2016-02-03 13:36:51 -02:00
Yorik van Havre
37b1bdbe27 Updated translations with latest from crowdin 2016-02-01 23:32:58 -02:00
wmayer
65fe62d93b + simplify porting of Sketcher module to Python3 2016-01-18 12:19:54 +01:00
Abdullah Tahiri
81f216f9e3 Sketcher Bug fix: Solver information update on over-constrained situation
==================================================================================

Why?
if lastDoF<0, then an over-constrained situation has ensued and geometry is not to be updated, as geometry can not follow the constraints.
However, solver information needs to be updated.

Solution:
Just trigger a constraint change so that signaling is sent to ViewProviderSketch via boost and the solver information updated, using
Constraints.touch().
2016-01-09 13:42:12 +01:00
Mateusz Skowroński
7d0e892d36 Qt4's qglobal.h defined TRUE and FALSE. Qt5 does not do it anymore. Replace it with true and false.
158f39ec78

This change is Qt4/Qt5 neutral.
2016-01-05 16:43:33 +01:00
Mateusz Skowroński
cd2db00f22 QString::fromAscii() is obsolete in Qt5. Replace it with fromLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:07:25 +01:00
Mateusz Skowroński
d5c074f80d QString::toAscii() is obsolete in Qt5. Replace it with toLatin1().
This change is Qt4/Qt5 neutral.
2016-01-05 16:06:48 +01:00
Yorik van Havre
1747fb643f Updated ts files prior to translation cycle 2016-01-03 19:45:29 -02:00
wmayer
ad2c4c23d0 + fix compiler warnings 2015-12-30 10:58:14 +01:00
Abdullah Tahiri
86f0454414 Sketcher: Solver: FullPivLU::compute for Eigen-3.3
==================================================

This fix enables usage of the Eigen SparseQR starting in Eigen-3.3. It optimizes the code enabling it
to work with the new assignation interface of Eigen-3.3, which is more strict than that of Eigen-3.2.

It provides the same optimization for DenseQR code, and omits the extraction of the Q matrix in DenseQR
as this is not used anywhere else.

[NOTE: This is only to be merged after Debian has updated the Eigen-3.3-alpha1 package]

See:
http://forum.freecadweb.org/viewtopic.php?f=10&t=12769&start=30#p104740
https://forum.kde.org/viewtopic.php?f=74&t=129115
2015-12-28 11:51:34 -02:00
Abdullah Tahiri
e9af05f911 Sketcher: Solver: FullPivLU::compute for Eigen-3.3
==================================================

This fix enables usage of the Eigen own compute function starting in Eigen-3.3, as now it is fixed in Eigen.

[NOTE: This is only to be merged after Debian has updated the Eigen-3.3-alpha1 package]

See:
http://forum.freecadweb.org/viewtopic.php?f=3&t=4651&start=40
http://forum.freecadweb.org/viewtopic.php?f=10&t=12769&start=60#p106492
https://forum.kde.org/viewtopic.php?f=74&t=129439
2015-12-28 11:51:34 -02:00
wmayer
462ec49297 + fixes #0001956: FreeCAD 0.14.370x hangs when attempting to edit sketch containing ellipse 2015-12-27 11:44:47 +01:00
wmayer
d8088c5db0 + improve whitespaces 2015-12-25 10:56:03 +01:00
wmayer
51c7a8eecc + improve whitespaces 2015-12-25 10:37:52 +01:00
wmayer
632eaeadeb + fixes #0002372: Application terminates on attempt to change external geometry from a sketch
+ fixes #0002373: When Measuring in the distance between two external geometry Freecad crashes
2015-12-25 09:47:25 +01:00
Eivind Kvedalen
fca2e2671a PropertyConstraintList: Use correct indices when checking the constraint type. 2015-12-21 14:11:14 +01:00
Eivind Kvedalen
db2f868bbe Sketcher: Fixed setPathValue to convert angles to radians before they are stored in the Constraint object. This mimics the setDatum implementation. 2015-12-18 22:05:30 +01:00
Stefan Tröger
dcad131357 Expressions: Fix property editor behavior
- change responsibility of python code emition
- Correct python code handling for expressions
- handle constraints expressions handling
2015-12-09 14:08:50 +01:00
Stefan Tröger
4203a6f35b Expressions: Integrate into the property editor
- basic infrastructure for handling of expressions
- port the unit properties editor to support expressions
- port placement editor to support expressions
- expressions for double spinbox
- expressions in sketch constraints
2015-12-09 14:08:48 +01:00
Abdullah Tahiri
501fa80e4d Sketcher: Fix Sketch Mirror functionality
=========================================

The problem:
Mirror stopped working.

How to reproduce:
Select a sketch, and apply "Mirror Sketch" from the menu.

Why?
With the introduction of expressions, mirror sketch stopped working. The reason is that mirror functionality did use the "clone" function to make copies of constraints
and then modify their values. After expessions introduction, which introduces a unique tag per constraint, this copy was regarded as a "rename" of the original constraint
as they shared the unique tag.

Fix?
New function "copy()" for a constraint, that copies all the content but the tag.
2015-12-09 13:32:12 +01:00
wmayer
2b2358e70b + fix warnings with Win32 build 2015-12-01 00:51:57 +01:00
Abdullah Tahiri
19c840e1ab Sketch: Solver: Extended Advanced Solver configuration
========================================================

This is an advanced setting just for allowing increased choices to power users that have problems with a given sketch and want to
test different flavours of DogLeg algorithm.

This commit does not change the default behaviour of FreeCAD. It is only intended to give more options to power users.

The advanced solver configuration is extended to support three different Gauss-newton steps for DogLeg:

FullPivLU => h_gn = Jx.fullPivLu().solve(-fx);
LeastNormFullPivLU => h_gn = Jx.adjoint()*(Jx*Jx.adjoint()).fullPivLu().solve(-fx);
LeastNormLdlt => h_gn = Jx.adjoint()*(Jx*Jx.adjoint()).ldlt().solve(-fx);

This setting is applied only to DogLeg. It is applied to DogLeg as normal or redundant solver, if DogLeg is the selected solver.

Selecting a solver different from DogLeg for both normal and redundant disables the setting.

We have been told:
https://forum.kde.org/viewtopic.php?f=74&t=129439#p346104

that our default Gauss-Newton step in DogLeg may not be adequate in general (we generally deal with underconstraint systems
unless we have a fully constraint sketch, and even then it is many times overconstraint at least for redundant solving).

We have been told that maybe these LeastNorm options are more suitable for us (performance set aside). This enables you as power
user to test if it works fine with FreeCAD.
2015-11-28 13:08:31 +01:00
Abdullah Tahiri
aa6908b144 Sketch: Solver Defaults: Sketch size multiplier OFF
===================================================

This commit sets the sketch size multiplier OFF by default (so the number of iterations DogLeg/BGFS/LM is not sketch size dependent).

In complicated sketches having a high number of parameters, with sketch multiplier on, the number of iterations is extremely high (100 parameters*100 iterations => 10000 iterations).

The idea of disabling this comes from tests performed by DeepSOIC and from my own experience using the Sketcher. In general
sketch multiplier makes FreeCAD unresposive (very high amount of iterations, not a real freeze) in big sketches so that users
end up killing the application. This is preventing the users from taking appropriate action, Developers from getting the information of the failure and
users angry.

The idea is that even for complicated sketchs N iterations (100 by default) should be enough to converge, if it is ever going to converge. Experience will tell us
if we have to increase this number in the range [100-300]. 100 iterations in complicated dossiers is in my experience generally under 30 seconds.

N.B.: This commit does not change the defaults stored in your computer, so if you have the sketcher multiplier on, the advanced solver dialog will still enforce this local setting. You
may disable it or click the "defaults" button to disable the sketcher multiplier.
2015-11-28 13:08:24 +01:00
wmayer
6a6a2d5669 + fix whitespaces 2015-11-25 21:02:00 +01:00
Abdullah Tahiri
7c1c56a550 Sketcher: Solver Debug functionality: Ability to export a subsystem
===================================================================

It allows to export the c++ code to create a subsystem with the same information as the one solved using LM/DL/BGFS.

In this commit the functionality is disabled (for production).

To enable the functionality uncomment this line in planegcs/Constraints.h:
//#define _GCS_EXTRACT_SOLVER_SUBSYSTEM_

When enabled, upon solving with LM/DL/BGFS, the c++ code to generate the subsystem is added to a subsystem.txt that is created in the FreeCAD
execution directory.

Note that the file is created in append mode, so it will append all normal/redundant solvings until the file is deleted.

The resulting code can be directly pasted into a project similar to:
https://github.com/abdullahtahiriyo/Eigen_LUPiv_Convergence

Such a project only has libeigen as external dependency.
2015-11-25 20:39:04 +01:00
Abdullah Tahiri
ad1210f4bb Sketcher: Advanced solver dialog bug fix LM-tau
================================================

Due to a typo the code was setting LM-tau to 1E-80 by default instead of the intended 1E-3.
2015-11-21 22:48:02 +01:00
Mateusz Skowroński
f3860faaef Fix file encoding. Go from ISO8859-1 to UTF-8. 2015-11-11 18:54:42 +01:00
wmayer
85ac79aaf2 + double check that internal data is valid when leaving edit mode of sketcher view provider 2015-11-02 12:42:18 +01:00
Abdullah Tahiri
e1dd86f0a9 Sketcher: Bug fix: unable to move geometry after addition of a constraint
=========================================================================

This fixes issue:
http://www.freecadweb.org/tracker/view.php?id=2281

Discussed in:
http://forum.freecadweb.org/viewtopic.php?p=101910#p101910

How to reproduce?
With Auto-Update mode unchecked, execute the sequence in the bug tracker. You will reach to a geometry assembly successfully solved that can not be moved.

Why?
The coincident constraint is partially redundant within the meaning of redundancy of the solver.
The solve within "addconstraint" in SketchObjectPy.cpp causes the geometry to move to meet the coincident constraint.
At the end of the solve, the initial solution used in diagnostics is no longer valid (the geometry moved). This causes a subsequente move not to be executed.

The Solution:
Recalculate just the initial solution after the addition.
2015-10-23 00:13:20 +02:00
Abdullah Tahiri
fc128d357d Sketcher: Solver information: Bug fix
=====================================

When the solver converged (but did not succeed) or when the solver succeded but the solution is not OCC-valid, no error message was shown in the solver messages dialog.
2015-10-22 23:48:04 +02:00
wmayer
e7a3dc48e8 + support of Python feature classes without an execute() method
+ if execute() method of Python feature is missing or if it returns false call the execute() method of the C++ feature
+ fix SketchObjectPython
2015-10-21 00:22:40 +02:00
wmayer
692e9e6b96 + fixes #0002291: Invalid sketch warning should allow to directly open sketch validation tool 2015-10-17 15:34:14 +02:00
wmayer
051ad564d1 + use correct context for translatable strings in ViewProviderSketch 2015-10-17 15:21:37 +02:00
wmayer
9abedaf0d2 + fix & suppress msvc warnings 2015-10-16 18:26:30 +02:00
Yorik van Havre
167b094258 Merge branch 'master' of github.com:FreeCAD/FreeCAD 2015-10-13 16:44:33 -03:00
Yorik van Havre
60ac7e4cb8 Sketcher's GCS solver fixed for eigen3.3 2015-10-13 16:38:35 -03:00
Abdullah Tahiri
dc224265fa Sketcher: Bug fix: Constraints dissapear after a sketch loses support
=====================================================================

Issue:
http://freecadweb.org/tracker/view.php?id=2292

Constraints dissapear after a sketch loses support

Steps To Reproduce:
1. Make a sketch on a face.
2. Constrain it
3. Select "reorient sketch"
4. Do you want to lose support? Yes
5. Click cancel on the reorientation dialog.
6. Enter edit mode: No constraints...

Why?
GeoUndef not checked when deleting all external geometry (on dettaching from the support).

Solution:
Check for GeoUndef.
2015-10-13 21:32:55 +02:00
wmayer
a4d1dbe5f0 + rework BoundingBox class and its Python binding 2015-10-11 00:18:53 +02:00
wmayer
b7be7aec13 + Prefer prefix ++/-- operators for non-primitive types 2015-10-07 13:38:17 +02:00