Commit Graph

1194 Commits

Author SHA1 Message Date
Abdullah Tahiri
620188073e Sketcher: Avoid single tangency plus coincident when preexisting single tangency
================================================================================

fixes #3299 (remaining)

Draw a line. Draw an arc. Make edge to edge tangency. Select endpoints. Try to create a coincident constraint. You now get an Endpoint-to-Endpoint tangency.
2018-01-27 12:33:11 +01:00
Abdullah Tahiri
180d722a53 Sketcher: Avoid single tangency when preexisting coincident
==========================================================

partly fixes 3299

Draw a line. Draw an arc. Make one endpoint of each coincident. Select the line. Select the Arc. Hit tangency. You now get an Endpoint-to-Endpoint tangency.
2018-01-27 12:33:11 +01:00
wmayer
f8eaa6eff4 fix const correctness, restore sketcher icon 2018-01-26 17:21:02 +01:00
Abdullah Tahiri
696eb7433f Sketcher: Switch virtual space toolbar button to operate on selection
======================================================================

The switch virtual space toolbar button operated just to switch from one virtual space to the other (without any element selected), so switching the "mode".

Now if there is a selection, all the constraints are moved to the alternative virtual space.

It works similar to the toggle buttons for geometry elements and constraints
2018-01-26 17:05:58 +01:00
Abdullah Tahiri
740afeb642 Sketcher: constraints' widget checkbox as python command
========================================================

Enables do/undo after switching constraints from one space to the other
2018-01-26 17:05:25 +01:00
Abdullah Tahiri
879ff70886 Sketcher: Switch Virtual Plane icon 2018-01-26 17:05:00 +01:00
Abdullah Tahiri
8a2ec12b5a Sketcher: Bug fix not updating constraints on switch of virtual space 2018-01-26 17:04:28 +01:00
Abdullah Tahiri
4b7ef1c5b0 Sketcher: New toolbar for VirtualSpace and Command to switch VirtualSpace 2018-01-26 17:04:08 +01:00
Abdullah Tahiri
0c888309d6 Sketcher: Extend virtual space switching and update to constraints widget 2018-01-26 17:03:39 +01:00
Abdullah Tahiri
d987930338 Sketcher: Enable switching of virtual space in ViewProvider 2018-01-26 17:03:16 +01:00
Abdullah Tahiri
31189b6c20 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
d559c1477b Sketcher: Enable Virtual space updates on the View Provider
===========================================================

Basic initial working implementation to hide constraints.
2018-01-26 17:02:22 +01:00
Abdullah Tahiri
cccaa6d4dc Sketcher: Extension of Constraints Widget to support checkboxes for Virtual Space
=================================================================================

The checkboxes enable a constraint to swap virtual space.

If checked the constraint is visible in the selected space and hidden in the other space (Real Space or Virtual Space).
If unchecked the constraint is visible in the other space and hidden in the selected space.
2018-01-26 17:01:35 +01:00
Abdullah Tahiri
1899680ddc 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
23bf7f39a3 Sketcher: comment typos
Found via `codespell`
[skip ci]
2018-01-25 18:47:34 -02:00
Abdullah Tahiri
c509ec5ded Sketcher: Fix normal rendering when full-constraint
fixes #3320
2018-01-23 16:57:33 +01:00
wmayer
38da0c7312 improve whitespace, fix const correctness 2018-01-23 00:40:41 +01:00
Abdullah Tahiri
c7b137fe85 Sketcher: Change nomenclature relating to Block constraint 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
a4c29ba521 Sketcher: Constraint widget adapted to Block constraint 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
c27d5a26b2 Sketcher: UI Block constraint creation sanity checks
====================================================

Avoid creation of constraints if they would lead to undesirable conflicting situations.
2018-01-22 22:52:56 +01:00
Abdullah Tahiri
9634da6811 Sketcher: Block constraint - Prevent from adding constraint if the solver has redundant/conflicting constraints 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
34f533b0e1 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
9b7d1d6042 Sketcher: Blocked constraint viewprovider rendering 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
d2e89b98d4 Sketcher Blocked Constraint icons 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
1932a2f152 Sketcher: Blocked Constraint toolbar commands 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
7495fe1c31 Sketcher: Blocked Constraint Python 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
48fc503364 Sketcher: Blocked Constraint solver level 2018-01-22 22:52:56 +01:00
Abdullah Tahiri
a0ccdb5218 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
97f0020093 improve whitespaces 2018-01-13 15:49:39 +01:00
Abdullah Tahiri
bc4d463cdf Sketcher: Remove errors in reporting view while deleting
=======================================================

