Commit Graph

2430 Commits

Author SHA1 Message Date
Ajinkya Dahale
36ff50088e [Sketcher] Convert curves to splines before joining 2022-12-04 08:17:20 +01:00
Ajinkya Dahale
deea97e654 [Sketcher] Join curves at common point 2022-12-04 08:17:20 +01:00
Ajinkya Dahale
c5aceb0182 [Sketcher] Add methods and tools for joining curves
Algorithm to join b-splines:
The code simple concatenates the knots, poles, weights, and knot multiplicities
together, removing data on the connection point of the second curve. Some
further study is needed to see if/when it will give an exact/good connection.

Icon courtesy @bitacovir.
2022-12-04 08:17:20 +01:00
0penBrain
53804d7e4d [CrashFix]Sketcher: prevent crash at FC closure when edit control panel is disabled, fixes #7931
Introduced by bf04c0e
2022-12-03 16:59:06 +01:00
luz paz
3148ea6651 L10N: Don't translate strings that dont contain any alphabetic character
Per 0penBrain's suggestion
2022-12-02 11:57:34 +01:00
Adrian Insaurralde Avalos
c10330f705 [fixes #5965] CarbonCopy: if existing use constraint name in expressions 2022-12-02 10:47:26 +01:00
0penBrain
5337812e23 Sketcher: TaskSketcherConstraints: defensive support of nested signal blocking 2022-12-01 16:21:50 +01:00
0penBrain
317eee4eb2 Sketcher: correctly restore constraints display according filters 2022-12-01 16:21:50 +01:00
0penBrain
875385ee9d Sketcher: cleanup TaskSketcherConstraints 2022-12-01 16:21:50 +01:00
0penBrain
087ff75340 Sketcher: also save advanced filters + minor fix 2022-12-01 16:21:50 +01:00
0penBrain
f1f9dcfc05 Sketcher: constraint settings are kept in sync with user parameters 2022-12-01 16:21:50 +01:00
0penBrain
7088930dba Sketcher: 'HideInternalAlignment' also has effect when constraint filter is disabled 2022-12-01 16:21:50 +01:00
0penBrain
293edba342 Sketcher: settings in Task Constraint are translatable 2022-12-01 16:21:50 +01:00
0penBrain
17144272c7 Sketcher: fix basic issues in Task Constraint 2022-12-01 16:21:50 +01:00
luz paz
fa98553775 Fix various typos and grammatical issues 2022-11-30 12:45:29 +01:00
wmayer
9388cea9c7 Sketcher: [skip ci] don't mix QCheckBox::setChecked() with tristate API 2022-11-29 11:03:29 +01:00
wmayer
ad1cccdd27 Gui/Mod: handle several compiler warnings:
* ignore -Wfree-nonheap-object for generated code
* replace 0 with Qt::NoModifier when creating a QKeyEvent
* in Qt 5.14 QCombobox::activated(QString) is deprecated, use textActivated
* don't mix QCheckBox::setChecked() with tristate API
2022-11-29 10:36:02 +01:00
wmayer
a6b9a53bed Sketcher: [skip ci] refactor SoDatumLabel 2022-11-24 12:59:01 +01:00
wmayer
599d0d1d7d Sketcher: [skip ci] refactor SoDatumLabel 2022-11-24 12:38:28 +01:00
wmayer
a3971bfcfd Sketcher: [skip ci] refactor SoDatumLabel 2022-11-24 11:51:26 +01:00
wmayer
10895e18ff Sketcher: [skip ci] fix compiler warning 2022-11-24 10:55:24 +01:00
wmayer
8a0816ff40 Sketch: use the focal distance to determine a correct scale factor for SoDatumLabel
This fixes #7860: Dimensions get unreadable (small) if a 2nd sketch is visible
and fixes #7082: Dimension size on perspective view scales "backwards"
2022-11-24 10:21:59 +01:00
Adrian Insaurralde Avalos
ccf0740087 Sketcher: Element widget - fix toolbuttons height 2022-11-24 02:21:49 +01:00
Paddle
33f81cd0e1 Sketcher: Element widget: - FilterBox and filter state is now registered as preference to be cross-session. 2022-11-24 01:14:43 +01:00
Paddle
142f6d8843 Sketcher: Constraint widget: Add 'Auto constraints' and 'auto remove redundant' to the setting button. 2022-11-24 01:09:38 +01:00
Paddle
13e71c0533 Sketcher: Constraint widget: Improve the filter such that the filter state and checkboxe state is cross-cession. Enabling user to 'save' filter state. 2022-11-24 01:09:38 +01:00
Paddle
22271deb2d Sketcher: Constraint widget: - Fix eye button
- move 'Internal alignment' to Geometric.
    - Fix another bug.
2022-11-24 01:09:38 +01:00
Paddle
7788ef185b Sketcher: filter list strings are updated at language change. By @0penBrain 2022-11-24 01:09:38 +01:00
Paddle
378463de03 SKETCHER: Constraint widget rework (issue 7518)
see https://forum.freecadweb.org/viewtopic.php?f=34&t=71595&start=20
2022-11-24 01:09:38 +01:00
wmayer
52398d8f58 Sketch: add missing header 2022-11-22 15:53:50 +01:00
0penBrain
80308c0105 Sketcher: fix warning about QStringLiteral used without argument 2022-11-21 09:57:54 +01:00
0penBrain
7b2a6a3bf7 Sketcher: filter list strings are updated at language change (include fix commits) 2022-11-20 15:14:19 +01:00
Paddle
15dd77512e Sketcher: Element widget: Improve filter widget. 2022-11-20 15:14:19 +01:00
Uwe
e6c53d8642 [sketch] Geo.cpp: fix compiler warning
- as reported here: https://forum.freecadweb.org/viewtopic.php?f=10&t=73647
2022-11-20 00:38:21 +01:00
luz paz
c9829a312f [Sketcher] fix header uniformity
Make uniform all Sketcher headers.
2022-11-19 16:04:55 +01:00
0penBrain
862c092c0b Sketcher: disable auto-constraint in Copy/Clone/Move commands 2022-11-18 08:18:58 +01:00
0penBrain
f6884b307c Sketcher: Clone: do not apply parallel constraint if angle constraint is applied on arc 2022-11-18 08:18:58 +01:00
luz paz
875f9eaad6 Sketcher: remove trailing whitespace 2022-11-17 23:56:13 +01:00
Ajinkya Dahale
249ee72333 [Sketcher][planegcs] Make changes as per comments on #7484
Comments by @abdullahtahiriyo.

Remove default values and smaller constructor for `CenterOfGravity` and
`WeightedLinearCombination` constraints.

Clarify comments.

Improve readability of `CenterOfGravity` and `WeightedLinearCombination`
constraints.
2022-11-16 15:35:37 +01:00
Ajinkya Dahale
2537ea883f [Sketcher][planegcs] Set knot constraint as internal alignment 2022-11-16 15:35:37 +01:00
Ajinkya Dahale
19810fac2a [Sketcher] Do not make knots construction points 2022-11-16 15:35:37 +01:00
Ajinkya Dahale
430b0baa00 [Sketcher] Stop treating knots as fixed in GUI commands
This stops constraints from becoming non-driving when not set.

Follow 0penbrain's comments

typo
2022-11-16 15:35:37 +01:00
Ajinkya Dahale
7cd2cbd29c [Sketcher] Constrain B-spline knots as linear combination of poles
Also squashes:

[Sketcher] Create center of gravity constraint in planegcs

[Sketcher] typo

[Sketcher] Use accurate "weights" for knots

By weights we mean the linear combination factor B_i(x) such that
spline(x) = sum(pole_i * B_i(x)) for _non-rational_ splines.

[Sketcher] Use more appropriate weights for knots

These are relevant for knots _away_ from any ends (and possibly other high
multiplicity knots).

[Sketcher] Make COG constraint weights user-definable

[Sketcher] Make `flattenedknots` for periodic B-Splines

[Sketcher] Fix incorrect setup of `flattenedknots`

Without ensuring enough space, iterators become invalid. These iterators are
needed because for periodic B-splines we need to pad flattenedknots with offset
values within flattenedknots.

Apparently there is still some iterator issues even after the reserve. Just use
fresh vectors instead.

[Sketcher] Apply knot constraints by parameter

Hopefully this will allow directly applying constraints on knots.

[Sketcher] Disable some knot updating

[Sketcher] Use center of gravity constraint on knots

[Sketcher] Fix knot COG constraint for periodic splines

[Sketcher] Add start/end point of periodic spline to solver

This removes the trouble of transferring constraints to the underlying knot.

[Sketcher] Support knot constraints on rational B-splines

[Sketcher] Remove virtual from overridden methods in planegcs

Follow 0penbrain's comments

[Sketcher][planegcs] Use `unsigned int` in signatures

Also `size_t` at places

Suggestions by @abdullahtahiriyo
2022-11-16 15:35:37 +01:00
Ajinkya Dahale
027504ce16 [Sketcher] Reformat some if-else for readability
Weren't folding right in spacemacs.
This commit can be omitted if undesired.
2022-11-16 15:35:37 +01:00
0penBrain
e3cd132af7 [Typo]Sketcher: 'Clone' is the first command of CompCopy, match the tooltip 2022-11-16 14:48:39 +01:00
Paddle
f9ba739e70 Sketcher: Coincidence constraint: fix error introduced by concentric capability. 2022-11-14 17:39:09 +01:00
wmayer
fce59ca723 Sketcher: fix clazy warnings:
* Wclazy-connect-by-name
* Wclazy-unused-non-trivial-variable
* Wclazy-detaching-temporary
2022-11-13 15:39:27 +01:00
Paddle
0a5358c24f Sketcher: Fix element widget repaint delay bug
Related to https://github.com/FreeCAD/FreeCAD/pull/7567#issuecomment-1304724547
2022-11-13 07:13:06 +01:00
Uwe
6091c89947 [Sketch] change polyline icon
- the same intention as https://github.com/FreeCAD/FreeCAD/pull/7588 but proposal with less strokes
2022-11-06 08:09:45 +01:00
wmayer
d119c1c7a5 Gui/Sketcher: disable geometry deselection when user holds Ctrl or additionally Shift or Alt 2022-11-05 22:56:38 +01:00