Commit Graph

3650 Commits

Author SHA1 Message Date
Roy-043
1de045ae66 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
a70cd6e6e3 Merge pull request #19470 from Roy-043/Draft-add-some-checks-for-font-file-of-shapestring
Draft: add some checks for font file of shapestring
2025-02-07 20:38:06 +01:00
Roy-043
d93cec7063 Draft: add some checks for font file of shapestring
Fixes #19447.
2025-02-07 20:03:49 +01:00
Roy-043
5948edda64 Merge pull request #19427 from Roy-043/Draft-implement-Draft_AddToLayer-command
Draft: implement Draft_AddToLayer command
2025-02-07 18:40:34 +01:00
Roy-043
20c920375c Draft: Fix line length input issue
Fixes #19451.
2025-02-07 13:38:56 +01:00
Chris Hennes
d4d74a4464 Merge pull request #19433 from tritao/gui-general-code-cleanups
Gui: General code cleanups
2025-02-06 11:33:44 -06:00
Yorik van Havre
4a0fbe8768 Draft: Fixed small bug in draftgeoutils.edges 2025-02-06 13:56:08 +01:00
Roy-043
e47af7645c Draft: improved handling of 'crazy' edges in hatch
See #14114.
2025-02-06 13:43:52 +01:00
tritao
4260bd6fa4 Gui: Minor cleanups. 2025-02-05 22:13:07 +00:00
Roy-043
375750d89d Draft: implement Draft_AddToLayer command
Fixes #17323.

