Commit Graph

2616 Commits

Author SHA1 Message Date
0penBrain
01e0948a2a [Bugfix]Sketcher: edge/point colors in preferences aren't took into account
Regression introduced by 58a9af2 (PR #9151)
2023-04-10 11:13:02 +02:00
wmayer
6237a0e67b Gui: rename getPointOnScreen() to getPointOnViewport() 2023-04-08 13:51:32 +02:00
André Caldas
9d54668d1e Deletes GCS::Constraint directly instead of calling GCS::free(). 2023-04-06 16:29:48 +02:00
wmayer
03cf7f05bf [skip ci] Sketcher: disable button fixDegenerated when opening the dialog 2023-04-05 11:22:27 +02:00
wmayer
1fc3f52e73 Sketcher: fix -Wclazy-connect-by-name 2023-04-05 00:44:13 +02:00
wmayer
73f5e5ad57 Sketcher: restore toolbars when changing between workbenches in edit mode
This partially fixes issue #9135
2023-04-03 17:36:06 +02:00
luzpaz
f5e58adad2 Fix trailing whitespace 2023-04-02 12:18:13 +02:00
0penBrain
58a9af212a Sketcher: do not apply line/edge color preference to existing sketches, fixes #8188 2023-04-01 16:31:17 +02:00
0penBrain
8bea52a5bf Gui: prevent crashes on MacOS using boost::format 2023-03-31 15:22:03 +02:00
Paddle
4dca86c503 Sketcher: Grid pref: Change names. 2023-03-27 15:22:32 +02:00
Uwe
b9864e7b0a [Sketch] placecgs: remove unused includes
- also sort includes
- also fix too long lines etc. (done by clang formatter)
2023-03-26 20:27:18 +02:00
wmayer
506615042e Sketch: fix trailing whitespaces of recorded sketcher commands 2023-03-26 18:41:56 +02:00
xtemp09
a65a7f6740 [Sketcher] Fix segmentation fault in ViewProviderSketch::setEdit
Closes #8979
2023-03-25 00:02:32 +01:00
Ajinkya Dahale
fc3086a96e [Sketcher] Fix some coincidence issues in B-spline drawing
See https://github.com/FreeCAD/FreeCAD/pull/8530#issuecomment-1474824366.

When there are already existing points and coincidence auto-constraints are
added in the process of making a B-spline (either by control points or
interpolation), unintended behaviour can happen.

Additionally, when creating B-spline by interpolation, if consecutive points are
coincident (or very close to each other), the OCCT algorithm fails. This is also
prevented in this commit.
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
60e79a14e4 [Sketcher] Fix corner-case issue creating periodic b-splines
See: https://github.com/FreeCAD/FreeCAD/pull/8530#issuecomment-1474824366.
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
d2d69e274c [Sketcher] Run clang-format on DrawSketchHandlerBSplineByInterpolation.h 2023-03-24 16:30:48 +01:00
Ajinkya Dahale
d6060c79aa [Sketcher] Clear out some TODOs and other comments 2023-03-24 16:30:48 +01:00
Ajinkya Dahale
02558f3793 [Sketcher] Fix and support periodic B-spline by interpolation
This commit is part of a project funded by the Open Toolchain Foundation under
the title "Open Toolchain Foundation - Curve drawing tool in Sketcher
Workbench".
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
bae30c6bd7 [Sketcher][planegcs] Fix knot position in non-uniform B-spline
The default factors set in `addConstraintInternalAlignmentKnotPoint` does not
work if the knots around a C1 knot are not equally far.
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
176562c60d [Sketcher] Disable degree setting in B-spline by interpolation
This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
ab64e2251d [Sketcher] Add missing GUI elements for B-spline by knots
Commented out the periodic version for now since they don't work completely well.

This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
944c31cf7b [Sketcher] Add icon for B-Spline by interpolation tool
This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"

[Sketcher] Add better icons for `CreateBSplineByInterpolation`

Courtesy @paddlestroke.
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
7c1a2d738e [Sketcher] Support variable multiplicities in B-splines
As a side-effect also prevents a segfault possible by providing just 3 points.

[Sketcher] Clarify that mults might not be followed

Some examples when this may be ignored include:
1. A number higher than 3 is given (because cubic B-splines are created)
2. If the knots just before and just after have multiplicities >=3, the piece
between these two is fully continuous, and this (middles) point will only be
constrained with point-on-object.

This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
3e5f3a9a57 [Sketcher] Constrain first pole weight in exposeInternalGeometry
This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
b8956d3f1b [Sketcher] [WIP] Add periodic B-spline support for interpolation DSH
This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
bc98757da8 [Sketcher] Fix typos caused by copying content in new DSH
Some parts of `DrawSketchHandlerBSplineByInterpolation` were taken from
`DrawSketchHandlerBSpline` but not modified to reflect the differences.

This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
9c0b75ddf0 [Sketcher] Clarify keyboard input for B-spline DSH
Specifically, when drawing by interpolation, only cubic splines are currently
supported.

Some related "TODO" comments are also removed or modified.

This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
Ajinkya Dahale
fc05c6bae3 [Sketcher] Create DSH for drawing B-splines by interpolation
Only creates 1-degree splines by describing knots.

This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
2023-03-24 16:30:48 +01:00
0penBrain
ab01f8e143 Sketcher: use default palette text color for normal solver messages
These messages had a forced black color which is a problem when using
 OS dark themes.
2023-03-23 10:50:01 +01:00
Uwe
2cb2063249 [Sketch] Constraints.cpp: formatting fixes
- fix too long lines
- also let clang reformat the file to uniform the formatting
2023-03-20 16:53:41 +01:00
Florian Foinant-Willig
27ed6d6349 Fix circles distance constraint for concentrics 2023-03-20 16:02:08 +01:00
Abdullah Tahiri
f7f78aa44b Missing overrides 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
6ffd22fa9b Refactor of CmdSketcherSnap and SnapSpaceAction to reduce verbose calls to retrieve preference parameters 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
a07630dfb3 Refactor parameter in a single place 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
5ae5d0db87 Prevent unnecessary update of snapAngle, block signals when auto updating 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
8d33a24092 Remove unnecessary ViewProvider retrieving and checking, as it is unused 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
65ec96d12d Rename angleSnapEnabled to angleSnapRequested for consistency with the other snap flags 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
75fd0dbc73 Remov warning -squash group by meaningful groups 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
e763fd3d80 Remove warning - SnapManager initialisation order in constructor different from class declaration 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
41408b411f Encapsulate interface data members 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
50b3662535 Rename preference parameter 2023-03-19 19:14:22 +01:00
Abdullah Tahiri
af0f4b10f6 Remove left-over code 2023-03-19 19:14:22 +01:00
Paddle
de57296576 Sketcher: Snap: Add 'Snap at angle' to Arc of Ellipse DSH. 2023-03-19 19:14:22 +01:00
Paddle
4922a48997 Sketcher: Snap: Add 'Snap at angle' to Ellipse DSH. 2023-03-19 19:14:22 +01:00
Paddle
7b7368b04b Sketcher: Snap: Add 'Snap at angle' to Line DSH. 2023-03-19 19:14:22 +01:00
Paddle
e62d6b854b Sketcher: Snap: Add 'Snap at angle' to Arc DSH. 2023-03-19 19:14:22 +01:00
Paddle
7d97a5d8da Sketcher: Snap: Add 'Snap at angle' support to DrawSketchHandler. 2023-03-19 19:14:22 +01:00
Paddle
0f274c2e07 Sketcher: Snap: initial implementation: - creation of SnapManager class. - Move grid snap to this new class. - Add snap to object. - Add snap at angle. 2023-03-19 19:14:22 +01:00
flachyjoe
21c2eb6014 Sketcher: Add circle to circle distance constraint 2023-03-19 14:05:35 +01:00
Paddle
5090cf3436 Sketcher: Constraint Widget: Change showHideButton from QPushButton to QToolButton to avoid style problems. 2023-03-18 18:22:21 +01:00