Commit Graph

2991 Commits

Author SHA1 Message Date
Ajinkya Dahale
3f1f6387d1 [Sketcher] Handle spline selection in Dimension tool 2024-02-08 23:46:17 +05:30
Ajinkya Dahale
73434e008a [planegcs] Simplify GCS::BSpline::CalculateNormal() 2024-02-08 23:46:17 +05:30
Ajinkya Dahale
1e19926a77 [planegcs] Add SketcherExport macro to classes in Geo.h
...for use in tests.
2024-02-08 20:15:17 +05:30
Ajinkya Dahale
da48a72269 [planegcs] Implement BSpline::Value()
Needed for gtests currently.
2024-02-08 20:04:28 +05:30
Ajinkya Dahale
b1ef4be6fa [planegcs] Remove some numerical testing
If needed this can be moved to a gtest,
2024-02-08 20:04:28 +05:30
Ajinkya Dahale
65b4dd10ae [Sketcher] Expose general tangency with B-splines to Sketcher
The following commits were squashed into this

[Sketcher] Handle some corner cases in AngleViaPoint

[Sketcher] Avoid redundant constraints with B-splines...

When involving tangent, perpendicular and angle constraints.

[Sketcher] Add pre-commit changes

[Sketcher] Do not allow 2-selection tangent with B-spline

Also...

[Sketcher] Report error when using direct tangency with B-splines

[Sketcher] Fix malformed constraint when B-spline is selected second

To clarify, this means the second curve selected. The position of the point in
selection order does not matter in angle-via-point.

[Sketcher] Fix wrong number for B-Spline tangent on redundancy

[Sketcher] Remove existing point-on-object in some redundant cases

Particularly when point constrained on a B-spline is being used for
tangent, perpendicular or angle via point with the same B-spline.

[Sketcher] Fix direction issue with B-spline tangents.

