Commit Graph

39208 Commits

Author SHA1 Message Date
Adrian Insaurralde e960b745f9 Fix missing bracket after bad backport of #18644 2025-02-18 18:18:38 -03:00
Jiří Mácha 3aa55e5e91 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.
2025-02-18 17:22:09 -03:00
wmayer c75fe83a4e App: Fix possible crash when postponing the destruction of a removed property
Fixes #18601
2025-02-18 17:17:27 -03:00
PaddleStroke b8b02f5f46 Assembly: Make ExplodedView: a group extension. So that we don't mimick group. Fixing the delete exploded view group issue 2025-02-18 17:15:27 -03:00
wmayer 9040a14d7b Part: Fix getIcon() of several view providers to return full path name of the icon file 2025-02-18 17:13:22 -03:00
Pascal de Bruijn 0dff5334d1 TechDraw: fix editable/autofill scale in Templates 2025-02-18 17:08:50 -03:00
Pascal de Bruijn db1f37a98a TechDraw: Component Drawing as default document type (#18827)
Presumably Component Drawings are more common as opposed to Assembly Drawing's
therefore FreeCAD's default should reflect this.

find src/Mod/TechDraw/Templates -iname "*.svg" -exec sed -i 's#Assembly Drawing#Component Drawing#g' "{}" \;
2025-02-18 17:08:35 -03:00
Roy-043 c4e292bd66 BIM: Improve onChanged Placement code
* Switched Component code to new Comp=True version of code.
* Made the Placement code in both files identical. This also solves that Rotating a BuildingPart was not propagated to children.
2025-02-18 13:26:12 +01:00
Chris Hennes 9dd074ff6d Points: Add missing QMessageBox include to PCH file 2025-02-17 21:40:14 -06:00
Benjamin Nauck 8de5d74502 Backport: Core: Implement SoFCTransform node (#19672)
* Core: Implement SoFCTransform node

In its doAction() method it only sets the model matrix if it's not the identity matrix.
This improves the issue #7606


* Add doc string to SoFCTransform

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
Co-authored-by: wmayer <wmayer@freecad.org>
Co-authored-by: wwmayer <werner.wm.mayer@gmx.de>
2025-02-17 19:38:10 -03:00
Adrian Insaurralde 5c23509370 Add proper PDF creator metadata (backport PR #18824)
[pre-commit.ci] auto fixes from pre-commit.com hooks

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

App: Add utility method to get app name with version included

Gui: Migrate to using App::Application::getNameWithVersion

Spreadsheet: Migrate to using App::Application::getNameWithVersion

TD: Migrate to using App::Application::getNameWithVersion

Drawing: Migrate to using App::Application::getNameWithVersion
2025-02-17 14:21:35 -03:00
Syres916 78d954d086 [Techdraw] Import SVG files with UTF-8 encoding (#18816)
* [Techdraw] Fix importing SVG files with UTF-8 encoding

* [Techdraw] fix Lint feedback
2025-02-17 14:13:22 -03:00
Paul Lee 526ee2c9c4 [ArchWall] Fix Regression Single-edge Wall w/ Multi-Material
Forum Discussion
- https://forum.freecad.org/viewtopic.php?t=93610&start=10#p806296

Github Issues
- https://github.com/FreeCAD/FreeCAD/issues/19147#issuecomment-2607946858
2025-02-17 15:13:30 +01:00
Roy-043 95dfb2ede8 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-02-17 15:12:53 +01:00
Daniel Wood cfb02b88be CAM: Tool Bit Library Fixes (#18973)
* remove unused else
* Enable reloading / re-selection of libraries
* Reload the libraries when exiting the editor
* Clear the model to prevent duplicate entries
* add missing docstring to reduce linting warnings
* Maintain any previous library selection when editing
2025-02-17 00:56:02 -03:00
MisterMaker a28fb062b9 [stylesheets] Gathering of stylesheet fixes (#18929)
* this is a workaround to remove caps

pelase ignore this hackery

* And now the caps are gone

* a bunch of small tweaks and fixes.

* Update FreeCAD Light.qss

updated menubar color light theme

* updated the buttons a tiny bit

* Fix for to short buttons.

Couldn't test it since my macro window is broken.

Co-Authored-By: Syres916 <46537884+Syres916@users.noreply.github.com>

* qspinbox disabled tweaks.

* Update FreeCAD Dark.qss

Tweaked the buttons a bit so they are more in line with the light theme.

* Update FreeCAD Dark.qss

small tweaks

* reversed the spreadsheet headers gradient for dark

* Update light with undo arrows position

Co-Authored-By: Syres916 <46537884+Syres916@users.noreply.github.com>

* Update undo buttons arrow position dark

Co-Authored-By: Syres916 <46537884+Syres916@users.noreply.github.com>

* added an offset to qcombobox

* removed the fix since it ruined every Qcombobox.

* Tabs update more clean less gradients.

* Update DlgMacroExecuteImp.cpp

fixing conflicts

* Update DlgMacroExecuteImp.cpp

* Delete DlgMacroExecuteImp.cpp

* Create DlgMacroExecuteImp.cpp

* Revert "Create DlgMacroExecuteImp.cpp"

This reverts commit 8de8f7506177d773bb356fd0e22a66466c25b668.

* Revert "Delete DlgMacroExecuteImp.cpp"

This reverts commit 41315f31abdad79afd4b696ee15c603de3e4a6a1.

* Revert "Update DlgMacroExecuteImp.cpp"

This reverts commit aa792291684e2d674f6961c641c8e2f8b9af12c8.

* Revert "Update DlgMacroExecuteImp.cpp"

This reverts commit e8376a8fdf11d7fd014f2c46f189afdca42833ce.

* Delete src/Gui/DlgMacroExecuteImp.cpp

* Update DlgMacroExecuteImp.cpp

finally realized what was going on lol

---------

Co-authored-by: Syres916 <46537884+Syres916@users.noreply.github.com>
2025-02-17 00:50:08 -03:00
PaddleStroke c7a1792309 Stylesheet toolbar background (#18831) 2025-02-17 00:41:23 -03:00
PaddleStroke 0141331dbd TechDraw: Assembly exploded views : revert #17726 2025-02-17 00:39:16 -03:00
Kacper Donat 6c8f9b28a0 App: Fix GeoFeature::getGlobalPlacement when rootObj is Link
This fixes a case when in case of rootObj being Link placement was not
calculated correctly due to not changing of the document. While for
original use it was fine as this was mostly used in case where there was
defined non-link root for general case Links can be root objects of the
document.
2025-02-17 00:31:02 -03:00
marioalexis e18e786f76 Fem: Fix references assignment in centrif example 2025-02-17 00:27:44 -03:00
herbkonik 5613501758 CAM: Fix bug that incorrectly calculates corner radius (#18724)
OCL requires three elements for defining a bullnose cutter: overall diameter, corner radius, and overall length. FreeCAD is providing the correct diameter and length, but the corner radius is calculated incorrectly in SurfaceSupport.py
Props go to Edyork in https://forum.freecad.org/viewtopic.php?p=798895#p798895
2025-02-17 00:22:18 -03:00
wmayer 4505c28cb6 Gui: Fix copying elements in the tree view by holding CTRL key
In older versions it was possible to copy elements with drag and drop by holding the CTRL key. Since v0.20 or v0.21 this wasn't possible any
more so that elements are always moved.

Note: Copying is only allowed for elements that have a parent object.
2025-02-17 00:19:04 -03:00
WandererFan e605d73d3f [TD]Dimension font clipping (fix #11452) (#18771)
* [TD]separate alignment and rendering bounding rectangles

* [TD]use alignment rectangle (fix #11452)
2025-02-17 00:17:45 -03:00
wwmayer aff5cdf016 Fix issues in ellipse creation (#18800)
* Sketcher: Handle exceptions in onViewValueChanged

Because the method onViewValueChanged is used as a Qt slot it must handle all possibly raised exceptions as otherwise
they will slip through GUIApplication::notify() that usually results into a crash on some platforms like macOS

* Sketch: Handle undefined values in calculateThroughPointMinorAxisParameters

* The argument of acos() must be in the range [-1, +1], otherwise it returns nan (not a number)
* The value of sin(0) = 0. So, it cannot be used in the denominator of a fraction
2025-02-17 00:14:53 -03:00
MisterMaker 25f929c572 Stylesheets spreadsheets visual fix. (#18719)
* this fixes the spreadsheet alignment and the corner button

* missed a line
2025-02-17 00:13:21 -03:00
wmayer fafff3a08b smesh: Fix build failure with vtk 9.4
Fixes #18423
2025-02-17 00:09:56 -03:00
WandererFan 149b64e8ef [TD]Fix transparent area in pdf (fix #18443) (#18507)
* [TD]fix transparent areas in pdf (#18443)

* [TD]restore use of PDF/A-1b format

- was not working in older versions of QPdfWriter
2025-02-17 00:07:21 -03:00
Bas Ruigrok 48dca901e6 Gui: Fix Blender and Revit navigation issues with shift key in sketcher 2025-02-17 00:03:50 -03:00
Rotzbua 11136b282f feat(win): add registry for silent uninstall
Entry is recommended to support the silent uninstall process without knowing the arguments.
https://nsis.sourceforge.io/Add_uninstall_information_to_Add/Remove_Programs#Recommended_values
2025-02-17 00:00:02 -03:00
Pieter Hijma 5d4587cfb3 Gui: Fix VarSet dialog 2 digit problem 2025-02-16 23:53:02 -03:00
mwganson 3209329eb4 [Part TopoShapeExpansion] move shape transform from make element copy into ruled surface function since it does not work well when copying vertex objects 2025-02-16 23:38:30 -03:00
Chris Hennes 2718d4589b Ext: Correct user preference specified in comment 2025-02-16 23:37:25 -03:00
Bas Ruigrok b11d4211e4 Gui: Fix camera position shift when starting rotation 2025-02-16 23:36:06 -03:00
Roy-043 0e3d2a208f PrefPacks: Add spreadsheet colors to classic theme
Fixes #17984.
2025-02-16 15:27:33 -03:00
Ian Hunter 5f2ac5479b Fix bug preventing filtering named constraints (#19339)
* Fix bug preventing filtering named constraints

There was a bug (see issue #11843) that displayed a filter for Named
constraints in the Sketcher Workbench whose toggling did not affect the
UI in any way. This enables this feature by checking if a given
constraint has a custom name or not and then appropriately toggling its
visibility.

* Use `std::string::empty()` per reviewer suggestion

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-02-16 14:36:18 -03:00
Tim 12dc5829d7 [AddonManager] Fix construct_git_url return urls with '.git'. (#19242)
* [AddonManager] Fix construct_git_url return urls with '.git'.
2025-02-16 14:34:53 -03:00
Syres916 b638dba12c [Gui] fix the FPS text visibilty issues raised in #19371 (#19385)
* [Gui] fix the FPS text visibilty issues
* [Gui] code efficiency based on suggestions
* [Gui] update color parameter
* [Gui] Fix Lint feedback
* [Gui] check if string is empty
2025-02-16 14:14:44 -03:00
Roy-043 2a26b3d01b Draft: Avoid setRadiusValue error message
Fixes #19386.
2025-02-16 14:02:24 -03:00
Benjamin Nauck 9ad1aee683 CAM: Fix finish passes by avoiding fuzzy in Area.cpp (#19525) 2025-02-16 13:25:12 -03:00
tritao cff1b1921c Gui: Check if document exists in View3DInventorViewer::setOverrideMode. 2025-02-16 13:24:10 -03:00
Roy-043 79655aabf6 Draft: Fix line length input issue
Fixes #19451.
2025-02-16 13:23:29 -03:00
Chris Hennes 67b10dd24e Core: Update copyright date range to include 2025 (#19520)
* Main: Update copyright date range to include 2025
* GUI: Update copyright date range to include 2025
2025-02-16 13:20:42 -03:00
Benjamin Nauck 630f7bcd29 Revert "refactor: taskpanel ui on linux"
This reverts commit 537ad0fd7a.
2025-02-05 08:52:30 -06:00
Alfredo Monclus 537ad0fd7a refactor: taskpanel ui on linux 2025-01-27 14:07:14 -03:00
phaseloop 6d35b82899 CAM: Fix finishing pass (#17960)
* CAM: Fix finishing pass

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

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

* add finishing pass unit (by @baehr)

* [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-27 14:04:11 -03:00
Lawrence Woestman 4dca99183d CAM: Fixed script-style postprocessors getting the wrong __name__
Also added a test that the __name__ of the postprocessor is correct
2025-01-27 14:02:56 -03:00
Stan Tomlinson 4ee2c5d9db improved checks in GUI/Jobs.py/claimChildren
eliminate some error messages when a Job is not fully loaded
  (or when not properly constructed via scripting)

TESTED ON V0.21 -- code hasn't changed since then
2025-01-27 13:53:05 -03:00
Shai Seger 245b62b8fa [CAM Simulator] Add ifdef to fix OpenGL compatibility on linux. issue #18707 (#18746)
* Add ifdef to fix compilation on linux. issue #18707

* remove multisample line altogether
2025-01-27 13:42:45 -03:00
Joona Okkonen 7dca20f979 Backport version. Sketcher: Fixed mapping error when attempting to create a sketch inside a group. (#19215)
* 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.

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

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

---------

Co-authored-by: Joona <jookkone@edu.lapinamk.fi>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-24 08:04:20 -06:00
Roy-043 1e55e402ae Draft and BIM: Layer manager did not accept zero transparency 2025-01-10 23:44:28 +01:00