fixes #2275

https://freecadweb.org/tracker/view.php?id=2275

Deletion of coincidents rely on selected vertex. The original code was trying to delete a coincident without checking whether one was there.

The implementation now relies on checking whether a coincident is present.
2018-01-13 15:47:02 +01:00
wmayer
348e666fdc improve whitespaces 2018-01-13 14:07:15 +01:00
Abdullah Tahiri
0dd0eab0d0 Sketcher: Overload delConstraintonPoint Python to allow deletion on GeoId and Pos 2018-01-13 13:55:56 +01:00
Abdullah Tahiri
0d21e94d3f Sketcher: Improve validation ui to select whether to ignore construction geometry or not
========================================================================================

Users generally expect that validate Sketch checks the visible part, perhaps because it is not called from the sketcher's edit view, but from the 3D view, perhaps
because that part is relevant for further construction.

On the other hand the tool's name is Validate Sketch and construction geometry belongs to the sketch.

So a new checkbox is introduced, by default enabled to ignore construction, but still allowing the user to make it operate in one direction or the other.

See:
https://forum.freecadweb.org/viewtopic.php?f=3&t=26139&p=208582#p208693
2018-01-13 11:31:11 +01:00
Abdullah Tahiri
7599292287 Sketcher: Fix "highlight open vertex" visualization
===================================================

fixes #3306
2018-01-13 11:30:48 +01:00
Abdullah Tahiri
10c0af4a8a Sketcher: Validation tool improvement
======================================

The sketch validation tool offers the functionality to detect missing coincidences. It is a problem that internal geometry causes detected missing coincidences.

Additionally, the tool only shows the visible profile and not the construction geometry.

This commit introduces the ignoring of construction geometry, which "fixes" the two behaviours indicated above.

fixes #3298
2018-01-13 11:30:35 +01:00
wmayer
0b95e866b9 fix const correctness 2018-01-01 22:25:11 +01:00
Abdullah Tahiri
9cf42d3a87 Sketcher: Settings Dialog new color for dependent constraints 2018-01-01 21:00:06 +01:00
Abdullah Tahiri
2a6f55e650 Sketcher: Special sketcher color for dimensions having an expression
fixes #3285
2018-01-01 21:00:06 +01:00
Abdullah Tahiri
69535ad7cb Sketcher: Support for detecting expressions in constraints 2018-01-01 21:00:06 +01:00
wmayer
65e7932930 improve whitespaces 2018-01-01 20:51:12 +01:00
Abdullah Tahiri
ec678e234e Sketcher: Solver angle -pi,pi conversion corrected
fixes #3288
2018-01-01 20:28:53 +01:00
Abdullah Tahiri
27cff5ce85 Sketcher: Match angle on lines representation match solver result 2018-01-01 20:28:41 +01:00
wmayer
96beb5ec7d improve whitespaces 2018-01-01 19:36:57 +01:00
Abdullah Tahiri
9ce5756011 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
88b5af4fe7 simplify debugging of changing datum constraints 2017-12-31 11:48:44 +01:00
wmayer
1ad7724d50 avoid error 'Duplicate constraint not allowed' when deleting a constraint 2017-12-31 01:57:44 +01:00
wmayer
bd4736bf0d implement PropertyConstraintListItem::assignProperty to add item for each datum constraint 2017-12-30 19:49:34 +01:00
wmayer
6ee4be519d fix heap corruption due to invalid static_cast 2017-12-29 22:32:10 +01:00
luzpaz
048c787e32 Sketcher: comment typos 2017-12-25 10:59:48 +01:00
wmayer
c18bc414bb fixes #0003252: External geometry tool keeps hovered item active after leaving 2017-12-25 10:47:51 +01:00