Without these changes the solver might try to "twist" the B-spline to make the
angle between curves be 0 instead of PI (which may be closer to the initial shape).
2024-02-08 20:04:28 +05:30
Ajinkya Dahale
82f03593fd [planegcs] Implement calculateAngleViaParams
For use in angle-via-point with complex curves.
2024-02-08 20:04:27 +05:30
Ajinkya Dahale
5ba050b467 [Sketcher][planegcs] Implement parametric BSpline::CalculateNormal
As opposed to "punctual" that already exists for curves.
2024-02-08 20:04:27 +05:30
Ajinkya Dahale
6a3c0555d0 [Sketcher][planegcs] Support angle via point with params
These are intended to use when calculating normal simply with points could be
numerically expensive or otherwise nonviable.
2024-02-08 20:04:27 +05:30
Adrian Insaurralde Avalos
963652c6a7 Avoid sending unescaped quotes to python console 2024-02-04 16:44:25 -06:00
PaddleStroke
8afa940ca2 [Sketcher] Scale DSH : adds a tool to scale geometries. (#11265)
* Scale DSH : sketcher tool to scale geometries.
* Sketcher: Rotate and Scale : Move indexInVec to Utils.h as indexOfGeoId

---------

Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
2024-02-01 09:08:58 +01:00
Chris Hennes
a54840c2c5 Sketcher: Add check for handler's existence 2024-02-01 09:08:16 +01:00
PaddleStroke
d7ee978e42 Sketcher: Fix sketcher_Copy bug when a single geometry was copied, geoId was not correct in constraints. 2024-01-30 17:26:42 +01:00
Roy-043
98712d228b Sketcher: minor fixes to 2 prefs ui files
* Titles in sentence case.
* No space before colon.
* Choose instead of chose.
* Vertex item first in "Colors outside Sketcher" as well.
2024-01-30 17:25:34 +01:00
Chris Hennes
5662c51ab4 Merge pull request #12054 from kadet1090/styling-elements-and-constraints-ui
Sketcher: Apply styling to elements and constraints UI
2024-01-23 08:40:48 -06:00
Max Wilfinger
0bef2e927b [Sketcher] enable BSpline commands in contextual right click menu 2024-01-22 12:21:01 -06:00
Chris Hennes
5f743aa36b Merge pull request #12012 from Ondsel-Development/radius_render_fix
[Sketcher] Improve rendering of arc-angle, line-angle, arc-distances and fix radius
2024-01-22 11:21:53 -06:00
Paddle
b140feabaf Sketcher: Edges pattern and width by type. 2024-01-22 11:12:42 -06:00
Chris Hennes
6dfbdfc09e Merge pull request #11537 from Ondsel-Development/copy_paste_2023
[Sketcher] Add copy/cut/paste sketcher commands
2024-01-22 10:45:22 -06:00
Kacper Donat
34b6b36547 Sketcher: Disable visibility checkbox for external geometry 2024-01-21 20:33:49 +01:00
Kacper Donat
2fac012226 Sketcher: Fix checkbox behavior for Element checkboxes
This creates new method overload for changing layer of exact
ElementItem. This fixes strange behavior of the checkboxes for elements
that were dependent not on what user clicked but on what is selected.

Fixes: #8814
2024-01-21 20:33:37 +01:00
Kacper Donat
da6a4fe57b Sketcher: Make Elements UI style aware
This commit like previous one introduces ability to style list of
elements in the sketcher. It also completely refactors the rendering
delegate introducing dedicated method for calculating rects of each
element and method for rendering each sub control. Thanks to this
refactor we can be sure that areas drawn are the same as areas checked
for events in editorEvent.
2024-01-21 20:33:34 +01:00
Ajinkya Dahale
6dda56117a [Sketcher] Visualize B-spline in edit mode
Instead of the control polygon, or "join the dots" for interpolated splines.
2024-01-20 18:45:18 -07:00
Kacper Donat
ecd591450c Sketcher: Make Constraints UI style aware
This adds reference to the actual widget to the painting of Constraints
List control of Sketcher. Thanks to this this list can now be styled
using standard mechanisms of Qt framework like QSS.
2024-01-20 21:59:01 +01:00
Kacper Donat
122f163d0c Sketcher: Draw proper checkbox control in Elements UI
This ensures that checkboxes drawn in the Elements UI of the sketcher
can be styled using the correct style.

Three changes are introduced:
1. paint() method uses style provided by the widget, not application.
2. Indicator is drawn using PE_IndicatorCheckBox not CE_CheckBox - it
   allows to use ::indicator in qss to style it properly. This works the
   same as TreeView.
3. Fix for minor issues with text alignement and extension of selected items
   background to cover checkbox. This is how other controls of this kind
   work.
2024-01-20 21:59:01 +01:00
Paddle
17893d39ca Sketcher: PythonConverter: Replace useLastGeoIdVar bool by enum class 2024-01-20 06:49:32 +01:00
Paddle
eb91978459 Sketcher : Distance constraint : introduce arc helpers for conic distances. 2024-01-19 11:50:38 +01:00
Paddle
8ed22b0fd8 Sketcher: copy paste : move from XML to python. 2024-01-19 11:13:53 +01:00
Paddle
a8b6e1e9c3 Sketcher: python converter : add possibility to add lastGeoId to the constraint process. 2024-01-19 11:13:53 +01:00
Paddle
fd2e35b7eb Sketcher: Add copy/cut/paste sketcher commands 2024-01-19 11:13:53 +01:00
Paddle
df867a25b2 Sketcher : arc angle render improvement. 2024-01-19 11:13:09 +01:00
Paddle
dca00ec80e Sketcher : improve single line angle rendering. 2024-01-19 11:13:09 +01:00
Paddle
64c867eb0e Sketcher Fix radius arc helpers. 2024-01-19 11:13:09 +01:00
Paddle
4acff3f66f Sketcher: polyline: fix ESC exit tool 2024-01-17 13:53:04 -03:00
Paddle
919d8c9392 Sketcher: bspline: fix ESC exit tool 2024-01-17 13:53:04 -03:00
Paddle
6db820a580 Sketcher: Define double click on edges : Select the whole wire. 2024-01-17 11:05:28 -03:00
Paddle
b0176c2d92 Sketcher: add isPeriodicBsplineCurve helper function 2024-01-17 11:05:28 -03:00
Paddle
5ee16df6b7 Draw arc helpers for radius constraints. 2024-01-12 19:03:38 -06:00
Paddle
827781ab3f Improve angle constraint rendering. 2024-01-12 19:03:38 -06:00
bgbsww
8abd09398a Add support for OCCT 7.8.0 (#11909) 2024-01-09 19:47:25 -06:00
Max Wilfinger
476089a2ad sketcher: create contextual right click menu 2024-01-08 12:39:17 -05:00
Paddle
9bb9eb8b21 Sketcher_dimension : Fixes https://github.com/FreeCAD/FreeCAD/issues/11904 2024-01-07 20:53:22 -06:00
bgbsww
365c5f4777 Detect circular references in sketches, and add corresponding tests (#11716)
* Possible fix for 10482 circular reference regression with tests

* Remove redundant test

* Cleanup pre PR

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-06 18:13:44 -06:00
Max Wilfinger
e43a3b17c8 Change tool description of rotate and polygon tool to hint users to modify with U and J keys. 2024-01-05 11:07:09 -06:00
Florian Foinant-Willig
5a75578308 Sketcher: fix one point distance (#11854) 2024-01-05 09:29:28 -06:00
Max Wilfinger
ee6dacdca7 add capabilities to auto-dimension tool to dimension distances between arc-point, arc-circle, arc-arc 2024-01-05 09:25:53 -06:00
Chris Hennes
1d2186b7d6 Update translations (#11886)
* Update translations

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-03 09:27:18 -06:00
Max Wilfinger
a662fbb2ff always show auto HorVer tool command in the toolbar when the tool is present (concise toolbar oprion) 2023-12-31 10:44:08 -06:00
Max Wilfinger
23ec682cbe Sketcher: adjust cursor icons to match toolbar icons (#11749)
* adjust cursor icons to match toolbar icons

* adjusting fillet cursor icon

* correct fillet icon

* updated other icons to be in line with toolbar icon

* oblong fixes

* Discord feedback adjusted

* added arc slot cursor icon

* Update of arc cursor icons. Added ellipse variants

* update line. added polygon variations. added bspline options.

* updated other icons to be in line

* changed line icons

* discord feedback implemented

* Updated to implement new icons

* sketcher: change carbon copy and external cursor icons to match toolbar icons

* added copy icon for XPM hardcoded

* added new copy pointer icon to resources

* Update to support multiple cursor icons per tool mode for spline, ellipse, fillet, rectangle.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* adjusted icon and if statements

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* delete unnecessary icons

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-12-22 06:06:09 +01:00
Abdullah Tahiri
01207a499f Sketcher: Activate new icon for optional unified coincident constraint 2023-12-21 15:36:56 +01:00