Commit Graph

5904 Commits

Author SHA1 Message Date
Yorik van Havre
38fffd8218 Draft: Enabled importing of SVG's symbol and use elements 2015-06-26 17:01:43 -03:00
Yorik van Havre
fed516d582 Arch: fixed bug in rebars 2015-06-26 13:50:02 -03:00
Daniel Falck
1a1927b8d5 added units to Draft Point Properties 2015-06-25 23:34:01 -03:00
Yorik van Havre
89cbdb35b6 Arch: External edges are now automatically removed from Rebars base sketches 2015-06-25 19:54:57 -03:00
wmayer
864e0bcccb + make it more obvious what BRep mode for IGES export means 2015-06-25 16:41:53 +02:00
Abdullah Tahiri
cac47d2548 Sketch: Bug Fix: Maintain the Elements and Constraint Widget synchronized
=========================================================================

What?
Sometimes this widgets where out of sync

Why?
Under the update only when it is redrawn policy, sometimes only one of them, i.e. the one associated with the property
triggering the updateData was updated.

Solution:
Both are updated after every redraw.

It also complements the previous bug fix related to crash on deleting, by updating the widgets to account for the deleted geometry.
2015-06-25 14:33:27 +02:00
Abdullah Tahiri
214169616d Sketch: Bug fix: On delete crash with unsuccesful solving
==========================================================

Fixes the one reported by JMG here (Thanks!!):
http://forum.freecadweb.org/viewtopic.php?f=3&t=11508#p92693

Why?
- The newly introduced redrawing policy requires that the solver geometry matches in number the sketchobject geometry.
- Most (all) problems with updateColor or getGeometry returning a null pointer are related to an out of sync between UI geometry and SketchObject geometry.

General solution:
- In other bugs, a missing "solve()" is the problem, once the solver and sketchobject geometries have the same number, an SketchObject::OnChanged triggers
a VPSketch::draw (via VPSketch::updateData) which updates the UI geometry to match SketchObject geometry and then the problem does not arise.

Particular solution:
- In this bug, the problem is not a missing solve, but the fact that the solving was not succesful and did not synchronize the geometries, however triggering a
draw() on unsuccessful solving, syncronizes the UI geometry with the SketchObject geometry and the crash is gone.
2015-06-25 14:33:22 +02:00
Eivind Kvedalen
3a69c926b5 Spreadsheet: Fixed bug in dependency tracking between objects. 2015-06-25 10:40:29 +02:00
Eivind Kvedalen
2e7b4602a9 Spreadsheet: Added initializer for Spreadsheet::RangeExpression class. 2015-06-25 10:40:15 +02:00
Eivind Kvedalen
c61c12d834 Unit: Added overflow/underflow checking. 2015-06-25 10:40:00 +02:00
wmayer
165261e358 + fix memory leak 2015-06-24 20:07:36 +02:00
wmayer
c3c27817b6 + whitespace fixes 2015-06-24 19:59:53 +02:00
Abdullah Tahiri
2a54fba098 Sketcher: SparseQR as default QR method
=======================================

The SparseQR is set as default method. However, in accordance with the previous commit, only if a new enough Eigen library is present will SparseQR be executed.

If the library is old and SparseQR can not be reliably used, FC will automatically fall back to use DenseQR.

This ensures that users that have a new enough library > 3.2.2 will benefit from the performance increase, while the users that use older library will still have
the same performance as in legacy FC.
2015-06-24 17:57:06 +02:00
Abdullah Tahiri
ffaa0c8249 Sketcher: SparseQR conditional compilation
==========================================

For Eigen>=3.2.2 SparseQR is compiled in

For older versions SparseQR is not compiled in and if the option is selected FC gives a warning in the console and falls back to DenseQR.

This ensures that a user can get a sketch solved and work normally even if SparseQR is selected and the Eigen version is too old to support SparseQR.
2015-06-24 17:57:05 +02:00
Abdullah Tahiri
1fc88ebe24 Sketcher: Auto Update Mode bug fix
==================================

Bug:
http://forum.freecadweb.org/viewtopic.php?f=10&t=11341&start=60#p92422

Why?
- When coding Auto Update Mode I forgot to solve the sketch when the constraint is cancelled to restore the solver level constraints.
2015-06-24 17:57:05 +02:00
Abdullah Tahiri
82e24d830e Sketcher: Solver Advanced Control: New Param: QR Pivot Threshold
================================================================

