Commit Graph

3687 Commits

Author SHA1 Message Date
Paul Lee
b05c02b6f1 [Draft-Faces] Bind: Improve fuse and warning - Further Fix
Github Discussion:
- Fix problem Roy-043 pointed out https://github.com/FreeCAD/FreeCAD/pull/20395#pullrequestreview-2726624360

FC Forum:
- https://forum.freecad.org/viewtopic.php?p=819121#p819121
2025-03-30 10:29:36 +08:00
Paul Lee
07fcf551d0 [Draft-Faces] Bind: Improve fuse and warning
1. Face fuse per segment
   (original code has a whole face/segment disappear when a face is self-intersecting or reversed)
2. Return warning if face is self-intersecting Or reversed

Github Issue:
- https://github.com/FreeCAD/FreeCAD/issues/19721#issuecomment-2744738019
FreeCAD Forum:
- https://forum.freecad.org/viewtopic.php?p=816758#p816758
- https://forum.freecad.org/viewtopic.php?p=813062#p813062
2025-03-23 12:06:27 +08:00
Roy-043
ea82500560 Draft: make Near snap obey 'Always snap' setting
Fixes: #19553.

Additionally:
* Removed 2 unused attributes (`self.lastSnappedObject` and `self.active`).
* Improved the readability of `snapToObject` a little bit.
* Made the return value of that function consistent (vector or None).
2025-03-20 10:14:49 +01:00
Chris Hennes
e574fa1efc Merge pull request #19899 from tritao/cmake-cleanup-targets
CMake: Cleanup targets with transitive dependencies
2025-03-17 13:15:37 -05:00
Chris Hennes
3d03bb45f8 Merge pull request #20201 from Roy-043/Draft-make-Draft_Edit-also-detect-key-up-events
Draft: make Draft_Edit also detect key up events
2025-03-17 11:57:24 -05:00
tritao
6c2c6847eb CMake: Cleanup targets with transitive dependencies 2025-03-17 12:12:06 +00:00
Roy-043
8b070255d0 Draft: make Draft_Edit also detect key up events
The key down events can be claimed by shortcuts from other workbenches. Detecting both the down and up events does not seem to cause problems.
2025-03-14 21:09:20 +01:00
Luz Paz
17102251e5 Fix various typos 2025-03-14 12:37:12 -04:00
Roy-043
2ad23cec23 Merge pull request #20151 from Roy-043/Draft-fix-handling-of-fillet-radius-input
Draft: fix handling of fillet radius input
2025-03-12 16:27:41 +00:00
Roy-043
1b17da9bf4 Draft: fix handling of fillet radius input
Fixes #20145.
2025-03-12 17:00:52 +01:00
Roy-043
5688a41c4c Updated based on comment 2025-03-12 09:47:03 +01:00
Roy-043
fcc3061746 Draft: Fix error in #20118
The code in #20118 would fail if only Near snap was active.
2025-03-11 15:57:37 +01:00
Yorik van Havre
61eedbddc4 Merge pull request #20072 from Roy-043/Draft-Implement-Dim-Auto-Flip-Text
Draft: Implement Dim Auto Flip Text
2025-03-11 12:58:03 +00:00
Roy-043
849cf3fa75 Draft: Correct Near snap override behavior
Fixes #15017.

Currently Near snap overrides all other 'on-object' snaps such as Midpoint snap and Endpoint snap. With this PR Near snap no longer 'wins' if a different snap point is within snapRange of the cursor.
2025-03-11 10:48:12 +01:00
Roy-043
5f7f9cb7ba Draft: Implement Dim Auto Flip Text
Fixes #19993.

* To determine the `FlipText` value the normal (either the working plane Z axis or its reverse) and the working plane X axis are used.
* A new fine-tuning parameter `DimAutoFlipText` can be used to disable the functionality. Its default value is `True`.
* The `FlipText` property did not work for angular dimensions and the `TextSpacing` property of angular dimensions was not multiplied by `ScaleMultiplier`. This has been corrected.
2025-03-08 15:30:31 +01:00
Roy-043
c2cf154bd6 Merge pull request #19986 from Roy-043/Draft-fix-make_sketch-hang
Draft: fix make_sketch hang
2025-03-05 11:10:28 +00:00
Roy-043
9eca869c95 Draft: fix Trimex visibility change
Fixes #19966
2025-03-04 10:13:44 +01:00
Roy-043
29c03a43a3 Draft: fix make_sketch hang
Fixes #19978

The onebyone argument of makeMissingPointOnPointCoincident and makeMissingVerticalHorizontal should be set to False.
2025-03-04 10:12:44 +01:00
Roy-043
4d48c0de55 Draft: fix Draft_Trimex boundary subelement selection
Fixes #19614

Instead of using the whole object, the hovered subelement should be used for the boundary.

With this PR the handling of the boundary is also  'nesting-aware'. This is however still not the case for the object being extended/trimmed. That object has to be in the global space.
2025-03-03 17:18:25 +01:00
Roy-043
8a0d6a23bb 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
ff9e84e181 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
084a0b3b4a Draft: fix polar coords regression
Fixes #19961

Regression caused by #19179.
2025-03-03 17:07:20 +01:00
Chris Hennes
7f1c43a335 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
6c40857f0e Draft: fix Draft_Edit issue with Gesture navigation
Fixes #19519
2025-03-02 16:13:13 -06:00
Mino-Tsuzuku
9aef91b3ca 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
2a645d36b8 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
755229df23 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
bf5e28a502 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
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
Joao Matos
cc6ffb44de Core: Move PyCXX library to src/3rdParty. 2025-02-24 16:36:06 +00:00
Roy-043
5087c1949f 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
a72a63232a 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
27ebc68a11 CMake: Modernize build files using outdated Python variables. 2025-02-16 10:21:26 -06:00
Roy-043
dd3ae90fe7 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
ee7f52060b 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
5bcc0d9612 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
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
c88b44f0da 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
7ec76ffc9b 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
c6ce42a383 Draft: add some checks for font file of shapestring
Fixes #19447.
2025-02-07 20:03:49 +01:00
Roy-043
b17904a2e9 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
8b124b659c Draft: Fix line length input issue
Fixes #19451.
2025-02-07 13:38:56 +01:00
Chris Hennes
b051185ae0 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
eb5037937c Draft: Fixed small bug in draftgeoutils.edges 2025-02-06 13:56:08 +01:00
Roy-043
0dc0372570 Draft: improved handling of 'crazy' edges in hatch
See #14114.
2025-02-06 13:43:52 +01:00
tritao
3b47599e43 Gui: Minor cleanups. 2025-02-05 22:13:07 +00:00
Roy-043
be0f3f9c4a 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
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
e21be6d39f Draft: Avoid setRadiusValue error message
Fixes #19386.
2025-02-04 16:25:53 +01:00