Commit Graph

245 Commits

Author SHA1 Message Date
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
f0e70e68e0 [ Draft ]: Update SPDX License Identifiers (#24965) 2025-11-03 11:58:14 -06:00
marcuspollio
50e4864efb Add Draft workbench to .pre-commit-config (#24664)
* Add Draft workbench to .pre-commit-config

* [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>
2025-10-15 11:21:09 +02:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
546a43b8b8 Removed outdated UTF8 declaration [ Other ] (#24528)
* Removed outdated UTF8 declaration

* [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>
2025-10-13 18:34:43 +02:00
marcuspollio
4323840e8e Draft: add formatting off comments (#24503) 2025-10-08 21:43:38 +02:00
Roy-043
4677bfef79 BIM+Draft: change object related version info to log messages
To inform the user warnings are shown if an object has new or modified properties in the current version. These warnings can however be confusing, especially if there are many. With this PR they are turned into log messages. They are also moved out of translation, and instead of the object Label the object Name is displayed.

Additionally:
Zero path length warnings for path arrays are now only displayed if the Align property is True.

See: #21180.
2025-09-08 10:58:28 +02:00
Roy-043
999a6d2631 Draft: Improve ShapeString execute function 2025-09-08 10:58:06 +02:00
Max Wilfinger
9cae60a70f Update UI strings from Crowdin reports for consistency 2025-08-28 11:45:38 -05:00
Roy-043
f62e18b59c Draft: Support relative paths for hatch patterns 2025-08-25 18:12:20 +02:00
Max Wilfinger
9fc40b33de Fix source string mistakes reported on Crowdin (#23157)
* Fix source string mistakes reported on Crowdin

* Update src/Mod/Draft/Resources/ui/TaskPanel_CircularArray.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/Resources/ui/TaskPanel_CircularArray.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftfunctions/upgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftfunctions/upgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/draftguitools/gui_downgrade.py

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Update src/Mod/Draft/Resources/ui/TaskPanel_SetStyle.ui

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

---------

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-24 20:51:32 -05:00
Vincenzo Calligaro
b3e11ecd11 [Feature Request] [Draft] [UI/UX] Allow to turn dimension arrows on/off individually (#11941)
* Update additional files

* The LineColor and LineWidth properties are removed from Text objects.
* Arrow properties are added by the ViewProviderDraftAnnotation class only. This avoids code duplication.

* gui_annotationstyleeditor.py fix except

* view_draft_annotation.py fix except

---------

Co-authored-by: Roy-043 <info@b-k-g.nl>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-14 10:44:49 +02:00
Max Wilfinger
a9cd5a4982 Draft: Update UI strings for consistency (#22331)
* Draft: Update UI strings for consistency

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>

* Apply suggestions from code review

---------

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
2025-08-06 23:02:16 +02:00
Roy-043
425ea761ff Draft: fix setting of self.Type
Fixes #17750.

`self.Type` should be set in `__init__` and `loads`, and not in `onDocumentRestored`.
2025-06-30 11:05:25 -05:00
Roy-043
e4adfc63d7 Draft/BIM: change BezCurve, BSpline and Wire to Part::FeaturePython
Fixes: #7387.

See comment: https://github.com/FreeCAD/FreeCAD/issues/7387#issuecomment-2915599566

PR to change the base object of BezCurve, BSpline and Wire to `Part::FeaturePython`. This will only affect new objects. So code will have to also keep handling the old object type (`Part::Part2DObjectPython`).

The modification of BimPreflight.py needs to be verified. The steps in the old code lacked logic IMO. But I may have misunderstood.
2025-06-02 17:27:20 +02:00
Roy-043
e5f81e4791 Draft: ShapeString fix stick font check for small character (#21522)
Fixes #21501.

For some fonts `Part.makeWireString()` returns characters that are much smaller than the given height. This would lead to a false positive for the 'sticky font' check (which checks the area of the "L" character).
2025-05-22 17:26:00 +02:00
Roy-043
2e02c6a944 Draft: ShapeString: use an actual font file as default, allow TTC files
* To help novice users supply an actual font file from the OS as the default for ShapeStringFontFile.
* The Draft code blocked the use of TTC font files. `Part.makeWireString()` can however handle them (although only the first font in the file can be used).

Additonally:
In a previous PR the bottom spacer was removed from the task panel. This PR brings it back as it is required in some cases. Without it  the "..." button of the file selector can become huge.
2025-05-05 18:15:47 +02:00
Florian Foinant-Willig
19c125e898 Draft: Prevent user to remove core properties 2025-04-22 23:52:17 +02:00
Florian Foinant-Willig
065a8a2226 Core: Part::PartFeature should be Part::Feature 2025-04-21 10:51:15 -05:00
Luz Paz
b9d03abc7b Draft: fix source typo in draftobjects/patharray.py 2025-04-01 10:05:08 -04:00
Luz Paz
17102251e5 Fix various typos 2025-03-14 12:37:12 -04:00
Roy-043
074807c378 Draft: change 'Filled' to 'Make face' in UI
Fixes #19715.

The related parameter has been renamed as well and other references to 'fill mode' have been updated.
2025-02-24 17:10:13 +00:00
Roy-043
c26264ec98 Draft: make arrays explodable
Fixes #13085.

This PR adds the `PlacementList` property to non-link arrays.
2025-02-08 19:20:33 +01:00
Roy-043
c6ce42a383 Draft: add some checks for font file of shapestring
Fixes #19447.
2025-02-07 20:03:49 +01:00
Roy-043
8b124b659c Draft: Fix line length input issue
Fixes #19451.
2025-02-07 13:38:56 +01:00
Roy-043
0dc0372570 Draft: improved handling of 'crazy' edges in hatch
See #14114.
2025-02-06 13:43:52 +01:00
Paweł Pohl
aef46ad56d Draft: New path array features - reverse path, etc (#19017)
Some missing quality-of-life features in Path Array:
1. A setting to reverse path
2. A "Fixed spacing" mode
3. Ability to use spacing patterns
2025-02-05 15:16:25 +01:00
Paul Lee
de0ec8d6ce [Draft_shape2dview] Fix Bug : Closed Wall Wrong Fill
Git-hub issues : https://github.com/FreeCAD/FreeCAD/issues/16363#issuecomment-2619643946

"Problem description

In a group of closed walls, the entire interior is completely filled, which should not be the case."
2025-02-05 10:09:09 +01:00
Roy-043
dfe670e1ae Draft: allow objects in layers to have overrides (#19207)
* Draft: allow objects in layers to have overrides

Fixes #17844.

1. When an object is put in a layer it always adopts the properties of that layer.
2. Properties of the object that are subsequently changed are considered overrides.
3. When the properties of the layer, or the object in the layer, are then changed so that they match again, there is no longer an override, and properties are synced again.
4. The layer and the layer container object get an extra Tree view context menu option "Reassign properties of layer"/"Reassign properties of all layers".
2025-01-28 20:42:45 +01:00
Roy-043
d587e6a91a Draft: make move, rotate and scale commands link-aware (#18795)
* Draft: make move, rotate and scale commands link-aware

Fixes #12836.
Fixes #15681.

These changes are presented as a single ('big') PR because the mentioned commands have several similarities. Working on them seperately would have made less sense.

The commands have been made 'link-aware' meaning they can now handle Links and objects in linked containers.

This required several changes in the following main files. For each command all options are handled by a single function now (the `move`, `rotate` and `scale` functions). This was the only reasonable solution to correctly handle nested placements. As a result there is no longer a need to build very complex 'cmd' strings in the gui_*.py files (which is a good thing IMO).

Main files:

* move.py
* rotate.py
* scale.py
* gui_move.py
* gui_rotate.py
* gui_scale.py
* gui_trackers.py

The following files have also been updated:

* Draft.py: Imports updated.
* DraftGui.py: If `CopyMode` is changed the ghosts have to be updated. The move and rotate commands now also show previews of movable children. But since those are not copied they should be removed from the ghosts if `CopyMode` is changed to `True`.
* utils.py: Some helper functions have been added. An existing helper function (only used internally) has been renamed.
* gui_utils.py: The `select` function has been updated to accept a list of tuples to allow the reselection of nested objects.
* clone.py: A new property `ForceCompound`, necessary for non-uniform scaling, has been added.
* join.py: The `join_wires` function now returns the resultant wire objects.
* task_scale.py: Updated to allow negative scale factors. Support for `SubelementMode` preference added.
* dimension.py: `transform` methods added.
* layer.py: `get_layer` function added.
* svg.py: Updated to use `get_layer`.
* view_text.py: Instead of two added `coin.SoTransform()` nodes the main transform node is used instead. This was done so that ghosts of Draft Texts can be handled properly without requiring dedicated code in gui_trackers.py.

Notes:

* Support for "App::Annotation" is limited. Only their `Position` is handled (by the move and rotate commands).
* Support for "Image::ImagePlane" has been removed from the scale command. The object has its own calibrate feature (see https://wiki.freecad.org/Std_Import).
* Copies and clones are always created in the global space.

* Fix several unit test issues.

* Reset value that was changed while testing

* Rebase and update test_modification.py

* Reintroduce scaling of image planes
2025-01-20 18:23:36 +01:00
Roy-043
b31ada686f Draft: Clone: avoid B-spline faces in more cases
B-spline faces can be avoided if the absolute values of the scaling factors are the same. The `transformShape` method can handle this if two additional arguments are provided.
2025-01-16 13:39:11 +01:00
Roy-043
6deb424539 Draft: Closed corners for extruded Facebinders (#18901)
* Draft: props_changed_placement_only should ignore material props

The new material related properties (Density, Volume and Mass) must be ignored by the `props_changed_placement_only` function.

Without this moving a Draft_Point will fail for example.

* Draft: Closed corners for extruded Facebinders

Fixes #13816.

The `makeOffsetShape` method that creates the extruded shape is quite picky. For example, it will work for a pyramidal shell (4 triangles) with a square floorplan, but not if the floorplan is slightly rectangular. To get closed corners the `Sew` property of the Facebinder must be set to `True`. If extruding does not work properly, the code will retry with `Sew` disabled.

There is also some code that tries to convert flat B-spline faces created between the main offset faces into planar faces. In some cases that code will fail (the results of `makeOffsetShape` can already contain errors). If that is the case the original shape created by `makeOffsetShape` is used.

* Rebase to restore base.py
2025-01-07 10:23:33 +01:00
Roy-043
f773dfad91 Draft: props_changed_placement_only should ignore material props
The new material related properties (Density, Volume and Mass) must be ignored by the `props_changed_placement_only` function.

Without this moving a Draft_Point will fail for example.
2025-01-06 17:23:37 +01:00
Yorik van Havre
af84424a77 BIM: NativeIFC 2D support - section planes 2024-12-11 10:24:43 +01:00
Roy-043
28749e44dd Merge pull request #17379 from yorikvanhavre/draft-fix-annotation
Draft: better check for Gui object
2024-12-06 18:05:41 +01:00
Gauthier Brière
f08cf60155 [Draft] add font path relative (#17819)
* Permit a font file path relative to the FreeCAD file

* Use obj.Document instead of App.ActiveDocument

* use filename = instead of directory =
2024-11-16 18:02:02 +01:00
Yorik van Havre
8f9718ebc6 Draft: minor fixes (#17793)
- more tolerance on faultly solids in shape2Dview
- fixed display of dimensions in arch override unit
2024-11-16 17:52:55 +01:00
Roy-043
f723f36d2a Draft: Fix extra_scale error in hatch.py (#17715)
Fixes #17712.
2024-11-16 17:49:35 +01:00
Yorik van Havre
ee2f384b2f Draft: Independence from BIM (#17444)
* Draft: Independence from BIM - follow-up of #17390

* Draft: More info in DXF importer if BIM not present
2024-11-16 17:48:28 +01:00
Roy-043
8163f974a0 Catch potential index error 2024-10-25 10:15:53 +02:00
Roy-043
d218d35527 Restore ViewObject implementation for all Draft objects
In my tests the code works fine. Using @AIRCAP's instructions,  I have created a 'broken' file from draft_test_objects.FCStd.
2024-10-24 15:24:13 +02:00
Roy-043
6c9ea36225 Restore the ViewObject
I think we need to restore the ViewObject in such cases. I assume this problems exists for all Draft and BIM objects. So this commit is just an example implementation.
2024-10-24 15:11:22 +02:00
Yorik van Havre
68be845a68 Draft: better check for Gui object - fixes #17342 2024-10-24 15:11:22 +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
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
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
Roy-043
a3cc73ce15 Draft: fix Draft_Shape2DView warnings
Fixes #15144.
2024-07-04 09:11:10 +02:00
FEA-eng
4882a33d46 Update shape2dview.py 2024-06-17 11:22:18 -05:00
Roy-043
91c7d8bfc9 Draft: _get_shapes in shape2dview.py did not handle null shapes (#14646)
Null shapes do not have a ShapeType (strange IMO). The function did not take that into account.

Forum topic:
https://forum.freecad.org/viewtopic.php?t=88397
2024-06-13 15:27:47 +02:00
Roy-043
7496eb94f8 Draft: Fix two Layer warnings (#14506)
There are two unnecessary Layer warnings:
1. A 'might break' warning when deleting an object nested in a layer.
2. An 'out of scope' warning for objects also nested in f.e. a Std_Part.

To avoid them the Group property type was changed to `App::PropertyLinkListHidden`.
2024-06-06 15:53:49 +02:00