A new parameter added to the form in order to control how low a value should be
to be considered zero (how high a value shall be to be accounted for in rank calculation)

Debug for QR pivot threshold is also added.
2015-06-24 17:57:04 +02:00
Abdullah Tahiri
8f68b14627 Sketcher: DL Solver Debug Improvement
=====================================

- In "Iteration Level" debug mode, DL now shows the stop condition code.
- More debug code
2015-06-24 17:57:04 +02:00
Abdullah Tahiri
efb08cd11c Sketcher: Disable Eigen multithread
===================================

Eigen currently only provides multithread for matrix products. It has been reported that it is even slightly slower than single-thread.
Therefore, temporarely the code is commented out. If Eigen ever implements multithread for QR decomposition, then it will make a lot of
sense to enable this.
2015-06-24 17:57:03 +02:00
Abdullah Tahiri
7f442c5a3f Sketcher: Improvement: Continuous Mode - View sketch Perpendicular
==================================================================

It allows the view sketch perpendicular button to be active during continuous mode creation (and if activated does not exit the continuous mode).

Feature requested:
http://forum.freecadweb.org/viewtopic.php?f=10&t=11051&start=30#p92256
2015-06-24 17:57:02 +02:00
Abdullah Tahiri
22bcb40484 Sketcher: Bug fix: Dense QR is set by default
=============================================

EigenQR branch 3.2 with debug code fails an assertion. The result is generally ok if we disable the assertions, however it
eventually leads to memory leakage.

This commit reenables Eigen's assertions when in debug mode, and sets dense QR as default QR algoritm until Eigen's issue is solved.
2015-06-24 17:57:02 +02:00
Abdullah Tahiri
cb2d70b4f0 Sketcher: Bug fix: Solver Advanced Control in BFGS
==================================================

- ternary operator usage was making BFGS not to iterate
- Amount of debug information for BFGS increased
2015-06-24 17:57:01 +02:00
Abdullah Tahiri
86f0df4f3c Sketcher: Improvement Continuous Creation Mode: Leave Sketch
============================================================

This enables to exit the sketch by clicking the corresponding toolbar icon, even when in creation mode, i.e.
with a drawHandler active.

Requested here:
http://forum.freecadweb.org/viewtopic.php?f=10&t=11051&start=30#p92181
2015-06-24 17:57:01 +02:00
Abdullah Tahiri
f3592c1216 Sketcher: Improvements: Solver Advanced control
===============================================

- Increased solver debug
- Changing default values from float to string, as float has "only" a precision of 12 decimals.
- Default values as macros
2015-06-24 17:57:00 +02:00
Abdullah Tahiri
516b0d3c56 Sketcher: Workaround for Eigen bug: SparseQR crash on matrices with rows>cols
=============================================================================

There is an issue with an assertion in Eigen, as reported here:
https://forum.kde.org/viewtopic.php?f=74&t=117474
http://forum.freecadweb.org/viewtopic.php?f=10&t=11341&p=92153#p92146

The work-around is to disable debug assertions for Eigen until the problem
gets solved.
2015-06-24 17:57:00 +02:00
Abdullah Tahiri
6030da1182 Sketcher: Solver improvements and bug fixes
===========================================

- Improvement Debug added to redundant solving in Iteration Mode, to show when just one iteration solved the system
- Fix wrong QR information on empty sketch
2015-06-24 17:56:59 +02:00
Abdullah Tahiri
bae32f74bb Sketcher: New setting: Show advanced solver taskbox
===================================================

I makes the advanced solver taskbox by default disabled (not shown) and provides
a setting in Preferences->Display->Sketcher to enable it.
2015-06-24 17:56:59 +02:00
Abdullah Tahiri
796c9d79d4 Sketcher: New Features: SparseQR decomposition and Solver advanced control TaskBox
==================================================================================

The solver has been adapted to use Eigen's SparseQR QR decomposition algorithm. The original
Dense QR implementation is maintained and can be selected using the Advanced Control TaskBox (see below).

The use of SparseQR provides over an order of magnitude improvement in solving time in complex sketches due to
the Sparse nature of the Jacobian matrix of the system of equations.

The solver advanced control is a new TaskBox in the Sketcher that allows to select which algorithms are to be used for
the different solving operations and tweak its parameters. It is not intended to be a user control, but means to debug
solving problems and improve the algorithms and their configuration.

