Commit Graph

30105 Commits

Author SHA1 Message Date
PaddleStroke
c984a5d4db PartDesign NewSketch: Add a parameter to use attachment dialog instead of feature pick 2025-01-20 12:27:04 -05: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
wmayer
a123ebd6d6 Import: Fix transparency issues when loading STEP files 2025-01-20 12:18:16 -05:00
Vincent Belpois
5ed5f71125 Fix missing constrain type in type2str 2025-01-20 12:17:25 -05:00
Joona Okkonen
f0fb8ddabe Sketcher: Fixed mapping error when attempting to create a sketch inside a group. (#18971)
* Sketcher mapping error fix

Fixed an issue in the Sketcher where attempting to create a sketch while a group is selected caused a mapping error. Now, when a sketch is created with a group selected, the sketch will be placed inside the group.

* Update to use new templated countObjectsOfType

This commit updates the code to use the new templated version of countObjectsOfType, aligning with recent changes in the main branch.

---------

Co-authored-by: Joona <jookkone@edu.lapinamk.fi>
2025-01-20 11:11:09 -06:00
Chris Hennes
286e1d2251 Merge pull request #18807 from marioalexis84/fem-netgen_object_constraint
Fem: Use property constraints on mesh netgen object
2025-01-19 16:03:10 -05:00
Chris Hennes
e9ef7b7329 Merge pull request #18809 from wwmayer/datum_fixes
Datum fixes
2025-01-19 16:01:18 -05:00
marioalexis
f132b12df2 Fem: Use new material editor in Reinforced material task panel - fixes #18692 2025-01-19 15:36:43 -05:00
Kacper Donat
676c2fe568 Gui: Add Show Plane utility to 2D Objects 2025-01-19 15:27:15 -05:00
PaddleStroke
dc1151721f PartDesign: Fix context menu (#18919) 2025-01-19 13:41:55 -06:00
João Matos
97e24f10f8 CMake: Improve Import dependency check for TechDraw module. (#19036)
* CMake: Fix missing Import dependency check for TechDraw module.

* CMake/TechDraw: Conditionally use Import library.

* CMake: Fix missing dependency check for Module and PartDesign measure in TechDraw.
2025-01-19 13:33:16 -06:00
Yorik van Havre
518c3b4926 BIM: Make sure we have a default context when exporting to IFC 2025-01-19 14:32:03 -05:00
Chris Hennes
03b008c8da Merge pull request #19052 from alfrix/hole_ui_hide
feat(PD): Hole UI Taskpanel: hide elements that are not applicable or useful
2025-01-19 11:31:03 -05:00
anselm-baur
ca285f2e97 Assembly: fix missing space
Co-authored-by: Anselm Baur <anselm-baur@live.de>
2025-01-18 14:45:50 -05:00
PaddleStroke
52e68abc10 PartDesign: replace part design datum commands by the core ones 2025-01-18 11:39:44 +01:00
Chris Hennes
d1625cd703 Merge pull request #18665 from AjinkyaDahale/sk-refactor-stage-2
[Sketcher] Round 2 of refactors
2025-01-17 10:41:52 -06: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
0e1af6f076 Merge pull request #19067 from Roy-043/Draft-Save-fillet-settings
Draft: Save fillet settings
2025-01-16 19:52:31 +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
225241e673 Clean up
The recompute and the `try` structure are no longer required.
2025-01-16 11:53:55 +01:00
Roy-043
88a6eecdbb BIM: ArchWall use moveGeometry to move sketch point
The movePoint function is no longer available in V1.1.
2025-01-16 11:53:55 +01:00
Ajinkya Dahale
af9b577621 [Sketcher] Refactor and fix an issue in transferConstraints 2025-01-16 15:56:22 +05:30
Ajinkya Dahale
60b610c8dc [Sketcher] Fix issues in knot operations
For some reason this is not caught in the tests.
2025-01-16 15:56:22 +05:30
Ajinkya Dahale
e5eda8e437 [Sketcher] Make replaceGeometries protected
This should be a `protected` or `private` operation since it doesn't handle
constraints. However, this is intended to be used by external classes that
modify a `SketchObject` (instead of these modifications like `split`, `trim`,
`join` etc. being methods of `SketchObject`). In that case, it may be best to
use the `friend` keyword.
2025-01-16 15:56:22 +05:30
Ajinkya Dahale
edbe6a54d7 [Sketcher] Fix "used" B-spline poles being deleted 2025-01-16 15:56:22 +05:30
Ajinkya Dahale
8bc51aa5ee [Sketcher] Incorporate review of #18665 by kadet
1. Replace `find_if` with `any_of` when the iterator is not used.
2. Use PascalCase for templated class.
2025-01-16 15:56:19 +05:30
Ajinkya Dahale
e71b25d942 [Sketcher] Refactor SketchObject::split
1. Now uses `Part::Geometry::createArc`.
2. Removed type-specific codes. It can be generalized now.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
a04b30deda [Sketcher] Further refactor modifyBSplineKnotMultiplicity 2025-01-16 15:55:14 +05:30
Ajinkya Dahale
8b6d5728e7 [Sketcher] Incorporate review of #18665
...by hyarion on December 29.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
0c2e621141 [Sketcher] Fix some issues in trim
Fixes fails at cases where one (or both) of the remaining segments is (are)
degenerate. This existed pre-refactor.

Fixes cases where there are some constraints on internal geometry that do not
get deleted cleanly.

Also fixes a memory leak.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
e38e3f17d1 [Sketcher] Refactor SketchObject::trim
Cognitive complexity down to 57.
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
8cb30c3c53 [Sketcher] Refactor SketchObject::modifyBSplineKnotMultiplicity 2025-01-16 15:55:14 +05:30
Ajinkya Dahale
da71365ff3 [Sketcher] Refactor SketchObject::insertBSplineKnot() 2025-01-16 15:55:14 +05:30
Ajinkya Dahale
6b5bc1f277 [Sketcher] Refactor SketchObject::trim()
1. Use `Part::GeomCurve::createArc()`
2. Refactor constraint logic in `trim`
2025-01-16 15:55:14 +05:30
Ajinkya Dahale
6df0b167e3 [Sketcher] Refactor internal geometry operations
* Use range-for and rearrange for understandability.
* Break down into individual functions by geomtype.
* Also refactor `exposeInternalGeometryForType<Part::GeomBSplineCurve>`
* Use `Constraint::involves...()` in delete internal

Suppress clang-tidy/clazy warnings by using `[[maybe_unused]]`.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-01-16 15:54:47 +05:30
Ajinkya Dahale
a25c897343 [planegcs] Refactor pointer vector freeing
Remove the type-checks in `free(std::vector<Constraint*>& constrvec)` as well as
checks for `nullptr` before deleting.
2025-01-16 15:52:03 +05:30
Ajinkya Dahale
e0b4d95482 [planegcs] Refactor conditions & loops in GCS.cpp for readability 2025-01-16 15:52:03 +05:30
Ajinkya Dahale
e4a9baf9cf [planegcs] Refactor identifyConflictingRedundantConstraints() 2025-01-16 15:52:03 +05:30
Ajinkya Dahale
d71c3be2b1 [planegcs] Refactor GCS::System::initSolution() 2025-01-16 15:52:02 +05:30
Ajinkya Dahale
ff10a6db36 [Sketcher] Helper functions for deleting geometry
Some tests probably needed
2025-01-16 15:52:02 +05:30
Ajinkya Dahale
a4f74f6d97 [Sketcher] Write SketchObject::replaceGeometries() 2025-01-16 15:52:02 +05:30
Ajinkya Dahale
2422566faa [Sketcher] Refactor SketchObject::join() (expected trivial)
No tests are added since this commit only adjusts if-then statements.
2025-01-16 15:52:02 +05:30
Ajinkya Dahale
c9fc8270aa [Sketcher] Some trivial for loop changes in SketchObject
No tests added since this should be no more different than existing code.
2025-01-16 15:52:02 +05:30
Ajinkya Dahale
bb11cb52f5 [Sketcher][test] Create test for getConstraintAfterDeletingGeo+
[Sketcher] Add null case to constraint change on deletion checks
2025-01-16 15:52:02 +05:30
Tim
4477e644dc Addon Manager: Improve proxy URL parsing & enhanced the error messaging (#19078) 2025-01-15 13:39:04 -06:00
Alfredo Monclus
a23e898645 refactor(PD): hole taskpanel remove minimumSize 2025-01-15 14:57:49 -03:00
Chris Hennes
8c3bb779fb Merge pull request #19019 from hyarion/refactor/countObjectsOfType
Refactor countObjectsOfType in selection and document
2025-01-14 16:05:12 -06:00
Roy-043
499bd12d13 Draft: Save fillet settings
Fixes #16248.
2025-01-14 21:48:16 +01:00
wmayer
28dcc54f0b Fix several compiler warnings 2025-01-14 13:34:18 -06:00