Commit Graph

578 Commits

Author SHA1 Message Date
Florian Foinant-Willig
b41b294292 Assembly: prevent user to remove core properties 2025-04-22 23:52:17 +02:00
Chris Hennes
318e0a6c45 Merge pull request #20835 from oursland/python-binding-generator-const
python: Make const methods declared const in C++.
2025-04-21 10:58:21 -05:00
Jacob Oursland
926757a258 Assembly: align parameter names between decl and impl. 2025-04-17 15:11:36 +02:00
Jacob Oursland
ea7845f0fa Assembly: Remove unused headers. 2025-04-17 15:11:36 +02:00
Jacob Oursland
c432b28ec2 Assembly: convert if-else to switch. 2025-04-17 15:11:36 +02:00
Jacob Oursland
5436ff85e7 Assembly: declare python methods const. 2025-04-16 20:33:08 -07:00
mosfet80
71317baa52 MOD: assembly clean (#20557)
* MOD: assembly clean

clean code

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

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

* Update AssemblyLink.cpp

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-04-14 11:05:55 -05:00
captain0xff
7f5b1c9f2c Gui: moved dragger classes to separate folder and files
* renamed SoFCCSysDragger to SoTransformDragger
* moved TDragger, RDragger and TPlanarDragger to separate files and also renamed them to be more descriptive
2025-04-13 21:36:54 +02:00
drwho495
8963a0d8bc Assembly: Fix hasher missing ref warning and speed bug. (#20405)
* fixed hasher ref bug and fixed speed of updateJCSPlacements

* remove debug info

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

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

* fix hasher mismatch when editing or creating a joint

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

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

* fix issues raised in PR

* add warning

* [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-04-07 11:13:15 -05:00
Chris Hennes
e7156aa326 Merge pull request #20496 from hyarion/refactor/cppify-constants 2025-03-29 18:43:40 -05:00
Andrea
0f4f47e313 [Mod] assembly clean
clean code
2025-03-29 14:31:40 -05:00
Benjamin Nauck
984c0d43fd Assembly: Use std::numeric_limits and std::numbers instead of defines 2025-03-29 13:32:38 +01:00
PaddleStroke
3b6cb37dd9 Assembly: ignore joints in error (#20253)
Co-authored-by: drwho495 <drwho495555@gmail.com>
2025-03-22 18:27:24 +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
PaddleStroke
4ab281bd7d Assembly: Fix: Select datum should not show dragger. (#20051)
* Assembly: Fix: Select datum should not show dragger.

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

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

* Update ViewProviderAssembly.cpp

* [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-03-17 18:13:20 +01:00
tritao
6c2c6847eb CMake: Cleanup targets with transitive dependencies 2025-03-17 12:12:06 +00:00
Chris Hennes
5f623390fb Merge pull request #20142 from bofdahof/ranges
Apply C++20 std::ranges (mainly to std::find)
2025-03-17 03:08:27 -05:00
bofdahof
c4eeaa2d11 Assembly: apply std::ranges 2025-03-16 17:15:26 -05:00
Karliss
fa61131590 Add missing parent for messagebox and other popups
Unparented popups can easily get lost in backround, but they still block top level event loop when run with ::exec() thus preventing interactions with main window.  This mainly happens on wayland. Setting the parent ensures they are always kept on top and reasonably positioned.
2025-03-16 16:02:36 -05:00
Andrea
cd5c46ba18 Remove unnecessary check (duplicated)
before including the library, it is uselessly checked if the variable __QtAll__ and __InventorAll__ have been defined. The same check is performed again once the library is included
2025-03-10 21:53:00 +01:00
PaddleStroke
d2721aaadd Assembly: Select LCS elements when LCS is in body
* Make it possible to select LCS elements the the LCS is in a body
2025-03-07 08:55:09 -06:00
PaddleStroke
a67080a777 Assembly: Fix use of datum axis in joints 2025-03-06 15:39:11 +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
14f15c4a50 Assembly: fix doCommand code in CommandExportASMT.py
See:
https://forum.freecad.org/viewtopic.php?t=94952
2025-02-24 17:06:28 +00:00
Joao Matos
cc6ffb44de Core: Move PyCXX library to src/3rdParty. 2025-02-24 16:36:06 +00:00
Roy-043
2aaf67029b Assembly: Make 2 menu texts more consistent
Menu texts in the Assembly WB are in title case without articles.

The following menu texts did not follow that 'standard':
* Insert a new part
* Create a Fixed Joint
2025-02-23 13:39:25 -06:00
Joao Matos
27ebc68a11 CMake: Modernize build files using outdated Python variables. 2025-02-16 10:21:26 -06:00
tritao
65466d580b Gui: Reorganize the selection files into a top Selection folder. 2025-02-03 17:56:57 +01:00
Benjamin Nauck
ae15d98fd3 Use is<T>() when possible 2025-01-27 16:08:18 +01:00
anselm-baur
e22b226866 Assembly: fix missing space
Co-authored-by: Anselm Baur <anselm-baur@live.de>
2025-01-18 14:45:50 -05:00
Yorik van Havre
fe60505c17 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
7a5a3d1ffc 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
PaddleStroke
cac8eb0859 Assembly: Joint creation presolve: move part2 rather than part1 when both are unconnected. 2024-12-20 11:37:04 -05:00
PaddleStroke
fa8b273f7d Merge branch 'main' into core_LCS3 2024-12-13 18:48:35 +01:00
Andrea
f5a4ec01f8 [Mod] Clean AssemblyObject.cpp
Removed dead code

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

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

.
2024-12-13 12:34:46 -05:00
mosfet80
29d685b452 Clean ViewProviderAssembly.cpp 2024-12-13 12:27:40 -05:00
PaddleStroke
1ce8f2c859 AssemblyObject: Use std::unordered_set instead of vector. 2024-12-13 18:04:10 +01:00
PaddleStroke
024fee7f97 Assembly: Enable the use of App::Datums 2024-12-13 18:04:10 +01:00
efferre79
fe57e3176d cmake fixes for external OndselSolver building (#18379)
* Assembly: fix building with external OndselSolver

This commit pairs with f35b075e271e9cb3451f3439f7dc0274841a0838.
It solves two issues:

- remove hardcoded includes of 3rdparty files
- add missing include_directories()

* Assembly: add check for external OndselSolver includes
2024-12-13 10:46:46 -06:00
PaddleStroke
396963006b Core: SoShapeScale fix weird scaling on viewport resize. See https://github.com/FreeCAD/FreeCAD/issues/18382#issuecomment-2527623758 2024-12-10 17:15:13 +01:00
Vincent
ebf528a653 Assembly: fix gears created with null radius and de-sync (#18275) 2024-12-09 11:23:05 -06:00
Kacper Donat
651cefde4d Gui: Use getObject<T>() helpers in classes
This commit is generated using regex based find and replace:

```
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/
```

To regenerate if needed.
2024-12-06 18:29:39 +01:00
Jiří Mácha
878d9525dc Assembly: migrationScript2 and migrationScript4 improved and refactored
Description of Defects in migrationScript2 and migrationScript4:

Several additional issues have been identified in the Assembly
functions migrationScript4 and migrationScript2, beyond those fixed in
patch 71f0104bb2.

One common problem is that the Joint property Reference1 or Reference2
can be set to an invalid format. For example, user can manually cause
this issue by assigning an incorrect reference (e.g., the Z-axis) to
these properties via the FreeCAD GUI.  When this happens, internal
errors (exceptions and their corresponding Python call stack) are
reported in the Report View.  However, such information is not helpful
for the user to fix their 3D model.

Issues with the Current Implementation (Using migrationScript4 as
Reference):

- Lack of Type Validation for Reference1 and Reference2:

  The script does not check whether joint.Reference1[1] or
  joint.Reference2[1] is a sequence. If this condition is not met,
  statements like:

    sub1 = joint.Reference1[1][0]

  will throw an exception, printing the Python call stack.

- Lack of Length Validation for Sequences:

  The script does not ensure that the sequence length is sufficient
  for indexing. For example, joint.Reference1 and joint.Reference2
  must each have at least two elements to allow:

    joint.Reference1[1][1]
    joint.Reference2[1][1]

  Without validation, such calls can result in exceptions, printing the
  Python call stack.

- No Feedback on Problematic Joint:

  The user is not informed about which Assembly joint in the object
  hierarchy has an invalid Reference1 or Reference2. Depending on the
  size of the 3D model, identifying the defect can be time-consuming
  and frustrating without proper feedback.

This patch is focused on:

- Reporting Problematic Joint Path:

  A new function has been added to retrieve the full path to the
  Assembly joint. The return value (a string) is used to report the
  issue.

- Improved Exception Handling:

  Instead of adding more conditional checks (see above), exception
  handling is implemented. AttributeError, IndexError, and TypeError
  exceptions are caught. The exception message (excluding the call
  stack) is displayed at the end of a user-friendly warning.

- User-Friendly Warnings in the Report View:

  A single-line warning is now shown in the Report View, containing
  the following details:

    - Source of Warning:              'Assembly joint'
    - Location in the 3D Model: e.g., 'Assembly_XY.object_XY.joint_XY'
    - Problematic Attribute: e.g.,    'ReferenceXY'
    - Exception Message: e.g.,        'list index out of range'

- Refactoring and Optimization:

  The functions were refactored and optimized at the end of the
  conversion process.

Advantages:

- Cleaner Report View:
  Internal errors (e.g., Python call stacks) are no longer logged in
  the Report View, as they are not useful for end users. Only the
  exception message is displayed.

- Improved User Feedback:
  Users can now identify the problematic Assembly joint in the object
  hierarchy, saving significant time and effort.

- Robust and Concise Code:
  The solution simplifies the code while increasing its robustness.
2024-12-06 12:13:41 -05:00
luzpaz
96c838f3b9 Fix various typos
Found with codespell
2024-12-04 23:18:00 -05:00
Aik-Siong Koh
3326c33d83 Assembly: Simulation implementation 2024-12-03 20:07:04 +01:00
wmayer
7fdc3b807a Fix compiler warnings 2024-12-03 10:16:08 +01:00
PaddleStroke
f6268ffd28 Assembly: Insert new part (#17922)
* Assembly: Joint Object : encapsulate the joint creation widget such that the task can be subclassed and ui customized by other commands.

* Assembly: Insert New Part

* Update src/Mod/Assembly/CommandInsertNewPart.py

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2024-12-02 18:34:02 +01:00
PaddleStroke
b29f2cdfe2 Assembly: Make ExplodedView: a group extension. So that we don't mimick group. Fixing the delete exploded view group issue 2024-12-02 12:14:43 -05:00
Fabio Rossi
18f63edadb add local OndselSolver includes only when not external 2024-12-02 12:04:54 -05:00
Benjamin Nauck
e5c2c81685 Move back the assembly util functions to AssemblyUtil (#18020)
* Move back util functions to AssemblyUtils again

* Add getPropertyByName<T>() helper

* Improve constness in AssemblyUtils

* [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>
2024-12-02 10:48:48 -06:00