Commit Graph

512 Commits

Author SHA1 Message Date
Abdullah Tahiri
05e8a7cec2 GCS: Extension of solver geometric elements to store whether they have dependent parameters 2018-05-31 11:39:28 +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
31e902d204 GCS: Solver dependent parameters retrieval 2018-05-31 11:39:02 +02:00
Abdullah Tahiri
e97e616686 Sketcher: Fix crash on applying dimensional constraint to external element 2018-05-27 19:43:05 +02:00
luz.paz
aa9c0e16ff whitespace cleanup 2018-05-19 12:06:34 -04:00
luz.paz
69b3b0b7f2 Misc. typos 2018-05-19 12:06:34 -04:00
luz.paz
9f9980eef4 removed newline altogether 2018-05-02 15:48:01 -04:00
luz.paz
9ba3e0345e Used QChar::fromLatin1('\n') instead 2018-05-02 14:57:49 -04:00
luz.paz
138b318c97 Added QString::fromUtf8("\n") 2018-05-02 00:50:06 -04:00
luz.paz
8057a45d4b Crowdin: more fixes 2018-05-02 00:50:06 -04:00
Abdullah Tahiri
6b5836dcc7 Sketcher: Bug fix - prevent inter part/body links
=================================================

With the support for external geometry during carbon copy, it was introduced a way for creating inter-part/inter-body links. See:
https://forum.freecadweb.org/viewtopic.php?f=10&t=27700&p=223736#p223736

This commit closes this door, while still allows carbon copy with external geometry support within the same body.
2018-03-30 21:00:24 +02:00
luz.paz
728e1c9e55 [For v0.18] Sketcher: Doc typo fix 2018-03-25 11:58:40 +02:00
Abdullah Tahiri
aa010488fb fix string to char * conversion 2018-03-17 13:30:34 +01:00
Abdullah Tahiri
b82d393b8c Sketcher: Carbon Copy Support for external geometry 2018-03-17 13:30:34 +01:00
Abdullah Tahiri
7b795c14cf Sketcher: Move point from python fix
====================================

https://forum.freecadweb.org/viewtopic.php?f=22&t=27282#p218637
2018-03-08 11:30:16 +01:00
Abdullah Tahiri
e5e6ff9509 Sketcher: complete type and representation 2018-02-22 19:19:22 +01:00
wmayer
b780ba650f fix scan coverity issues 2018-02-10 14:29:49 +01:00
Abdullah Tahiri
ec719e98fd Sketcher: Expose Type as readonly python attribute 2018-02-07 15:32:43 +01:00
wmayer
63a2bfcc8f expose more members of Constraint class to Python 2018-01-27 19:35:02 +01:00
wmayer
6fc5efa2e7 fix const correctness, restore sketcher icon 2018-01-26 17:21:02 +01:00
Abdullah Tahiri
5e11e37712 Sketcher: Python Interface for Constraint Virtual Space
=======================================================

set/get/toggle python interface to enable to set the virtual space status of a constraint via SketchObject.
2018-01-26 17:02:46 +01:00
Abdullah Tahiri
2ec9645a6b Sketcher: Extension of constraints to store virtual space affiliation
=====================================================================

The constraint class has been extended so that every constraint knows and serializes whether it is in virtual space or in normal real space.
2018-01-26 17:01:11 +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
fa3e0462e0 Sketcher: Blocked Constraint Python 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
4bfa12d86d Sketcher: Correction of B spline normals
========================================

When writting solver implementations it has to be taken into account that the normal is not to be provided in the sense of the curvature, but to
the left when walking a curve from start to end.

https://forum.freecadweb.org/viewtopic.php?f=10&t=26312#p209486

This commit has impact on all the previous files using bspline and endpoint to endpoint tangency.

A work-around is to delete the tangency and do it again.
2018-01-20 17:21:26 +01:00
wmayer
adaf9323f3 improve whitespaces 2018-01-13 14:07:15 +01:00
Abdullah Tahiri
e1bf2045dd Sketcher: Overload delConstraintonPoint Python to allow deletion on GeoId and Pos 2018-01-13 13:55:56 +01:00
wmayer
5cdee243a1 fix const correctness 2018-01-01 22:25:11 +01:00
Abdullah Tahiri
d4e8b95197 Sketcher: Support for detecting expressions in constraints 2018-01-01 21:00:06 +01:00
Abdullah Tahiri
e85da016fe Sketcher: Solver angle -pi,pi conversion corrected
fixes #3288
2018-01-01 20:28:53 +01:00
wmayer
51c47f1efb improve whitespaces 2018-01-01 19:36:57 +01:00
Abdullah Tahiri
952aaa458e Sketcher: Fix transfer of tangency and perpendicular end-to-endpoint constraints
================================================================================

When transfering constraints to coincident points on deletion of geometry, a tangency/perpendicular constraint
cannot be blindly transfered as the destination edge may not be tangent/perpendicular leading to unexpected behaviour.

However, the user does expect that something that was coincident with such end-to-endpoint constraint (which implicitly includes a coincident constraint)
remains coincident after deletion. Therefore, the change of type to coincident.

This implicitly solves the problem of representation of constraints leading to a crash in coin3d.

fixes #3291
2018-01-01 19:27:41 +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
d64575a111 Sketcher: Merge, copy expressions
===================================

Support for copying expressions instead of hard values.

fixes #2936
2017-12-12 23:08:44 +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
Eivind Kvedalen
71f9f4824f Sketcher: Fixed regression in fix for issue #3245. 2017-11-28 19:14:57 +01:00
wmayer
1a6e5db7f6 move encodeAttribute from Property to Persitence to avoid code duplication 2017-11-26 18:38:45 +01:00
luzpaz
cc87c20afe Make uniform the use of B-spline visible to users
Forum thread: https://forum.freecadweb.org/viewtopic.php?f=8&t=25411
This commit does not include fixes to source  comments unless they were 'doxygenated'.
No .xml files were altered either.
2017-11-17 19:30:37 -05:00
Eivind Kvedalen
5b22a8a133 Sketcher: Fix for issue #3245, including regression test. 2017-11-16 21:44:23 +01:00
luzpaz
35ec477426 More typos, grammar fixes, uniformity 2017-11-15 10:46:43 -05:00
Abdullah Tahiri
6210b602de Sketcher: Python command to delete all internal geometry and constraints of an sketch 2017-11-06 14:18:12 +01:00