Commit Graph

3531 Commits

Author SHA1 Message Date
Roy-043
3bae98c2e5 Updated 2 file paths to make the code work with AppImage
As advised in this forum post:
https://forum.freecad.org/viewtopic.php?p=788556#p788556
2024-10-24 14:08:17 +02:00
Roy-043
d26ed298c4 Draft: fix errors in draft_test_objects.py
* Label property TextSize should be FontSize.
* Added missing recomputes.
2024-10-24 14:08:17 +02:00
Roy-043
1fcd316a8b Draft: suppress patharray offset warnings if values are already zero
See forum topic:
https://forum.freecad.org/viewtopic.php?t=91517
2024-10-22 10:52:04 +02:00
Roy-043
6c8c263297 Draft: Improve layer drag-drop fix.
The fix in #16212 only checks the LayerContainer for layers. Since we do not stop users from moving layers out of that container, we should search the whole document instead.

Fixes: #16201.
2024-10-17 12:29:42 +02:00
Yorik van Havre
e8fc9cf45f crowdin translations 2024-10-14 17:56:08 +02:00
Yorik van Havre
6c08b5a63c updated ts files 2024-10-14 17:56:08 +02:00
Roy-043
d71fcf7593 Draft: Fix upgrade function: delete argument was ignored in case of draftify
Forum topic:
https://forum.freecad.org/viewtopic.php?t=91357
2024-10-14 08:19:03 -05:00
Roy-043
8875672e78 Draft: avoid confusing SVG warning for nested circles and ellipses
Forum topic:
https://forum.freecad.org/viewtopic.php?t=90942
2024-10-07 15:07:51 +02:00
bgbsww
33bea16a38 Disallow end_all_events in Gesture Nav Style 2024-10-07 15:03:17 +02:00
Roy-043
6a32980b5d More logical implementation of the fix. 2024-10-07 14:58:36 +02:00
Roy-043
f92ecfeff7 Draft: Stop draftToolBar.escape() executing multiple times
Fixes #17027.