This commit also introduces multithread support for Eigen. Currently it is only limited to products and does not provide
a substantial speed improvement. It is expected to have more multithreaded operations in Eigen in the future.

As a bonus, the TaskBoxes in the Taskbar of the Sketcher remember the last state (collapsed or deployed).
2015-06-24 17:56:58 +02:00
Abdullah Tahiri
02df1acb5f Gui: New feature: Extension of TaskView to notify if a taskbox is hidden or visible
===================================================================================

http://forum.freecadweb.org/viewtopic.php?f=10&t=11363
2015-06-24 17:56:58 +02:00
Abdullah Tahiri
480d23f8e1 Sketcher: Bug fix: Unexpected crashes during certain operations
===============================================================

The sketcher crashed for example during effecting a fillet operation.

Cause:
The ElementsWidget/ConstraintWidget was being updated as a consequence of adding/removing geometry/constraints, and it was effecting
a selection after the update, in cases where the geometry in the screen was not being redraw (because the sketchobject was still unsolved), therefore
trying to select an element that according to ViewProvider did not exist (as it is created during redraw).

Solution:
Widgets update when their properties changes, provided that a redraw is effected (which actually also saves some (negligible) time, as they are only updated when they should).
2015-06-24 17:56:57 +02:00
Abdullah Tahiri
93c836fdcf Sketcher: Bug fix Trim
======================

In no update mode, the last constraint was not enforced. The DoF was not properly shown.

The trim operation it is always solved at the end now if in no recompute mode.
2015-06-24 17:56:56 +02:00
Abdullah Tahiri
65310f00ab Sketcher bug fixes: Crash on deleting a line from the sketch
============================================================

- Crashing on deleting line on fully constraint box

As a bonus:
- Fully constrained sketch not shown in green on opening the sketch
2015-06-24 17:56:56 +02:00
Przemo Firszt
4caa464ebb FEM: All FEM results are stored in a single object
Functionality previously provided by setNodeColorByResult is now
in setNodeColorByScalars. FemResult* object is no longer required,
the function accepts list of elements and a list of values.

Functionality previously provided by setNodeDisplacementByResult is now
in setNodeDisplacementByVectors. FemResult* object is no longer required,
the function accepts list of elements and a list of vectors.

A side effect: FemResultValues and FemResultVector are no longer used
and have bee removed.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
2015-06-24 17:44:02 +02:00
DeepSOIC
ed6af74a78 Navigation: fix unable to deselect after editing a sketch
After editing a sketch, it was impossible to deselect the just-edited
sketch by clicking empty space (gesture navigation).
2015-06-24 17:27:07 +02:00
wmayer
9680f13854 + fix loading of certain urls in web page 2015-06-24 13:35:13 +02:00
Fredrik Johansson
16c740a6f9 Add ability to have external orocos-kdl library instead of the suplied
in FreeCAD, used in Robot and Path workbenches

cmake switch: FREECAD_USE_EXTERNAL_KDL

Makes Robot workbench and Path compilable on OS X 10.9
2015-06-24 11:54:31 +02:00
lorenz_l
bc920f9a24 set names for QTimer in mainWindow, to find them from python 2015-06-23 20:23:52 +02:00
Yorik van Havre
18624df555 Draft: Better docstring for DraftGeomUtils.fillet() 2015-06-22 22:03:13 -03:00
Yorik van Havre
4379846dfa Arch: Section planes now restore the view clipping when loaded 2015-06-22 21:58:56 -03:00
Yorik van Havre
cd25a34171 Arch: added warning message when wall base is not a Part or Mesh 2015-06-21 21:45:18 -03:00
wmayer
72abf54d12 + setup qss search paths 2015-06-19 23:27:39 +02:00
wmayer
0ea718177d + set utf-8 encoding when recording a macro 2015-06-19 14:52:20 +02:00
Abdullah Tahiri
074d5d7f11 Sketcher: Bug fix External geometry not appearing upon insertion
================================================================

A last moment change to regulate redrawing introduced this issue (reducing the redrawing to the cases where the solver geometry and the sketchObject geometry are equal).
This change also solved other issues.

The case of adding external geometry is special because the DoF is the same after insertion, yet there is an insertion (as opposed to the toggle case, where there is a change but no insertion).

