Commit Graph

3668 Commits

Author SHA1 Message Date
Roy-043
cff2d4f8fb Draft: fix Draft_Edit isAttachedToDocument issue
Fixes #19939

The `isAttachedToDocument` method only works in certain circumstances.
https://forum.freecad.org/viewtopic.php?t=94709
2025-03-03 17:17:55 +01:00
Roy-043
14c88e288e Draft: fix NaN issue with Draft_Rotate
Fixes #19690

The issue was caused by a zero distance between the center and the point picked for the rotation angle.
2025-03-03 17:09:11 +01:00
Roy-043
0b81e6e318 Draft: fix polar coords regression
Fixes #19961

Regression caused by #19179.
2025-03-03 17:07:20 +01:00
Chris Hennes
1a2070c36f Merge pull request #19636 from kadet1090/color-in-base
Base: Move App::Color to Base
2025-03-02 16:36:40 -06:00
Roy-043
cdfa386f87 Draft: fix Draft_Edit issue with Gesture navigation
Fixes #19519
2025-03-02 16:13:13 -06:00
Mino-Tsuzuku
a29895dd3c fix #19723 SVG: transform attribute is not handled collectly (#19845)
* * Move pyopen with encoding to utils.
 and modify all importing library to use pyopen with encoding.
with this change, DXF OCA AirfoilDAT with multibyte sequence always read as utf-8.

* Fix SVG transform attribute is not handler collectly.
2025-03-01 19:06:46 -06:00
Roy-043
202f4cf3af Draft: Fix error in #19738
My bad. Goes to show that even 'simple' PRs must be tested.
2025-02-27 10:41:54 +01:00
Benjamin Bræstrup Sayoc
ee1c73cd04 Build: suppress warnings from 3rd party libraries
Warnings from 3rd parties are not relevant and are only polluting the warning output. Marking these libraries as SYSTEM suppresses warning.

https://gcc.gnu.org/onlinedocs/cpp/Invocation.html#index-I
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
2025-02-25 14:39:05 +00:00
Roy-043
c0f0fa1d94 Draft: fix alignment of sketches in SVG and legacy DXF export
Fixes #5990
Supersedes #13652

This solution only works for sketches. The export of other planar objects remains the same.

This is similar to the way the C++ DXF exporter handles things. What is different here is that if multiple sketches are exported they are assumed to have the same normal, and their position relative to each other is preserved.
2025-02-24 17:13:51 +00:00
Roy-043
af20bf003f 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
Joao Matos
15076cb504 Core: Move PyCXX library to src/3rdParty. 2025-02-24 16:36:06 +00:00
Roy-043
af96e50eea Draft: improve upgrade and downgrade
Fixes #16333.
Follow-up of #19487.

* The functions have been made nesting-aware. New objects are put in the same container (Group, Part) as the original objects. As a consequence for some operations the original objects must be in the same container as well.
* New objects receive the visual properties of the original objects. This is not always perfect. For example when upgrading to multiple wires there is currently no check to see which edge came from which orginal object. The fact that the `format_object` function is called from the Draft `make*` functions is problematic here. If construction mode is active `make_wire` puts new objects in the construction group and we don't always want that. This has been solved with a workaround (see 'cludge' in the code).
* The 'de-parametrize' downgrade option has also been enabled for features of PartDesign Bodies that have the `Profile` property.
* Before deleting objects there is a check to see if they are in use elsewhere (`InList` check). Base objects of arrays are not deleted if they are visible. If a PartDesign Body, or an object inside a Body is selected, the whole Body is deleted.
* The force options did not work for functions that take a single object.
* The `getShapeFromMesh` function in ArchCommands.py could return a solid that was not closed. A check for that has been added.
2025-02-19 18:06:12 +01:00
Kacper Donat
13fbab9e42 Base: Move App::Color to Base
Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
2025-02-17 21:10:26 +01:00
Joao Matos
aace8f7bee CMake: Modernize build files using outdated Python variables. 2025-02-16 10:21:26 -06:00
Roy-043
245a2fada7 Draft: task_scale.py fix circular imports (#19574)
See:
https://forum.freecad.org/viewtopic.php?t=94748
2025-02-13 16:02:24 +01:00
Roy-043
01409c1407 Draft: gui_utils.py fix error in select function (#19539)
* Draft: gui_utils.py fix error in select function

PR #18795 changed the select function to also handle tuples. This PR adds a check to ensure the referenced objects in the tuple still exist before calling `Gui.Selection.addSelection()`.
2025-02-13 16:00:30 +01:00
Roy-043
ecfde4eed9 Merge pull request #19477 from Roy-043/Draft-Introduce-Edit-option-for-Draft-Clone-scaling
Draft: Introduce Edit option for Draft Clone scaling
2025-02-10 16:16:59 +01:00
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
f3854d155a Draft: Introduce Edit option for Draft Clone scaling
Fixes #13324.

The Edit option is available from the Tree view context menu, but you can also double-click the clone in the Tree view.

The task panel is based on that of the Draft Scale command. The "Uniform scaling" checkbox is (un)checked depending on the current scaling of the clone.
2025-02-08 11:22:20 +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