The `DraftTaskPanel.reject()` function can be called multiple times if Esc is pressed during a fast mouse move. We need to prevent multiple calls to `draftToolBar.escape()` as this will lead to multiple calls to `gui_utils.end_all_events()` which results in a crash.
2024-10-07 14:58:36 +02:00
bgbsww
64ecfe7a0e Make python Regex Strings raw to avoid py3.12 SyntaxError 2024-09-30 17:42:49 +02:00
Roy-043
abc95b42ca Fix linter warning 2024-09-25 15:59:49 +02:00
Roy-043
4313024162 Draft: ShapeString Fuse caused single face string to lose fill
The `faces.concatenate` function can return a Face or a Compound. The code did not take that into account.
2024-09-25 15:59:49 +02:00
Yorik van Havre
abd5c3ca31 Translations (#16754)
* Updated ts files

* merged crowdin 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-09-23 14:09:56 -04:00
Kevin Martin
5bed9bf53f DXF: Fix Import related behavior reported in issues #13597 and #16068 (#16511)
* Fix double-import on exception in ImportGUI.readDXF
The python code has a try/catch block intended to detect if the ImportGUI module is present and if so use its readDXF method, otherwise use Import.readDXF.
The block was incorrectly structured so that Import.readDXF would also be called if ImportGUI.readDXF raised an exception, causing the DXF file contents to be loaded twice into the drawing (at least, up to the point where the exception occurred)

* Make ImpExpDxfRead::MakeLayer use centralized accessor for Draft module
The importer class already had a method to find the python Draft module, but MakeLayer was doing the work itself. Now it uses the centralized accessor, which has also been improved to generate a message if the module can't be loaded.

* Give compounded objects names related to the containing layer name
If "Use Layers" is set and also "Group layers into blocks" the names of the generated compound objects will be based on the name of the containing layer.
If "Use Layers" is not set this will not occur because in general objects from several layers would be compounded together.
Fixes (partially) #16068, the remaining fix is likely just an explanation of the interaction of the options.
closes #13597

* Use correct (new) property name OverrideShapeAppearanceChildren
This corrects a bug created by commit 495a96a which renamed the layer property "OverrideShapeColorChildren" to "OverrideShapeAppearanceChildren" but missed this particular reference to the property by its old name.

The code here called PyObject_SetAttrString which, due to the wrong attribute name, set an expection state in the Python engine, ultimately causing the next attempt at importing a module to fail, with various consequences depending on why the module is being imported.

* Wrap PyObject_SetAttrString and PyObject_GetAttrString with error-checkers
In DEBUG compiles these methods are wrapped to report errors which can occur if the property cannot be referenced.

* Make some error-printers static instead of const
They don't need the CDxfRead object to work

* Display exceptions raised by ReadEntity
Although the DXF reader has an ignore-errors flag, it should still report any errors it encounters. The flag is deemed to mean that, after an error, the reader should continue to try to read the file rather than quitting on the first error.

* [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-09-23 17:28:00 +02:00
Kevin Martin
c9887d9400 DXF: Place objects in layer all at once rather than one at a time to improve DXF import speed dramatically. (#16596)
* Place objects in layer all at once rather than one at a time.
This reduces (by a factor of the number of objects in the layer) the number of times that the layer contents are traversed to set the properties of the contained objects.
This means the layer insertion of O(n) rather then O(n^2) on the number of objects.
Also remove a loop invariant in view_layer so the chidren are not traversed if colours or appearnces are not inherited from the layer.
Fixes #15732

* [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-09-23 11:39:02 +02:00
Kevin Martin
980303b618 DXF: Remove O(n^2) time on DXF import with the legacy importer (#16611)
* Remove O(n^2) time on DXF import
Accumulates the contents of each layer in a local Python list, then at the end assignes all the objects at once into the layer. This avoids a very slow process of traversing the objects so far and (re-)updating their properties each time a new object is added.
Fixes #16604

* Correct last change to not damage existing layer contents.
The layer could already have contents if the DXF file is being Imported rather than Opened.
The original change would lose the previous layer contents.
2024-09-23 11:37:34 +02:00
Yorik van Havre
56dbb6532a Translations (#16582)
* updated ts files

* merged crowdin 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-09-19 09:36:54 +02:00
Syres916
f00b236dfb [Draft] Improve the color activation and ability to change… (#16603)
* [Draft] Improve the color activation and ability to change size of the snap text

* [Draft] Correct dimension text size calculation
2024-09-19 09:03:33 +02:00
Roy-043
b6599c5315 Draft: Fix regression with layer print color
Problem with the same cause as #16212.
2024-09-16 10:07:40 +02:00
Yorik van Havre
f09dfa72d0 Draft: Fixed restrained movement - Fixes #16386 2024-09-13 13:20:45 -06:00
Yorik van Havre
6c5e90a6d2 Draft: Fixed function case 2024-09-13 15:00:47 +02:00
Yorik van Havre
8ef66ad73d Draft: Fixes error in Draft trackers when not on a 3D view 2024-09-13 15:00:47 +02:00
Roy-043
3fd57efbb0 Use max instead of if-else for numerical checks (as per linter warning) 2024-09-13 12:07:52 +02:00
Roy-043
ba6dd5858e Draft: fix division by zero and count is zero for path arrays
Fixes #16468.
2024-09-13 12:07:52 +02:00
Furgo
5fa7fb757a Check location and call corresponding addObject, add missing import. Fixes #16435 2024-09-12 14:29:10 +02:00
Yorik van Havre
7b3eca8396 Translations (#16389)
* Translations: Updated ts files

* Translations: Merged crowdin 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-09-09 18:25:52 +02:00
Roy-043
fe40748c10 Draft: fix snapping to endpoints of dimension lines (V0.19 regression)
This fixes a regression introduced in V0.19 (!) when the type of linear dimensions was changed from "Dimension" to "LinearDimension".

Forum topic:
https://forum.freecad.org/viewtopic.php?t=90292
2024-09-05 13:18:32 +02:00
Roy-043
77539c1091 Draft: Fix regression with layer drag-and-drop behavior
Fixes: #16201

Changing the Group property type of layers to `App::PropertyLinkListHidden` also means that they longer occur in the InList of nested objects. This side-effect was missed in #14506.
2024-09-02 18:40:23 +02:00
Roy-043
1be41b68a2 Draft: Fix regression with display of SVG patterns
In V0.22 SVG patterns are not displayed when a file is reopend.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=90128
2024-09-02 10:51:55 +02:00
Roy-043
44c796c8d3 Draft: Fix error handling of Draft_Trimex
Selecting an edge or vertex of a solid was not handled properly. The tool does not support these subelements, but the code did not call self.finish() is such cases.
2024-09-02 10:46:08 +02:00
Roy-043
ab741cd2ac Draft: Fix max value of Scale multiplier in ui files
Without this max value the spinbox stops at 99.99. The max value is the same as in preferences-drafttexts.ui.
2024-08-31 13:18:37 -05:00
Yorik van Havre
b065691032 Merged crowdin translations 2024-08-28 17:51:34 +02:00
wmayer
3e33f184b4 Core: Rename ViewProviderPythonFeature to ViewProviderFeaturePython
Fixes #15888
2024-08-26 18:14:22 +02:00
paul
4981dbbe2c [ArchWall_Draft-OffsetWires] Bug-fix Ellipse Support (#16038)
* [ArchWall_Draft-OffsetWires] Bug-fix Ellipse Support

Fixed bug/regression in ArchWall/Draft-OffsetWires ellipse support.

FC Forum Discussion
- https://forum.freecad.org/viewtopic.php?p=777965#p777897

* Update offsets.py

Typo

* L347 - trailing whitespace after comma
2024-08-26 18:03:21 +02:00
luzpaz
b5281158f3 Fix various typos 2024-08-11 12:09:27 -04:00
Roy-043
f6c8850e80 Draft: Fix cursor scaling (#15745)
* Draft: Fix cursor scaling

The get_cursor_with_tail function was rewritten to match the Sketcher cursor code. Hopefully this fixes the scaling issue.

Related issue:
#13696

Related forum topic:
https://forum.freecad.org/viewtopic.php?t=89494

@maxwxyz
Can you check if this code fixes the issue? Apart from the size the 'hot' pixel should be checked. If you approach a vertical line from the left or right it should get highlighted at the same distance.
2024-08-08 12:07:34 +02:00
paul
f3910b386a [DraftBind] Bug-fix Consecutive Face Touch at Corner (#15350)
* [DraftBind] Bug-fix Consecutive Face Touch at Corner

Bug-fix Consecutive face (Wall segment) touch at corner.

Forum Discussion :  https://forum.freecad.org/viewtopic.php?p=769213#p769213

* [DraftBind] Bug-fix Consecutive Face Touch at Corner


Update following commit at https://github.com/FreeCAD/FreeCAD/pull/15350

* Minor formatting changes

coding_conventions.md says variable_names_without_capitals

* Use areColinear to find problematic edge pairs

It is clearer to use `areColinear` instead of `findIntersection` to detect problematic edge pairs.

@paullee0 Please check. Thanks.

* Use Shape.section() to find touching edges

Using `areColinear` indeed does not work here.

But the `findIntersection` function is very confusing IMO. It finds intersections for collinear edges which does not make sense.

Let's use `Shape.section()` instead.

Also improved the 'ascii art' a little.

* typo

* Some minor improvements.

* [DraftBind] Bug-fix Consecutive Face Touch at Corner

Update handling closed wire(s) case

* Typo

* [DraftBind] Bug-fix Consecutive Face Touch at Corner

Further update handling closed wire(s) case :

# if wires are closed, 1st & last series of faces might be connected
# except when
# 1) there are only 2 series, connecting would return invalid shape
# 2) 1st series of faces happens to be [], i.e. 1st edge pairs touch

---------

Co-authored-by: Roy-043 <info@b-k-g.nl>
2024-08-08 11:08:59 +02:00
Yorik van Havre
aad060c0f0 Translations (#15689)
* Updated ts files

* Merged crowdin 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-08-05 10:42:18 -05:00
Chris Hennes
fe702349e8 Merge pull request #15652 from kadet1090/ui-fixes
Gui: Cosmetic Fixes
2024-07-29 11:26:58 -05:00
Roy-043
a1a6f18008 Draft: Fix snap intersection hang (#15612)
Fixes #13797.

The code as suggested by @alafr works fine and has basically been implemented.
2024-07-29 18:05:01 +02:00
Roy-043
0338ae3fad BIM: Fix index out of range error for circular wall (#15526)
* BIM: Fix index out of range error for circular wall

Fixes #15523.

* Reduce comments
2024-07-29 17:49:16 +02:00
Kacper Donat
d927cfc438 Gui: Remove unnecessary minimumSizes from Preferences
QT treats setting minimum size very seriously - it applies even if
the size required by the control is smaller than specified resulting in
rendering too small controls.
2024-07-28 00:00:09 +02:00
luzpaz
a71f49f4f6 Fix trailing newlines and minor typo fixes 2024-07-23 16:16:30 +02:00
Yorik van Havre
2c66c8a788 Merged crowdin translations 2024-07-11 15:07:17 +02:00
Yorik van Havre
0a69f0d7c2 Updated ts files 2024-07-11 14:56:33 +02:00
Yorik van Havre
32c9ed5493 Merged crowdin translations 2024-07-09 08:52:17 -05:00
luzpaz
9a1f487cdb Fix various typos throughout the codebase 2024-07-08 17:19:20 -05:00
Max Wilfinger
7d21d9edb8 Fix source string typos mentioned on Crowdin (#15261) 2024-07-08 17:18:31 -05:00