SketchObject has been adapted to require a solver update before moving (which also caused a non-yet-reported crash, a separate bug), and CommandCreateGeo has been adapted to trigger a solve with
auto update mode disabled. This solve is a very low cost one as the geometry is already in place.
2015-06-17 14:53:34 +02:00
Yorik van Havre
8b4492ebc5 Arch: small bugfix in cutvolumes 2015-06-17 09:45:01 -03:00
wmayer
238becaebb + further optimization in sketcher 2015-06-16 10:18:11 +02:00
wmayer
788fadf4a8 + fix const correctness 2015-06-15 23:42:37 +02:00
Abdullah Tahiri
ec5f3b2b98 Sketcher: new Feature: Group creation of Sketcher geometry and other improvements and bug fixes
===============================================================================================

Group creation:
- complex geometries (consisting of several geometry elements and constraints) have been rewritten to use python list (one command call for all geometries and constraints)
- Ellipse ExposeInternalGeo as group creation of geometries and constraints

To construction mode creation:
- addGeometry python and SketchObject functions modified to take an additional optional parameter "construction" to create the geometry/geometries directly as construction.
  In addition to the shorter form, this helps generate less amount of onChange propagation and Redraws.
- all the geometry creation commands in CommandCreateGeo.cpp have been rewritten to use the new construction argument. This includes modifying the regular polygon script to
take a new optional parameter to create geometry as construction in addGeometry.
- special care is taken in group creation not make construction points
- Show/hide internal geometry implemented with this option.

To solving:
- the solve previously included after every geometry addition (when in no Update, e.i. no Recompute mode) has been removed and each Gui::Command calls either an UpdateActive
for recompute or a Solve in no Update mode. This is behaviour is less intrusive and uniform with group creation.

Bug fixes and redrawing reduction:
- Fixes the CheckId exception problem. The solution also helps further remove redraws during creation of complex geometry (e.g. Slot)
- Fixes touching the sketch by only opening it.
- Code clean up.
2015-06-15 22:56:36 +02:00
Abdullah Tahiri
61bd2d41ac Sketcher: Requested Feature: Remove help button
===============================================

The help button next to the close button in the Task dialog is now removed.

It was requested that this button is removed as it is inconsistent with other help sources and it is not implemented.
2015-06-15 22:56:20 +02:00
Abdullah Tahiri
d1acd124cc Sketcher: Bug fix: Undo/Redo implementation
================================================

Fixes a bug in master that the dependent 3D geometry would not update on Undo (in Auto update mode enabled).

Undo and redo signals are handled by ViewProvider in order to introduce an recompute or solve() of the sketchObject
as determined by the Auto Update Mode in order to update DoF and dependent geometry if necessary.
2015-06-15 22:56:04 +02:00
Abdullah Tahiri
da5270131c Gui New Feature: Gui::Document support for App::Document undo and redo signals
==========================================================================

It defines new slots connected to App::Document's signalUndo/signalRedo, which
triggers Gui::Document's signalUndoDocument and signalRedoDocument signals.

setModified is not executed upon redo/undo, as this is already done on modification of the properties if
properties were modified, and if there were not, no setModified is needed anyway.
2015-06-15 22:55:49 +02:00
Abdullah Tahiri
eb7a3c763c Bug fix: General reduction solution / new sketch solving model
=================================================================

The new solving architecture focus all the solving on the SketchObject.

Actions that change the DoF can call execute() (i.e. recompute) or Solve() depending on whether a full recompute of dependent features is required or not.
In both calls the geometry of the solver is updated with the geometry of the SketchObject.

The only additional call that calls the solver is MovePoint. This function may or may not update the geometry of the SketchObject
(as now it is intended for UI related solving, like dragging, rubberbands, ...).

In operations that do not involve a change of DoF and therefore do not require a sketch solving, it may happen that as a side effect of moving a point, the
geometry changes to old behaviour. In order to avoid that, those SketchObject operations, as for example setConstruction or ToggleConstruction,
must set a flag "bool solverNeedsUpdate" to true. In case a movePoint is executed before any other solver execution, the geometry is first updated and then
the moving is performed.

So to keep in mind when programming sketcher operations:
-> Need recompute (UpdateActive)
-> Need solving because DoF changed (solve())
-> The operation does not change DoF (set solverNeedsUpdate to true)
2015-06-15 22:55:28 +02:00