* Instead of extending Draft_AddToGroup a separate, but similar, command has been created.
* The three "Add to" tools have been grouped in the menu and the toolbar.
* The Draft_AddToGroup icon is provisional. Ideally the "Add to" tools should have related icons (it would then be nice to keep the trowel image in some way for the construction group). Draft_AddNamedGroup.svg and Draft_SelectGroup.svg probably also need to be updated in that context.
2025-02-05 16:21:58 +01:00
Paweł Pohl
2087ce149f 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
7e06bb1ec2 [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
f98d4f8646 Draft: Avoid setRadiusValue error message
Fixes #19386.
2025-02-04 16:25:53 +01:00
Roy-043
a2ab84c6b1 Draft: improvements for gui_groups.py (#19312)
* Draft: improvements for gui_groups.py

* All actions are handled as transactions to make them undoable.
* In the Draft_AutoGroup menu groups are separated from layers.
* The Draft_NewLayer.svg icon is used for the New layer option.
* Selecting that option prompts for a layer name and also activates that layer.
* Icons and separators have been added to the Draft_AddToGroup menu.
* The task panel of that command has been replaced with a QInputDialog.getText dialog for consistency.

* Forgot "..." somewhere

* Wrong year in the copyright notice.

* Minor tooltip tweaks
2025-02-04 11:54:33 +01:00
Roy-043
714a4e15e2 Draft: fix three issues with DraftGui.py (#19343)
Fixes #19305.
Fixes #19324.

Issues above caused by #19179.

Also removes automask code as it did not work properly in several cases. For example if the working plane was set to Front and the Global option was checked only the X coordinate could be entered.
2025-02-04 11:53:05 +01:00
Mino-Tsuzuku
0ce232b38a * Move pyopen with encoding to utils. (#19377)
and modify all importing library to use pyopen with encoding.
with this change, DXF OCA AirfoilDAT with multibyte sequence always read as utf-8.
2025-02-04 11:33:43 +01:00
Mino-Tsuzuku
9e5508513c #18458 fix SVG import error at non-utf8 native environment. (#19280) 2025-01-30 13:13:56 +01:00
Roy-043
41d55abcd2 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
09d1dfba79 Merge pull request #19296 from Roy-043/Draft-fix-handling-of-annotation-Links-in-TD-DraftViews
Draft: fix handling of annotation Links in TD DraftViews
2025-01-28 20:35:59 +01:00
Roy-043
dccc8788d1 Draft: Increase max value for gridEvery in ui.
Fixes #19267.
2025-01-28 18:12:00 +01:00
Roy-043
da3b9b5960 Draft: fix handling of annotation Links in TD DraftViews
Fixes #19199.
2025-01-28 17:37:29 +01:00
Roy-043
7e8ba07551 Merge pull request #19287 from Roy-043/Draft-remove-faulty-code-from-importDXF.py
Draft: remove faulty code from importDXF.py
2025-01-28 16:53:39 +01:00
Roy-043
3a4d7bd452 Draft: introduce new Draft_Layers icon
The current Draft_Layer.svg icon shows multiple layers. It is used for the Draft_Layer command but also for the LayerContainer. This is confusing. There should be separate icons, one with a single layer and one with multiple layers.
2025-01-28 08:49:39 +01:00
Roy-043
1422981b93 Draft: remove faulty code from importDXF.py
The Group property of the 'new' layer object is not an attribute of its Proxy.
2025-01-27 21:01:50 +01:00
Roy-043
9bbdbd198b Draft: DraftGui.py fix displayPoint
Fixes #18744.
2025-01-23 11:44:26 +01:00
Ulices
99df928459 Add units to some spinboxes on preferences pages (#19143)
* Add units to some spinboxes on preferences pages
* Ensure units have a space, ex: " px"
* FEM: Don't mark units for translation
2025-01-22 09:05:49 -06:00
Roy-043
322b354fe8 Added is not None checks
Also added two local variables in BimLayers.py.
2025-01-22 10:41:11 +01:00
Roy-043
713db4bc5e Draft and BIM: Layer manager minor code improvements
The code should not add the LinePrintColor property. That should be done elsewhere.
2025-01-22 10:41:11 +01:00
Roy-043
58a7b2ff28 Draft: updates related to transparency to alpha change 2025-01-22 10:04:47 +01:00
Roy-043
3c3cf74cb0 Draft: DraftGui.py fix updateSnapper and implement display_point_active
* The updateSnapper function did not work properly.
* Added display_point_active attribute to prevent the displayPoint function from triggering the changeXValue etc. functions. This would lead to a loss of accuracy as the rounded displayed values would be read from the inputboxes.
2025-01-22 10:03:36 +01:00
Roy-043
b055924bd7 Changed one tooltip as requested 2025-01-21 15:17:03 +01:00
Roy-043
e79beed491 Draft: DraftGui.py improve some tooltips
Avoid 'new point' and 'next point' in tooltips as this does not always apply.
2025-01-20 20:53:25 +01:00
Roy-043
48a15fa83a Draft: DXF export: add handling of text justification
Fixes #18964.
2025-01-20 18:24:30 +01:00
Roy-043
2ee620ab42 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
25570d60f3 Merge pull request #19089 from Roy-043/Draft-Clone-avoid-B-spline-faces-in-more-cases
Draft: Clone: avoid B-spline faces in more cases
2025-01-16 19:57:08 +01:00
Roy-043
31d8120d2e 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
499bd12d13 Draft: Save fillet settings
Fixes #16248.
2025-01-14 21:48:16 +01:00
Yorik van Havre
0213b4fc6c Translations (#18923)
* 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>
2025-01-13 21:30:30 -06:00
Tobias Frost
460da406f8 spelling fixes (#18688)
* Fixes spelling of "Allow to" to "Allow one to"

and those variants:
Allows to -> Allows one to
allow to -> allow one to
allows to -> allows one to

* Fix "Let's -> Lets"

(and lower case variant.)

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

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

* Update src/3rdParty/salomesmesh/inc/MED_Wrapper.hxx

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Base/PyObjectBase.cpp
Update src/App/ExtensionContainer.h
Update src/App/PropertyContainer.h

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Use gerund in user-facing texts.

* Use gerund for two more user-facing strings.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

* Update src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Tobias Frost <tobi@debian.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-13 11:22:20 -06:00
Roy-043
96326f9e60 Draft and BIM: Layer manager did not accept zero transparency 2025-01-10 22:29:03 +01:00
Roy-043
ec57ca2469 Merge pull request #18949 from Roy-043/Draft-and-Pref-Packs-fix-snapcolor
Draft (and Pref Packs): fix snapcolor
2025-01-09 11:31:22 +01:00
Roy-043
88dd81a03d Merge pull request #18942 from Roy-043/Draft-fix-selection-for-FacebinderTaskPanel
Draft: fix selection for FacebinderTaskPanel
2025-01-09 11:25:46 +01:00
Roy-043
41b001e046 Draft: fix axis calculation in make_sketch
Fixes #18713.

The code follows the suggestion by imm/webmite:
https://forum.freecad.org/viewtopic.php?p=799014#p799014

@webmite Thank you.
2025-01-09 09:40:33 +01:00
Roy-043
161e8ed6ba Draft (and Pref Packs): fix snapcolor
Fixes #17978.
2025-01-08 18:11:42 +01:00
Roy-043
86a7cdd94c Draft: fix selection for FacebinderTaskPanel
See:
https://forum.freecad.org/viewtopic.php?t=93682
2025-01-08 14:36:07 +01:00
Roy-043
9a7786edd8 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
55f923b863 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
Roy-043
75700b2229 Draft: make_sketch.py: Use sketcher methods to add constraints (#18805)
* Draft: make_sketch.py: Use sketcher methods to add constraints

A sketch object has its own methods to add coincident, horizontal and vertical constraints. Using those methods allows to simplify the make_sketch.py code. The new code applies the mentioned constraints to the whole sketch,  instead of per object. The old code would not add coincident constraints between seperate, but connected, objects. the new code does.

Note that the code for point objects (not changed in this PR) does not work properly.

* Fix 2 issues

* The Sketcher detect functions need a tolerance argument.
* obj.Shape.copy() does not work properly for a Draft_Point. As a workaround a Part Vertex is created instead.
2025-01-06 14:56:53 +01:00
Roy-043
88804819c0 Draft: comment out 3 test files with only dummy tests
Some Draft test files contain only dummy tests (`aux.fake_function`). Running them will just open a new file and then immediately close it. This can result in issues with code that is called with a delay. See #18679. Disabling these tests by commenting them out avoids this.
2025-01-04 12:20:33 +01:00
Roy-043
14d5f6bb3c Draft: Minor cosmetic changes to test files 2025-01-03 22:11:05 +01:00