Compare commits

...

328 Commits

Author SHA1 Message Date
Adrian Insaurralde Avalos 0c7935c755 Build: bump version suffix to rc2 2026-01-08 09:03:27 -03:00
jffmichi b9c11dc75b CAM: fix Radius Mill TipDiameter resetting
(cherry picked from commit ae8412468a)
2026-01-08 04:52:17 +01:00
Kacper Donat 99f27d4b9f CI: Limit backports to pixi only
(cherry picked from commit ad0ad85b77)
2026-01-08 00:02:32 +01:00
tetektoza 0b4e10ca4d Sketcher: Disable depth testing for constraint icons
Add `SoDepthBuffer` nodes around the constraint group to disable depth
testing for constraint icons. This ensures icons render on top of
geometry lines regardless of Z position, improving visibility and
selectability.

(cherry picked from commit b1fdf659d8)
2026-01-07 17:16:54 +01:00
tetektoza e5f717ba50 Gui: Render constraint text and arrowheads above geometry lines
Add Z offset for arrowheads and explicitly enable depth testing for
constraint lines in SoDatumLabel. This ensures constraint lines render
below geometry (respecting zConstr level) while text and arrowheads
render on top for better visibility and selection.

(cherry picked from commit 4aa4f2663e)
2026-01-07 17:16:54 +01:00
drwho495 b3f5a35ef7 TopoNaming: Improve ElementMapVersion definition. (#26691)
This change makes the program only mark an object's ElementMapVersion with the "1" prefix if the object has a hasher AND an element map.

(cherry picked from commit 9b64da827a)
2026-01-07 16:20:48 +01:00
PaddleStroke dae6cc2481 Sketcher: Fix text sometimes reversed when switching from one sketch edit to another.
Sometimes when user would switch from editing one sketch to edit to another sketch by double clicking on the new sketch, without living the previous sketch, it would then render the text of constraints backward. This was happening because the unsetEdit of the previous sketch was clearing the selection and adding the old sketch as selected. Then the new setEdit was failing to find the correct editing placement resulting in backward text.

(cherry picked from commit 450789e77b)
2026-01-06 21:39:25 +01:00
PaddleStroke 37b8ba683b Sketcher: Reverse #25478 and #26033
(cherry picked from commit 26723cf209)
2026-01-06 21:39:25 +01:00
Adrian Insaurralde Avalos 86f512e2c3 set BUILD_DYNAMIC_LINK_PYTHON=OFF for mac and linux release builds
fix regresion #25098

(cherry picked from commit ede7013f55)
2026-01-06 20:21:41 +01:00
WandererFan 2fdda0c4e0 TechDraw: Axo Dimension Fixes (#26445)
* [TD]fix dim text on wrong side of dim line

- this fixes the problem when the dimension line is +/- vertical

* [TD]Avoid use of CosmeticVertex for Axo Dimension

* [TD]fix CI warnings re unused variable

* Update DrawViewPyImp.cpp per review comments.

(cherry picked from commit cc707c98eb)
2026-01-06 20:17:39 +01:00
PaddleStroke 2468a26f01 Sketcher: Fix selection & zoom lag in large sketches (#26671)
* Sketcher: Fix selection & zoom lag in large sketches

* Update src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp

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

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
(cherry picked from commit 21f0d44320)
2026-01-06 19:21:44 +01:00
Yash Suthar f7761c5b14 Core: Fix premature merge of property in debug mode
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
(cherry picked from commit 9e22524e11)
2026-01-06 17:13:03 +01:00
PaddleStroke b56fba2ee6 Sketcher: Speed up large bulk Selection in edit (#26663)
* Sketcher: Speed up large bulk Selection in edit

* Update ViewProviderSketch.cpp

* Update src/Mod/Sketcher/Gui/TaskSketcherConstraints.cpp

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
(cherry picked from commit 0fa707c523)
2026-01-06 16:58:26 +01:00
Roy-043 d80801c07c BIM: remove v1.1 Sill Height code (#26641)
(cherry picked from commit 530aba61db)
2026-01-06 11:46:55 +01:00
Billy Huddleston 728ae02651 CAM: Fix duplicate label issues with toolbits
Addresses problems caused by the "Allow duplicate object labels in one
document" option. Toolbit sub-objects now always get unique labels by
temporarily disabling this option during copy, preventing expression and
property binding errors. Also ensures tool controllers always use the
"TC: " prefix for consistency.

src/Mod/CAM/Path/Tool/shape/models/base.py:
- Temporarily disable DuplicateLabels during shape copy to enforce
unique labels

src/Mod/CAM/Path/Main/Gui/Job.py:
- Add "TC: " prefix to tool controller names when adding from the Job
panel

(cherry picked from commit 2a24a539e6)
2026-01-06 10:52:05 +01:00
wandererfan efbf8eafb7 [TD]prevent crash on cosmetic element delete
(cherry picked from commit dc0901839e)
2026-01-06 07:35:20 +01:00
Kacper Donat 1853a3b0a1 Sketcher: Use correct namespace for tr functions in DSH
The `lupdate` tool from Qt used to extract translations from files was
not in sync with what the macros defined in the code. The mismatch came
from two places:

1. The DrawSketchHandeler used non fully-qualified name for the
   context whereas lupdate assumed the FQN.
2. Deriving DrawSketchHandlers did not override the translate method
   context to their own class names while lupdate assumed that they do.

While it's not fully clear if what `lupdate` does here is correct
(it's a lot of assumptions) it's way easier to fix our metadata than
fight with lupdate.

(cherry picked from commit 2682d68809)
2026-01-06 05:00:26 +01:00
WandererFan 1d81ac4e2a Surface: Provide geometry to Measure module (#26479)
* [Surf]provide geometry to Measure

* [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>
(cherry picked from commit 7abdbe0ce0)
2026-01-05 23:17:12 +01:00
Captain 54b84ffa1b PD: fix gizmo direction when the calculated point lies outside the face (#26616)
* PD: fix gizmo direction when the calculated point lies outside the face

* [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>
(cherry picked from commit 2b97d553f9)
2026-01-05 18:10:48 +01:00
freecad-gh-actions-translation-bot ad2f530875 Update translations from Crowdin
(cherry picked from commit 2592406b35)
2026-01-05 13:18:43 +01:00
Kacper Donat 43696df1b1 PartDesign: Fix misplaced preview for patterns
Previous solution did not take into account supporting shape transform
which should now be handled correctly.

(cherry picked from commit f819011d81)
2026-01-05 12:16:50 +01:00
PaddleStroke b7e3bb1f7c Sketcher: Use DenseQR for small sketches to avoid SparseQR rank issues (#26559)
(cherry picked from commit c8106982de)
2026-01-04 20:18:19 -09:00
Roy-043 fc2ad996f4 Draft: fix regression in Pattern display (Refactor texture handling in view_base.py)
(cherry picked from commit 34441b8101)
2026-01-05 05:34:04 +01:00
Roy-043 ea9039cd30 Draft: fix regression in Pattern display (add find_coin_node_by_name function)
Adapted existing code attribution and added a new function to find a node by name.

(cherry picked from commit 21e7fa1e8b)
2026-01-05 05:34:04 +01:00
Billy Huddleston b16ec077ba CAM: Add 0.05 um to V-bit tip diameter to prevent invalid sketch constraints
This commit applies a simple fix to the V-bit tool definition, adding a
small offset (+0.05 um) to the tip diameter. This prevents the sketch
from generating invalid constraints due to a zero or near-zero tip size.

src/Mod/CAM/Path/Op/SurfaceSupport.py:
- Add +0.05 um to tip diameter calculation to avoid constraint errors in
sketches

(cherry picked from commit a7c9cbee9e)
2026-01-05 02:49:34 +01:00
Kacper Donat b98dfeef70 Gui: Migrate to new styles
Since some time we have new stylesheets based on style parameters. For
compatibility reasons however old stylesheets were left in the project -
this commit removes them by reapplying the theme if old stylesheet is
detected.

(cherry picked from commit c938645843)
2026-01-05 01:48:41 +01:00
tetektoza 4c844ca5f5 Gui: Add hidden anchor object to root for transparency (#26590)
* Gui: Add hidden anchor object to the root for transparency

Image planes with transparency failed to render correctly in empty scenes
because OpenInventor's two-pass transparency rendering requires at least
one opaque object to properly initialize the depth buffer.

The fix adds a zero-scaled cube with no material node (making it use
OpenGL's default opaque material) to each image plane's scene graph.
This hidden object:
- Acts as a depth buffer anchor for transparent rendering
- Is invisible (scaled to 0,0,0)
- Has negligible performance impact

This matches the workaround already used in the rotation center indicator
and resolves the issue where image transparency only worked when the
rotation center, grid, or other opaque objects were visible.

* Gui: Exclude hidden anchor from bounding box calculations

Prevents the hidden anchor from affecting "fit all" and other bounding box
operations by wrapping it in `SoSkipBoundingGroup`.

(cherry picked from commit 3f49f3f059)
2026-01-03 09:12:54 +01:00
Krrish777 6c8917d9c8 Fix: Update PartDesign Boolean dropdown immediately before recomputation
(cherry picked from commit d944df04e1)
2026-01-03 08:17:45 +01:00
PaddleStroke 48ddc33bd3 Part: Toposhape: fix regressions due to changes in getElementTypeAndIndex (#26596)
* Part: Toposhape: fix regressions due to changes in getElementTypeAndIndex

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

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

* Update TopoShape.cpp

* Update TopoShape.cpp

* Update TopoShape.cpp

* Update TopoShape.h

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 07756cc838)
2026-01-03 02:37:10 +01:00
chris 39750371ad partdesign: fix issue #25811 while not breaking #14720 topo naming
(cherry picked from commit 6df651b5c8)
2026-01-03 01:21:40 +01:00
tetektoza ab65ea8fe4 Part: Remove needPickedList mat override to prevent rendering artifact
The `needPickedList` check in `SoBrepFaceSet` was triggering
unnecessary material override processing that caused face clipping
artifacts when the "Picked object list" option was enabled in Selection
View. This check has been removed as the picked list functionality works
independently of the rendering path.

(cherry picked from commit c66aa58a60)
2026-01-02 23:43:48 +01:00
tetektoza f0930dbd83 Gui: Prevent whole-object highlight when picked list is enabled
Removed the logic that forced `onTop=1` when `needPickedList()` is true
in View3DInventorSelection. This was causing the entire object to be
highlighted instead of just the selected sub-element when the "Picked
object list" option was enabled.

(cherry picked from commit 4dcef14bd8)
2026-01-02 23:43:48 +01:00
PaddleStroke 3672610617 Sketcher: Fix snap to axis not working (#26558)
When snapping to an axis, snapToObject returns false because we should also be able to snap to grid at the same time. Recent changes made the end return to be the initial unmodified position. Breaking snap to axis

(cherry picked from commit 9f2b0f910b)
2026-01-02 23:34:11 +01:00
Max Wilfinger 322f1348e3 Merge pull request #26606 from FreeCAD/backport-26598-to-releases/FreeCAD-1-1
[Backport releases/FreeCAD-1-1] Sketcher: Fix large sketch being laggy
2026-01-02 20:36:27 +01:00
PaddleStroke 3f24fca729 Sketcher: Fix large sketch being laggy (#26598)
* Sketcher: Remove old constraint positioning logic that was making sketcher laggy

* [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>
(cherry picked from commit be6be63764)
2026-01-02 15:37:15 +00:00
tetektoza 73f5f332fb Gui: Use encodeAttribute when escaping XML attributes for XHTML
(cherry picked from commit 57dd04f214)
2025-12-30 23:00:43 +01:00
tetektoza 11756c1cd4 Gui: Clean up XHTML meta tags per Nu validator feedback
- Change http-equiv="Content-Type" to simpler charset="utf-8"
- Remove unnecessary type="text/javascript" from script tag

(cherry picked from commit 38bb34ab85)
2025-12-30 23:00:43 +01:00
tetektoza 2249b8cdd6 Gui: DOCTYPE and structure improvements
Fix X3D standalone export (.x3d):
- Use proper X3D 3.3 DOCTYPE instead of XHTML DOCTYPE
- Remove problematic default namespace declaration
- Use xsd:noNamespaceSchemaLocation for better parser compatibility
- Remove invalid width/height attributes

Fix XHTML/X3DOM export (.xhtml):
- Wrap navigation buttons in <div> (required by XHTML Strict)
- Keep X3D elements unprefixed for X3DOM compatibility
- Add proper XHTML structure with XML declaration

(cherry picked from commit 2ae054e470)
2025-12-30 23:00:43 +01:00
tetektoza ed6bf31b77 Gui: Escape XML special characters in attributes for XHTML
Add escapeXmlAttribute() helper function to properly escape special
characters in XML attribute values:
- Double quotes (") --> &quot;
- Ampersands (&) --> &amp;
- Less-than (<) --> &lt;
- Greater-than (>) --> &gt;
- Single quotes (') --> &apos;

(cherry picked from commit fe7bceeb79)
2025-12-30 23:00:43 +01:00
tetektoza c269631319 Gui: Fix XHTML doc structure
- Add missing <title> element in <head> (required by XHTML Strict)
- Add <body> wrapper around content (required by XHTML)
- Add Content-Type meta tag for proper character encoding
- Fix indentation of buttons to be inside body element

(cherry picked from commit 679d4c2397)
2025-12-30 23:00:43 +01:00
tetektoza 43c88854d0 Part: Preserve child visibility when deleting compound copies (#26509)
* Part: Preserve child visibility when deleting compound copies

Currently, if we have a FC document two compounds, when one of them is a
copy of the other containing same children and we delete the copy
compound to keep the children, their visibility state changes.

The cause of that was a part of code in `onDelete()` method, which was
unconditionally calling `showViewProvider()` on every child object,
without checking if other compounds still claim those children or what
the current visibility should be.

So this patch adds parent-checking logic before changing visibility. The
visibility is only updated if the child is truly orphaned. So in the
scenario where we have the children referenced STILL by some compounds,
the visibility remains unchanged. It only changes when child has truly
no parents.

* Part: Use std::ranges::find for finding parent

(cherry picked from commit df25bd3cdb)
2025-12-30 22:07:35 +01:00
Kacper Donat 07f5b2362e Gui: Fix segfault in Safe Mode
This fixes segfault that was caused by changing settings in
FirstStartWidget that triggered change event on not fully intialized
StartView.

It is quick and dirty fix that just disables handling of the event
causing segfault until widget is fully ready. The correct solution would
be to remove the logic that changes settings from the widget (as it
should not be there) and instad move it to another place in pipeline.
This would be however much more work and segfault should be fixed ASAP.

(cherry picked from commit a0356796ac)
2025-12-30 19:41:49 +01:00
drwho495 b62a27ce6b TopoNaming: Enable migration code for 1.0.X -> 1.1 (#26538)
(cherry picked from commit e9ea3d0d25)
2025-12-30 15:45:30 +01:00
Roy-043 bab554670d BIM: fix component VerticalArea calculation (#26254)
(cherry picked from commit 0ced25c6dc)
2025-12-30 09:03:44 +01:00
theo-vt 8da1881389 Sketcher.scale: Scale label of modified constraints (#26442)
* Sketcher.scale: Scale label of modified constraints

* Sketcher.scale: Narrowing conversion on constraint index

(cherry picked from commit cc60502708)
2025-12-30 05:48:07 +01:00
Adrian Insaurralde Avalos 20623a7757 FEM: sanitize NAN format on frd import
depending on c runtime lib and possibly locale calculix may format NAN differently so we need to sanitize when importing the results

(cherry picked from commit 3dce4c831d)
2025-12-29 21:40:11 +01:00
Chris Hennes 1dbcd2f8df CI: Update backport Action to use new secret token
When using the default GitHub token, no further Actions are triggered, which means a backport PR is not checked against the normal CI runs, and it should be. This switches to using a token generated by the freecad-ci-runner GitHub account.

(cherry picked from commit bb8d4a8095)
2025-12-29 21:39:43 +01:00
Christoph Moench-Tegeder 2df9e6d0d5 add pybind11 include path in MeshPart CMakeLists
This could be a return of parts of commit d4feb51402
Without these, the rc1 build fails on FreeBSD with "pybind11/eigen.h not
found" - the layout of the pybind11 directories on the BSDs may differ
somewhat from your typical Linux distribution. But then, on Linux, this
additional include path will just point to an already-known location.

(cherry picked from commit 57b970f795)
2025-12-29 21:39:16 +01:00
Chris Hennes 99e25d353a Gui: Add explicit find_package for Qt6::GuiPrivate
(cherry picked from commit e858a13a5f)
2025-12-29 21:38:47 +01:00
Roy-043 0f8e601e78 BIM: prevent crash when switching BIM_View Render Mode
Fixes #24929.

Disabled animations in viewer to prevent crashes.

(cherry picked from commit 2292316f22)
2025-12-29 21:38:32 +01:00
Chris Hennes 2d3917c62f PD: Add case for when scripts set Midplane=False
(cherry picked from commit 8b9048a784)
2025-12-29 20:05:28 +01:00
Alfredo Monclus 7168aba55d PartDesign: fix transform removal causing an invalid base feature on the next solid if it was broken itself
(cherry picked from commit 24b9cdb4f9)
2025-12-29 18:50:56 +01:00
Adrian Insaurralde Avalos 730065a94c add freecad channel to pixi envs to use custom ifcopenshell and calculix package 2025-12-29 17:48:33 +01:00
Yash Suthar 5e9b228ce1 Fix : added empty link check to prevent null entry in document link map (#26406)
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
(cherry picked from commit ee7d84bb03)
2025-12-29 17:44:16 +01:00
Rahul Paul e95b18012e [MOD] Fix premature evaluation and recursive updates in Image Plane Settings (#26390)
* Fixed image editor

* decoupled the chnage height and width fns

* final fixes

(cherry picked from commit 1002bcb398)
2025-12-29 17:44:04 +01:00
PaddleStroke e54f09e5e7 PartDesign: Fix upToFace not working with non-ASCII filenames (#26514)
* PartDesign: Fix upToFace not working with non-ASCII filenames

* Update TaskExtrudeParameters.cpp

(cherry picked from commit 20e45231c5)
2025-12-29 17:34:39 +01:00
freecad-gh-actions-translation-bot 737b6e27be Update translations from Crowdin
(cherry picked from commit 7fe10f7436)
2025-12-29 11:33:08 +01:00
Roy-043 c1d394802e BIM: fix transparency of curtain walls in BIMExample.FCStd
Curtain walls in the BIM example file did not have transparent glass panels.

(cherry picked from commit 776b2f2d5a)
2025-12-28 07:54:21 +01:00
Chris Hennes 2cf7cc761a PD: Modify tests to use SideType instead of Midplane
(cherry picked from commit a4bff812d7)
2025-12-27 19:30:13 +01:00
Chris Hennes 4a9f2ff24a PD: For Body get the color from the tip
Mostly affects STEP export.

(cherry picked from commit 51d2c88b02)
2025-12-27 19:30:04 +01:00
Chris Hennes 62181c7e74 Import: Revert recent STEP file object naming work
After discussion in several recent PR review meetings the Maintainer
team has decided to roll back some recent work on object naming in STEP
files. Inadequate automated testing has led to a situation where every
change made to address one bug introduces another someplace else. It
is difficult to determine which, if any, of these fixes represent an
appropriate path forward, versus fixing a symptom rather than the
underlying problem.

---

Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks"
This reverts commit 59715114f5.

Revert "core: fix various issues exporting step files, ie. #25540 #24962 #25567"
This reverts commit e226e9b06e.

Revert "export: step file preserve last feature when exporting step file, fix issue #25567"
This reverts commit 9c48c9a3e3.

Revert "core: preserve body name in step file when exporting part that contains body with feature, fixes #24962"
This reverts commit 246218b28b.

Revert "Import: STEP export preserve body names (#25042)"
This reverts commit f218c5f25c.

Revert "Import: Export tip when body is selected (#24678)"
This reverts commit 6fd6558040.

(cherry picked from commit 7da646754a)
2025-12-27 19:30:04 +01:00
horseDeveloper 90612b05a2 Fixing Leftover references from migration from freecadweb.org (#26163)
(cherry picked from commit 4892154faf)
2025-12-26 18:35:16 +01:00
Chris Hennes a896929f1e Tools: Add Surface to translations
(cherry picked from commit 2fbc36d472)
2025-12-25 21:50:26 +01:00
Krzysztof 39d2151eca Core: Extend completer popup list in 'Expression editor', fix size and position adjustment (#25242)
* Core: Fix completer popup adjustment after 'Tab' pressing
Completer popup in Expression Editor is now positioned and sized after pressing 'Tab'. This was missing when feature was added.

* Core: Extend completer popup list to up 20 elements or up to screen edge
Completer popup will now show up to 20 elements or will be limited to screen edge; if limited < 3 rows, popup will be displayed over cursor.

* Core: Fix completer wrapping on secondary screens

* Core: Fix completer positioning when includes long entries

* Core: Fix linter complaints

(cherry picked from commit 47d1913544)
2025-12-25 09:11:48 +01:00
captain0xff bffe90dce6 Gui: fix linear dragger increments when the multFactor is set
(cherry picked from commit 5cc05a1ab2)
2025-12-25 09:11:29 +01:00
Chris 3901c8f1de sketcher: fix issue #25992 keep snapped position when releasing mosue for updated sketch points (#26102)
* sketcher: fix issue #25992 keep snapped position when releasing mosue for updated sketch points

* Update src/Mod/Sketcher/Gui/ViewProviderSketch.cpp

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
(cherry picked from commit eb61ee36a6)
2025-12-23 22:39:54 -06:00
Roy-043 1ab014c196 Draft: array task panels: add workaround for Building US unit system
Fixes #26276.

(cherry picked from commit 4fe0dff1bc)
2025-12-23 22:24:51 -06:00
Roy-043 05e26f3d03 BIM: fix AttributeError when snapping for window placement
(cherry picked from commit 5297493a65)
2025-12-23 22:24:44 -06:00
Rodrigo Olaya Moreno e99a06f402 Fix RGB rounding bug in material appearance editor (#26134)
* Fix RGB rounding bug in material appearance editor
* Update code to use color
* getColorHash no longer needs range

(cherry picked from commit 345a656125)
2025-12-23 22:02:47 -06:00
timpieces d5ac6a07e6 MacOS: Disable actions while file dialogs are open (#26169)
- Any action part of the application menu will trigger based on shortcut
  when a native file dialog is open
- Another way to fix this is to switch out the application menu, but
  afaict it requires writing native objective-c code. I think that's too
  much complexity just to get cmd+c/cmd+v in these file dialogs
- For now, just disable the actions so that select-all, rotate-left, etc
  don't trigger when pressed in these dialogs
- I've implemented an RAII wrapper to disable this. It should take
  pointers which should be fine because all of these dialog calls are
  blocking (so in principle nothing can change underneath).

I'm quite sure this won't have any adverse effects on other platforms,
but will need help from other developers to test in case.

(cherry picked from commit a2dabd42e0)
2025-12-23 09:23:52 -06:00
Roy-043 c9ca3d01e3 BIM: ifc_tools.py fix handling of IfcGridAxis
Fix errors found after this linter warning:
https://github.com/FreeCAD/FreeCAD/pull/26219/changes#diff-2f58fe8ffd31a6d9302296668f6280d27d696e1507b259cc42fde224ef10da0eL759

(cherry picked from commit d93da36b41)
2025-12-23 09:16:54 -06:00
PaddleStroke f3511baa7e Assembly: Fix deletion of joint references to bodies
(cherry picked from commit d15347d2ad)
2025-12-23 05:48:02 +01:00
timpieces 1c374c68fa MacOS: Block shortcuts from overriding text input (#14869)
- It seems that on MacOS (vs other platforms), shortcuts for items in
  the application menu are given 'ultimate' priority, and will even take
  precedence over text inputs
- There is a mechanism in QT (I believe designed with mac in mind) to
  try to 'block' these shortcuts and send it to the focus instead. It's
  'Shortcut Override': https://wiki.qt.io/ShortcutOverride
- Initially I was going to only apply this check when it's a Command
  that overrides a known line-editing shortcut, but I figure it's
  simpler to just always apply it when editing text. I can't really
  imagine a user wanting to use an application shortcut while editing
  text, but if there's some compelling use-case for this then let me know
  and I'll add a further filter.

I'm quite optimistic that this won't have any ill-effects on other
platforms, but I'll need help from others to test this.

(cherry picked from commit 4567d04547)
2025-12-23 05:47:47 +01:00
wandererfan e3e04387a5 [TD]fix handling of non-standard page sizes
(cherry picked from commit 35d4a849ef)
2025-12-22 20:32:58 +01:00
marbocub 3a405bbf6b Fix rotation expression errors in handleLegacyTangentPlaneOrientation() (#26058)
* Fix rotation expression handling

- Make added rotation angle unit the same as the original expression unit
- Keep rotated angle expressions within the accepted [-180, +180] range

(cherry picked from commit 244282f855)
2025-12-22 19:57:13 +01:00
wandererfan 38dd102f77 [TD]fix tearing of page edges
(cherry picked from commit 04e2d631bb)
2025-12-22 19:30:43 +01:00
Kacper Donat 6fd72e00cd PartDesign: Revolution - add FuseOrder
In older versions of FreeCAD the boolean order was base + result. After
TNP mitigation the order was changed to be result + base. For the
resulting shape that does not matter, but order of edges can differ if
arguments are in a different order.

This can impact refine algorithm which may pick other face as the base
one and result in a differnt shape after refining. This commit restores
previous order. For most files it should not make any difference, but it
may fix some older files.

To support all cases we introduce FuseOrder compatibility property that
will be set to FeatureFirst for files saved with 1.0 to preserve
behavior.

(cherry picked from commit 8c399e1fd0)
2025-12-22 19:30:33 +01:00
Roy-043 ea048829f7 Part: fix Part_EditAttachment unitless input error (#25923)
(cherry picked from commit 3a5f5d70ee)
2025-12-22 18:31:14 +01:00
Florian Foinant-Willig aca2eeb173 fix %r format spec
(cherry picked from commit 7b315e80a7)
2025-12-22 18:24:32 +01:00
Kacper Donat 01c42b34d9 Gui: Ensure that QuantitySpiBox handles expression properly
(cherry picked from commit febfd65e59)
2025-12-22 18:02:49 +01:00
PaddleStroke dbf87623b2 Part: TopoShape make getElementTypeAndIndex more robust (#25913)
* Part: TopoShape make getElementTypeAndIndex more robust
* Part: Add unit tests for new regex

---------

Co-authored-by: Chris Hennes <chennes@gmail.com>
(cherry picked from commit 3608c9f8c4)
2025-12-22 17:59:47 +01:00
Syres916 173734c902 Merge pull request #25809 from Syres916/HotFix_For_Win_and_Wayland_For_First_Run
[Gui] Hotfix for correcting main window position on first run and Safe Mode on Windows and Wayland

(cherry picked from commit 9375f579f0)
2025-12-22 17:59:03 +01:00
Yash Suthar cfe36321d1 UI: Fix select all instances of an object in the tree
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
(cherry picked from commit 60bd277d7a)
2025-12-22 16:48:17 +01:00
chris 4e187e83bf partdesign: pd: fix for issue #25794
(cherry picked from commit 46066e1cca)
2025-12-22 15:47:46 +01:00
Chris 525ce8e056 Part Design: Add sketch sub element names for refs in revolutions (#26227)
* part design: partdesign: pd: fix regression issue #26223 add sketch sub element names for refs in revolutions

* refractor code to remove else blocks as every condition has a return statement, make lsp happy

(cherry picked from commit 452f9b2087)
2025-12-22 15:08:42 +01:00
Alfredo Monclus 1b678a2ec6 PartDesign: fix hole clearance not appearing in the taskpanel when switching type
(cherry picked from commit d9e0fd6251)
2025-12-22 14:59:14 +01:00
Alfredo Monclus 6e08c67a3b PartDesign: fix thread depth not shown in taskpanel
(cherry picked from commit 6729540a78)
2025-12-22 14:59:06 +01:00
Chris Hennes 5ae095a0a8 PD: Fix missing silent mode check in GetTopoShapeVerifiedFace
Also ensure that all calls to this method actually verify the result.

(cherry picked from commit 76bd68e672)
2025-12-22 14:36:58 +01:00
Kacper Donat d21f01ce3b Gui: Remove shortcuts for overlay toggles
Using these commands by mistake can result in broken interface and the
shortcuts are way too easy to hit by mistake. The feature is rarely (if
at all) used - so there is no need to have easy to hit shortcuts.

(cherry picked from commit 78a6891dae)
2025-12-22 13:22:05 +01:00
Kacper Donat dde6efaa2d PartDesign: Chamfer - migrate Size and Size2 for older files (#26137)
* PartDesign: Chamfer - migrate Size and Size2 for older files

* Apply suggestions from code review

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
(cherry picked from commit 4d712f44c2)
2025-12-22 12:56:03 +01:00
freecad-gh-actions-translation-bot d495562e56 Update translations from Crowdin
(cherry picked from commit 8b7ec488f0)
2025-12-22 12:41:35 +01:00
Louis Gombert bd6dbbcf00 Part: clean mesh before adding triangulation in setupCoinGeometry
Calling BRepMesh_IncrementalMesh repeatedly would accumulate BRep_CurveRepresentation instances attached to the BRep_TEdges of the shape. We now clean added triangulations before adding a new one, which improves performance in the long run.

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
(cherry picked from commit 3601161d80)
2025-12-22 12:07:41 +01:00
Roy-043 b67b74181c BIM: fix deletion of BuildingPart in strict IFC mode (#26219)
* BIM: fix deletion of BuildingPart in strict IFC mode

Add `sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()` to `onDelete`.

* BIM: fix deletion of BuildingPart in strict IFC mode

Explicitly call `obj.ViewObject.Proxy.attach(obj.ViewObject)`.

* BIM: fix deletion of BuildingPart in strict IFC mode

In `ifc_vp_buildingpart` call `attach` from `ArchBuildingPart.ViewProviderBuildingPart`.

(cherry picked from commit 0af22943b2)
2025-12-21 22:15:58 -06:00
Chris 0c48516c57 Sketcher: Allow live preview of sketch placement (#26033)
along with unit tests

(cherry picked from commit 4cd81136b6)
2025-12-21 18:28:35 +01:00
Furgo ec3775291a BIM: Initialize SketchArch variable before use (#26336)
(cherry picked from commit 0193b1776d)
2025-12-21 10:42:31 +01:00
Furgo 3b83c90c3b BIM: fix lock removal of Sill property
(cherry picked from commit 69de78e22d)
2025-12-21 10:29:22 +01:00
Furgo 749f6cbc53 BIM: rename ArchWindow's Sill property to SillHeight and handle one-w… (#26277)
* BIM: rename ArchWindow's Sill property to SillHeight and handle one-way migration

* BIM: properly remove the locked "Sill" property

(cherry picked from commit bdea3d105f)
2025-12-21 08:48:53 +01:00
Louis Gombert 9e58942004 SVG export: improve performance (#26149)
* SVG export: use a set to match edges instead of a list

Lookup in edge list becomes O(1), significantly improving SVG export speed

* [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>
(cherry picked from commit cead907a57)
2025-12-21 08:48:38 +01:00
Chris Hennes 6c1bd0f21b Addon Manager: Update to 2025.12.19
Minor bug fixes and translation update.

(cherry picked from commit c423e8de08)
2025-12-20 06:58:52 +01:00
Christoph Moench-Tegeder 7310a88866 Include sys/sysctl.h on FreeBSD when using sysctl()
The ApplicationDirectories::findHomePath() on BSD uses sysctl()
to find the path to the running executable. On FreeBSD, we need
to include sys/sysctl.h for that - and as it is not included anywhere
else, add it to the includes directly in front of this function,
with a suitable ifdef.

(cherry picked from commit 4f4f4425aa)
2025-12-20 06:58:29 +01:00
Roy-043 d4f4691f1f Part: fix Part_EditAttachment nesting handling (#26298)
* Part: fix Part_EditAttachment nesting handling

Fixes #26264.

The previous 'fix' (#25887) did not consider that the object to-be-attached may not be in the global space.

The code in this PR has been tested on the forum:
https://forum.freecad.org/viewtopic.php?p=862968#p862968

* [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>
(cherry picked from commit 348eef644b)
2025-12-20 06:58:14 +01:00
VM4Dim 3b1bc25870 Gui: Fix non-Latin groupName (#26285)
(cherry picked from commit 7cd88534b5)
2025-12-20 06:57:21 +01:00
Kacper Donat 254ee35bc2 Gui: Wrap strings with QStringLiteral
(cherry picked from commit 87b257546f)
2025-12-20 00:20:36 +01:00
PaddleStroke 4e74fe97ed Core: move getPlacementProperty to be more accessible (#26088)
* Core: move getPlacementProperty to be more accessible

* Update DocumentObject.h

* Update DocumentObject.cpp

* Update ViewProviderDragger.h

* Update ViewProviderDragger.cpp

* Update DocumentObject.h

* Update DocumentObject.cpp

* Update ViewProviderLink.cpp

* Update DocumentObject.h

* Update DocumentObject.cpp

* Update DocumentObject.h

(cherry picked from commit 893a9d19b6)
2025-12-19 13:55:31 +01:00
Yash Suthar 456534cce6 Part: added floating point fallback in PropertyLinks::_updateElementReference
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
(cherry picked from commit dbd2bade1e)
2025-12-19 11:32:58 +01:00
chris e1201b35a1 sketcher: fixes issue #26167 no polygon distort when repositioning / constraining
(cherry picked from commit 22552848fd)
2025-12-19 11:32:43 +01:00
Kacper Donat c7489597bc Stylesheets: Fix separators appearance
(cherry picked from commit b5d60baa68)
2025-12-18 19:50:24 +01:00
PaddleStroke 76b1cb43cc Measure: getPlacement const (#26216)
* Measure: getPlacement const

* Update MeasureBase.h

* Update MeasureBase.cpp

* Update MeasureArea.h

* Update MeasureArea.cpp

* Update MeasureLength.h

* Update MeasurePosition.cpp

* Update MeasureLength.cpp

* Update MeasureRadius.cpp

* Update MeasurePosition.cpp

* Update MeasurePosition.h

* Update MeasureRadius.h

* Update MeasurePosition.h

(cherry picked from commit 0c1ef0c77f)
2025-12-18 15:46:57 +01:00
Chris Hennes 11d8e6a411 PartDesign: Compiler warning cleanup
(cherry picked from commit 0ba75a7573)
2025-12-18 10:40:24 +01:00
Chris Hennes d172914c5d TechDraw: Compiler warning cleanup
(cherry picked from commit c7c4c6f0cc)
2025-12-18 10:40:24 +01:00
Chris Hennes b33cadca1b Sketcher: Compiler warning cleanup
(cherry picked from commit 50f029edd4)
2025-12-18 10:40:24 +01:00
Chris Hennes 165e58a7b9 Measure: Compiler warning cleanup
(cherry picked from commit 36332bf9ca)
2025-12-18 10:40:24 +01:00
Chris Hennes fb807c5a62 Assembly: Compiler warning cleanup
(cherry picked from commit 04a9c1e7b0)
2025-12-18 10:40:24 +01:00
Chris Hennes 1a537852ae Gui: Compiler warning cleanup
(cherry picked from commit 0416a5bc0b)
2025-12-18 10:40:24 +01:00
Chris Hennes 0b370963e1 App: Compiler warning cleanup
(cherry picked from commit 55a55725eb)
2025-12-18 10:40:24 +01:00
freecad-gh-actions-translation-bot 3bf2c5a019 Update translations from Crowdin
(cherry picked from commit 6c6cff7322)
2025-12-18 05:49:49 +01:00
PaddleStroke 014851827c Assembly: Ball drag mode. (#26222)
(cherry picked from commit 8fd81d4109)
2025-12-16 21:00:04 +01:00
Saksham Malhotra 143e16bd44 PartDesign: move AllowCompound to Base property group (#26180)
(cherry picked from commit b7735044c4)
2025-12-16 07:46:13 +01:00
Chris Hennes 6b7262bba9 PD: Don't warn about Midplane on document load
(cherry picked from commit 3208b6de5f)
2025-12-16 05:52:44 +01:00
Chris Hennes ef5b86afa4 Gui: Correct UTF-8 support for property names
(cherry picked from commit 10ed34bd4c)
2025-12-16 05:52:24 +01:00
Roy-043 10680272e1 BIM: ArchReference: fix coin node handling
Fixes #25772.

(cherry picked from commit 2efd63614f)
2025-12-16 05:52:07 +01:00
Roy-043 17086d6ff2 BIM: ArchReference: handle transparency-alpha switch
The 'old' DiffuseColor comes in 2 flavors. In v0.21.2 it stores transparency values. In v1.0.2 and v1.1 it stores alpha values. The ArchReference code should handle both. DiffuseColor is still used by BuildingParts in v1.0.2 and v1.1.

The solution is a bit hacky: if 100% transparency occurs we assume we are actually dealing with alpha values.

(cherry picked from commit 1c8df498f3)
2025-12-15 21:23:25 +01:00
Chris Hennes d03d8589f3 PD: Correct is-datum-in-body check
(cherry picked from commit 5ba7f207ab)
2025-12-15 21:23:10 +01:00
Roy-043 0e490cae46 BIM: use optimalBoundingBox in getCutVolume
(cherry picked from commit 15bb0ee896)
2025-12-15 21:23:02 +01:00
drwho495 4559d078e4 Implement Fix
Switch from checking child tag to checking the materTag

(cherry picked from commit 88b5cde45f)
2025-12-15 20:42:10 +01:00
Roy-043 7c7cb1a783 Draft: make Draft_AnnotationStyleEditor dialog wider
Increase AnnotationStyleEditorWidth from 450 to 600 to mitigate #25983.

(cherry picked from commit e6e285315c)
2025-12-15 19:01:09 +01:00
Kacper Donat 5c8ba72158 Gui: Improve transform UI responsivness
This introduces much faster CenterOfMassProvider#supports method that
can be used as cheap pre-check to see if the object supplied could have
the center of mass and so delay the domputation to a moment where it is
actually needed.

(cherry picked from commit fc93004c89)
2025-12-15 17:40:12 +01:00
theo-vt 16bead131a Sketcher: Do not autoscale if there are blocked geometries
(cherry picked from commit 29eeab3624)
2025-12-15 17:40:00 +01:00
Ajinkya Dahale 3283b6e4e4 Sketcher: Only transfer angle to relevant segment on trim etc.
(cherry picked from commit 0800791a0f)
2025-12-15 17:39:50 +01:00
Ajinkya Dahale cf67fed6bc Sketcher: Handle angle constraint on sketchobject changes
Primarily trim, but also expected to affect split, extend etc.

(cherry picked from commit 78e5729520)
2025-12-15 17:39:50 +01:00
Kacper Donat 39c9bb67ef Gui: Respect both content size and minimum width for buttons
This is a hacky fix for https://github.com/FreeCAD/FreeCAD/issues/23607

Basically after widget is shown or polished we enforce it's minimum size to at
least cover the minimum size hint - something that QSS ignores if min-width is
specified.

(cherry picked from commit aefd2592a8)
2025-12-15 17:39:41 +01:00
chris b59533a94d fem: attempt to resolve issue #19798
(cherry picked from commit 3476562dd7)
2025-12-14 19:17:18 +01:00
Yash Suthar f16e9f69e5 Core: fix "Save Image" giving dark area as compare to viewport
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
(cherry picked from commit 8413922e52)
2025-12-14 14:51:01 +01:00
xtemp09 1387e274f2 [GUI] Rename Cancel ‘Close’ in Add Property dialog
(cherry picked from commit df6d148a85)
2025-12-13 15:20:31 +01:00
PaddleStroke 3090218976 Assembly: joint task: fix delete impossible of non-valid refs
(cherry picked from commit 9625a71d8d)
2025-12-12 11:11:10 +01:00
Roy-043 82f04f6303 Draft: fix lag when snapping to face intersections
Fixes #25924.

The `snapToIntersection` function has been changed to an if-elif structure, and in case of face-edge intersection snap, only two sublements are checked. This ensures a reasonable speed, even if objects have many edges and faces. The change does mean you have to move the mouse over the correct face for it to be processed. But since face-edge intersection snap is new anyway, this is acceptable I think.

(cherry picked from commit 4b379c8e51)
2025-12-12 11:11:00 +01:00
Roy-043 56fab21375 Remove maxSnapFaces parameter from params.py
Removed 'maxSnapFaces' parameter from settings.

(cherry picked from commit e1d77cc771)
2025-12-12 11:11:00 +01:00
Alfredo Monclus 83b96c6c36 PardDesign: fix hole task thread combos not translating
(cherry picked from commit f92c8e126c)
2025-12-12 11:10:47 +01:00
Kacper Donat 29de8ace0e PartDesign: Recompute preview after forced recompute
This fixes some cases where Preview was stale and not recomputed after
changes done via code.

(cherry picked from commit c10f5d74d3)
2025-12-12 11:10:38 +01:00
PaddleStroke 3243f85145 Core: Add getPlacementOf replacing previous getGlobalPlacement logic. (#26059)
* Core: Add getPlacementOf replacing previous getGlobalPlacement logic.

* Update src/App/DocumentObject.cpp

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

* Update DocumentObject.cpp

* Fix error when called from python with targetObj == None

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
(cherry picked from commit 7a8135d863)
2025-12-11 14:46:48 +01:00
Kacper Donat 282768a5c8 Stylesheets: Fix toolbar button size change
(cherry picked from commit c12ca7b3ba)
2025-12-10 20:47:25 +01:00
Yash Suthar ac8ed20250 Link: Fixed Scale property behaviour when the object is moved
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
(cherry picked from commit aed9b770f3)
2025-12-10 20:35:42 +01:00
Chris Hennes 8b257d701f PD: Add deprecation warning if Midplane is set
(cherry picked from commit 67948d60a2)
2025-12-10 19:46:26 +01:00
freecad-gh-actions-translation-bot 1f642f553b Update translations from Crowdin
(cherry picked from commit f7483a08b4)
2025-12-08 22:43:31 -06:00
wandererfan bfda3e194f [TD]guard against font size zero
(cherry picked from commit 475d46c3d0)
2025-12-09 05:25:53 +01:00
wandererfan f216df1126 [TD]convert transparency to alpha channel
(cherry picked from commit e2c5c643d8)
2025-12-09 05:25:53 +01:00
wandererfan 2e5a190149 [TD]add preference re alpha/transparency conversion
(cherry picked from commit 64f2c5388b)
2025-12-09 05:25:53 +01:00
wandererfan e83131ec20 [TD]fix CI fail on Win
(cherry picked from commit b1cbcbd238)
2025-12-08 19:42:53 +01:00
wandererfan 83a821c68e [TD]fix CosmeticVertex fail in script
(cherry picked from commit 3f10abe11b)
2025-12-08 19:42:53 +01:00
tetektoza 9b1e26cd87 Gui: Fix preferences search popup positioning on Wayland (#25675)
* Gui: Fix preferences search popup positioning on Wayland

Change window flag from `Qt::Tool` to `Qt::ToolTip` to fix popup
appearing in center of screen and closing immediately on Wayland desktop
envs. `Qt::ToolTip` uses xdg_popup protocol which provides proper
positioning relative to parent window on Wayland.

* Gui: Initialize ok check flag to default in prefs

* Gui: Use ranged for loop where possible in prefs

* Gui: Remove unused variable in preferences controller

* Gui: Use const where possible in prefs search dialog

* Gui: Use static where possible in search prefs dialog

* Gui: Use braced initializer list when returning type in search prefs

* Gui: Use auto in search prefs dialog where possible

* Gui: Do not use else if after return in search prefs dialog

* [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>
(cherry picked from commit 915b6f9901)
2025-12-07 14:30:01 +01:00
Ladislav Michl 7062b0511e Revert "[Base]retrieve unit text"
This reverts both pointless and broken commit c9fffa6789.

(cherry picked from commit 90086d3e31)
2025-12-06 11:03:24 +01:00
Ladislav Michl 9a70a2838a TechDraw: Refactor use of Unit Schema values
Quantity's getUserString already returns both factor and unitText.

(cherry picked from commit 3252aaf618)
2025-12-06 11:03:24 +01:00
Ladislav Michl e48a90dbde TechDraw: Fix MultiValueSchema formatting
Multi Value schemas cannot be forced to use Format::FORMATTED.

(cherry picked from commit a509bc2ee9)
2025-12-06 11:03:24 +01:00
Adrian Insaurralde Avalos 234ddb951a Plot: protect matplotlib.pyplot import form PyQt6 too and remove lingering debug print
(cherry picked from commit fbb65a34fe)
2025-12-05 10:18:13 -06:00
PaddleStroke 685b90c38a Sketcher: Fix errors message when selecting circle seam point. (#25953)
(cherry picked from commit a49d106807)
2025-12-05 08:59:59 +01:00
Sebastian 1df4fe0ffd Match the string that gets sent to setCommand (#25964)
* Match the string that gets sent to setCommand

Correction of a not matching string that gets sent to setCommand. This results in a not translated menu item in the Sketcher menu.

* [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>
(cherry picked from commit 945ba15e18)
2025-12-05 08:59:51 +01:00
PaddleStroke 528a1f5c6e Sketcher: Offset: Fix failure if 2+ closed wires with different orientations (#25941)
(cherry picked from commit 67234e98b7)
2025-12-05 06:37:10 +01:00
marioalexis 1b90efd21b Fem: Fix undefined variable
(cherry picked from commit 9d5f6c82be)
2025-12-05 06:36:54 +01:00
PaddleStroke 0308a1b849 Sketcher: dimension tool, use VPSketch version of addSelection
(cherry picked from commit 0c34c93fe4)
2025-12-04 05:37:59 +01:00
PaddleStroke c6de3d88be Sketcher: Make VPSketch::addSelection public
(cherry picked from commit 1784be046f)
2025-12-04 05:37:59 +01:00
Adrian Insaurralde Avalos 9e59e48e80 WindowsInstaller: more robust automatic version info from freecadcmd
otherwise it broke if freecad had other unrelated output

(cherry picked from commit af48da0dbf)
2025-12-04 00:14:31 -03:00
PaddleStroke 7a161b2f9e Part: revert changes to ViewProviderExt::getDetails (#25912)
(cherry picked from commit 5f70c4390d)
2025-12-03 19:17:42 +01:00
Billy Huddleston 5e506d0b18 CAM: Fix job assignment and model/stock initialization in ObjectOp
This PR fixes a bug introduced with PR #25800
It updates the ObjectOp class to correctly assign the job, model,
and stock properties from the parentJob object. Previously, only
PathUtils.addToJob was called, which did not set these attributes directly.

This change ensures that when creating a new operation, the job, model,
and stock fields are properly initialized from the parent job. This
fixes issues where operations did not inherit the correct job context,
leading to missing or incorrect references to the model and stock, and
potential errors in downstream processing.

(cherry picked from commit ab817f8dc5)
2025-12-03 19:07:01 +01:00
Roy-043 448613f3c4 Part: make Part_EditAttachment nesting aware (#25887)
(cherry picked from commit 4f4db09572)
2025-12-03 08:22:07 +01:00
PaddleStroke 76a23ec105 GUI: Fix broken build - splitbutton (#25892)
(cherry picked from commit 7c2dac1278)
2025-12-02 20:31:40 -06:00
PaddleStroke 92165ac37d Assembly CommandInsertNewPart : Make sure assembly file is saved (#25730)
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
(cherry picked from commit ac0685b841)
2025-12-02 06:19:18 +01:00
Frank Martinez 3922a674da Build: Fix some trivial warnings
(cherry picked from commit c057d0293a)
2025-12-02 05:06:58 +01:00
PaddleStroke 3dc4f11b2b Sketcher: fix new external always construction (#25733)
(cherry picked from commit 6ddb0165ff)
2025-12-01 22:06:49 -06:00
Roy-043 81956de275 Draft: fix X-axis reference for Draft_Arc_3Points
(cherry picked from commit 4eb110e861)
2025-12-02 05:06:35 +01:00
PaddleStroke 5763b1df60 Assembly: Fix selection during joint edition (#25687)
(cherry picked from commit b603630d1f)
2025-12-02 05:06:18 +01:00
Garfieldcmix 41a30467a5 Fix Export/Save Mesh incorrect error message
(cherry picked from commit 3aedb58e4b)
2025-12-02 05:06:03 +01:00
sliptonic b2e8b5c3e2 CAM: fixes bug with op creation/cancelation (#25800)
(cherry picked from commit db65e44bca)
2025-12-02 05:05:41 +01:00
Roy-043 b893924cbe BIM: BIM_Material: only assign material object to component (#25823)
* Add MoveWithHost check for material assignment

* [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>
(cherry picked from commit 5e90dc86fb)
2025-12-02 05:05:25 +01:00
Chris Hennes 3e8e2faf62 Utils: Don't save location of Python executable
(cherry picked from commit f366b0e2a7)
2025-12-01 20:54:15 -06:00
Syres916 feca3a8436 [TechDraw] QCheckBox fix compiling warning of stateChanged deprecation
(cherry picked from commit cb9c0ccd7f)
2025-12-01 15:03:57 -06:00
Roy-043 84a2662171 BIM: add parameter for BIM_Sketch view props (#25778)
* Add BIM parameters to param_dict

Add BIM parameters to param_dict for future use.

* BIM: add parameter for BIMSketch view props

(cherry picked from commit 41c0621abb)
2025-12-01 21:15:30 +01:00
Roy-043 afbce0a6a2 BIM: fix Arch_Reference update on doc restored (#25777)
* BIM: fix Arch_Reference update on doc restored

Fixes: #24943

* [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>
(cherry picked from commit 5155906848)
2025-12-01 19:22:59 +01:00
tetektoza b77c5da78b Sketcher: Use constraint index instead of geoId as key in expr storage
`SketcherTransformationExpressionHelper` was using `geoId` as the map
key for storing expressions during geometry transformations. This is
incorrect since single geometry may have multiple constraints with
different expressions.

So, using `geoId` as the key causes `std::map` overwrites, resulting in
only the last expression being preserved per geometry.

So this patch changes key to be a constraint index, and adds
`ConstraintExpressionInfo` struct to store both expression and `geoId`.

Co-authored-by: PaddleStroke <pierrelouis.boyer@gmail.com>
(cherry picked from commit 5f4fe75f5f)
2025-12-01 19:22:48 +01:00
Billy Huddleston de7c105a1a CAM: Turn off debugging in CAM Preferences
Debugging was left on by mistake. Also 'Setting asset path' log message was at info level. Changed to debug level.

(cherry picked from commit 708717cee2)
2025-12-01 19:22:39 +01:00
Kacper Donat 6aa7f99e1e Gui: Use SplitButton for config migration modal
(cherry picked from commit 0de9ffc439)
2025-12-01 19:22:30 +01:00
Kacper Donat 522c2b116b Gui: Add SplitButton widget
This adds SplitButton widget that has one primary action and possibly
more secondary ones accessible via menu.

(cherry picked from commit c500408a6d)
2025-12-01 19:22:30 +01:00
Roy-043 e1128e3491 Convert asset path to string in filePath function
(cherry picked from commit 6a65b45242)
2025-12-01 19:22:21 +01:00
marbocub 9fcef20600 Sketcher: Fix error when first constraint is DistanceX/DistanceY to vertex (#25813)
(cherry picked from commit 8ea5075385)
2025-12-01 18:45:45 +01:00
Syres916 f72e3439af [TechDraw] Fixes for TaskFillTemplateFields finding Draft/Arch/Image views and keeping message boxes and dialogs on top (#25342)
* [TechDraw] fix dialog to be ontop, clear the keyLst and save mouse movement between messagebox and dialog

* [TechDraw] change from setWindowFlags to setWindowFlag

* [TechDraw] handle BIM and Draft as first available views...

.... also increase the possible scale values such as 5 : 2 or 7 : 3

* [TechDraw] fix 1:1 scale regression

* [TechDraw] remove unnecessary line of code

* TD: Simplify code

Address comments from review.

Co-authored-by: WandererFan <wandererfan@gmail.com>

* [TechDraw] enable use of Fraction for scale...

... conversion

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: WandererFan <wandererfan@gmail.com>
(cherry picked from commit 15c99ecdb2)
2025-12-01 18:03:48 +01:00
Syres916 135bd360f0 [Gui] Fix AxisLetterColor on opening Preferences and correct LightSources parameter group
Also remove workaround as stated in the comments just before 1.1.0 Release.

(cherry picked from commit 2be7bbf141)
2025-12-01 18:01:53 +01:00
Roy-043 2b5213863b BIM: Fix duplicate vertices in Wavefront OBJ export
Fixes: #13151.

The vertices derived from a face's outerwire could contain duplicates.

Fixed by switching to:
`f.OuterWire.OrderedVertexes`

(cherry picked from commit b865c4625d)
2025-12-01 17:54:29 +01:00
PaddleStroke 12438b1999 Part: Fix addSelection failing for links to body. (#25702)
(cherry picked from commit 6d48c51f4d)
2025-12-01 16:35:17 +01:00
PaddleStroke 7f785d64cb Core: Close partially opened document when doc is closed. (#25659)
(cherry picked from commit b249b9daeb)
2025-12-01 06:41:28 +01:00
Captain cdd6a0a719 PartDesign: fix symmetric mode of draggers in revolution/groove (#25656)
(cherry picked from commit a371231aea)
2025-11-30 23:11:37 -06:00
Chris Hennes b6f5216b70 Revert "GUI: fix "select all instances" (#25503)"
This reverts commit 70645e2f46.
2025-11-29 08:13:06 +01:00
Max Wilfinger 09127570d3 GUI: Update about image to 1.1 2025-11-28 17:28:39 +01:00
PaddleStroke 898c45cb95 Datums: Prevent 'doesn't contain feature with role' error on load
(cherry picked from commit 79f66b75f3)
2025-11-28 13:05:38 +01:00
Chris Hennes 9483062cbd Build: Fix punctuation in Windows installer (English only)
(cherry picked from commit 4e74031e06)
2025-11-28 06:49:54 +01:00
PaddleStroke d8f3bedbd9 TechDraw: DrawViewSpreadsheet do not create cyclic dependency
(cherry picked from commit eaee0f759a)
2025-11-28 06:38:10 +01:00
PaddleStroke 9c5a6ff782 PartDesign: Polar pattern: Accept negative angles (#25621)
(cherry picked from commit 5ae67ee2f9)
2025-11-27 18:13:55 -06:00
PaddleStroke 9ee1295842 Assembly: Enable negative distance for rackpinion and screw
(cherry picked from commit da717d4ca0)
2025-11-27 05:57:25 +01:00
PaddleStroke c5c336927d Assembly: CommandInsertLink: handle manual deletions (#25651)
(cherry picked from commit cf40007bd0)
2025-11-26 16:59:22 -06:00
Pieter Hijma 683fc7986c Gui: Fix refresh on boolean property toggle
(cherry picked from commit 63f739b2e4)
2025-11-26 15:41:05 -06:00
Chris Hennes 7b37c5612b Merge pull request #25709 from FreeCAD/backport-25580-to-releases/FreeCAD-1-1
[Backport releases/FreeCAD-1-1] PartDesign: Fix boolean positioning
2025-11-26 14:41:49 -06:00
Kacper Donat c7e3fbe738 PartDesign: Bake in geometry transform after boolean
This bakes in transform into geometry after boolean to ensure that
regardless of parameters the result of boolean operation is the same.

(cherry picked from commit 527b2de560)
2025-11-26 20:38:27 +00:00
Kacper Donat 386e375e1d Part: Add bakeInTransform method for TopoShape
This method can be used to bake in transform directly into geometry.
Normally the setTransform or setPlacement methods only store additional
positional data within the shape without changing the actual geometry.
So if we have some geometry placed at 0,0,0 and we want to have few
copies of that shape the goemetry stays intact but additional transform
is stored. This method can be used to alter the gometry and reset the
transform to identity. It helps with model stability, as not every
method correctly handles that additional transform metadata.

(cherry picked from commit 4cbf10f045)
2025-11-26 20:38:27 +00:00
Kacper Donat b526751f97 PartDesign: Simplify FeatureBoolean
This commit removes a ton of dead code from FeatureBoolean. It might
been ported here from the Link branch but it is not used and it is
confusing. The reason for having that code here is also not really
obvious so there is no reason to keep it.

(cherry picked from commit 1555f65075)
2025-11-26 20:38:27 +00:00
Chris 70645e2f46 GUI: fix "select all instances" (#25503)
(cherry picked from commit 6b60867368)
2025-11-26 14:21:19 -06:00
PaddleStroke 5ea6fa8eb9 Gui: Do not lose thumbnail when saving partially loaded doc (#25458)
(cherry picked from commit 46a847c857)
2025-11-26 14:00:58 -06:00
Eugene Zhukov 2d77ea2221 Change params variable to uppercase PARAMS (#25663)
Addresses #25565

(cherry picked from commit e270d63e5c)
2025-11-26 16:32:36 +01:00
Chris 56d6bbe4b6 PartDesign: Use c++ exception to prevent crash (#25671)
* part design: fix issue #25639 use c++ exception to prevent crash

* [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>
(cherry picked from commit 5382ca4bbb)
2025-11-26 16:32:06 +01:00
github-actions 2596ab8bcb Update translations from Crowdin
(cherry picked from commit 68cb0a3270)
2025-11-25 22:19:40 -06:00
Chris Hennes 53767601ea Measure: Translate measurement types 2025-11-25 14:53:08 -03:00
Frank Martinez 08dabacfed Build: Remove deprecated pylint option
(cherry picked from commit 863d77562d)
2025-11-25 13:56:58 -03:00
Frank Martinez 9b934a45db Build: Update pylint minimum python version to 3.10
(cherry picked from commit 2ef70f6094)
2025-11-25 13:56:58 -03:00
Louis Gombert a0a8d7760b CMake: fix parsing error in Sandbox/Gui
Introduced by commit 755229d

(cherry picked from commit 0fca304912)
2025-11-25 14:49:51 +01:00
paul 4962bbbffe [ArchWall] Fix Bug: Center-Align with Centered Multi-Material (#25572)
* [ArchWall] Fix Bug: Center-Align with Centered Multi-Material

Fix #25485

* [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>
(cherry picked from commit bcc30869b7)
2025-11-25 08:42:38 +01:00
Bas Ruigrok 7c6d70ab02 Gui: Simplify QObject::connect in openPopupMenu
Co-authored-by: xtemp09 <9303235+xtemp09@users.noreply.github.com>
(cherry picked from commit 6e5a318ceb)
2025-11-25 08:42:30 +01:00
Bas Ruigrok 30e94d0b3f Gui: Fix Gesture style context menu segfault
(cherry picked from commit dec0ea238a)
2025-11-25 08:42:30 +01:00
PaddleStroke 70c69bbebc Assembly: Bom: replace QtWidget by QtGui for Qt6
(cherry picked from commit 59f672eb94)
2025-11-25 08:42:18 +01:00
PaddleStroke 1cd0927a07 Assembly: Joint task: fix spinbox not being populated
(cherry picked from commit 629eff4a26)
2025-11-25 06:04:24 +01:00
Billy Huddleston e5b5fb38a4 CAM: Make CAM tests and serialization robust to locale-dependent decimal separators
Updated CAM unit tests and LinuxCNC serializer to handle decimal separators consistently, ensuring tests pass regardless of system locale. Assertions now compare FreeCAD.Units.Quantity objects directly or normalize decimal separators in strings. LinuxCNC serializer output is forced to use periods for decimals.

src/Mod/CAM/CAMTests/TestPathToolBitListWidget.py:
- Normalize decimal separators in tool description assertions for locale robustness.

src/Mod/CAM/CAMTests/TestPathToolBitPropertyEditorWidget.py:
- Use FreeCAD.Units.Quantity for direct quantity comparisons in property editor tests.

src/Mod/CAM/CAMTests/TestPathToolBitSerializer.py:
- Compare deserialized and serialized quantities using FreeCAD.Units.Quantity for consistency.

src/Mod/CAM/CAMTests/TestPathToolShapeClasses.py:
- Compare parameter values and units directly instead of relying on string formatting.

src/Mod/CAM/Path/Tool/library/serializers/linuxcnc.py:
- Force period as decimal separator in LinuxCNC serializer output to avoid locale issues.

(cherry picked from commit 9cab1f8f52)
2025-11-25 06:03:46 +01:00
FEA-eng e55305fb25 FEM: add new cyclic symm centrif example
(cherry picked from commit d2f082c7bc)
2025-11-25 06:03:29 +01:00
Furgo be96c07587 Assembly: Prevent zero-length line creation in ExplodedView
Safeguards the generation of explosion trail lines to avoid creating
invalid geometry.

Previously, if a part displacement was zero (or effectively zero),
`Part.LineSegment` would attempt to create a line with identical start
and end points, causing OpenCascade to throw a `Part.OCCError`. This
resulted in failures during document restoration and recomputes.

This commit introduces a `_createSafeLine` helper method that checks the
distance against a `1e-7` (near-zero) tolerance before attempting to
generate the shape.

(cherry picked from commit 2763bb962f)
2025-11-24 23:08:54 -03:00
Furgo b5dee9832f App: Handle uncleared Python exceptions during object restoration
When a Python-based object throws an exception during the restoration
process (e.g. inside `onDocumentRestored`), the error is caught by a
generic `catch(...)` block in `Document::afterRestore`.

Previously, this block swallowed the C++ exception wrapper but failed to
clear the underlying Python error state. Leaving the interpreter in this
"dirty" state caused a segmentation fault or `SystemError` later in the
loading process when C++ attempted to interact with the Python API
(specifically in `App::Application::setActiveDocument`).

This commit adds a check for `PyErr_Occurred()` inside the catch block.
If an error is detected, the traceback is printed to the console for
debugging, and `PyErr_Clear()` is called to reset the interpreter state,
allowing the application to continue loading the document without
crashing.

(cherry picked from commit b571889ab5)
2025-11-24 23:08:54 -03:00
PaddleStroke 69f6f9e4b0 Assembly: Joint task: Fix sel gate not being cleared if doc closed
(cherry picked from commit 8b1dce3437)
2025-11-24 23:06:43 -03:00
Chris Hennes 9c24507531 Gui: Switch to defusedxml for document recovery
(cherry picked from commit 4536a54f8f)
2025-11-24 22:45:07 -03:00
Adrian Insaurralde Avalos ada3b7c97e CI: improve release workflow
adapt weekly build workflow to do normal releases too, rename accordingly
skip macos singning setup if certificate not available (useful to run on forks)
add missing dmgbuild dependency for badge icons on macos
build windows installer in workflow, add needed dependencies to pixi.toml
reorganize packaging scripts that can be useful outside rattler-build too
do some cleanup
add .gitignore to rattler-build
Properly configure appimage updating depending on release type and upload zsync file

(cherry picked from commit 46f3cf2f19)
2025-11-24 21:32:52 +01:00
Adrián Insaurralde Avalos bc5b7d66c1 WindowsInstaller: multiple improvements and fixes
move windowsinstaller to /package
update artwork
adapt to conda builds
make msvc redist directory optional
automate version information definition
use relative directories for file locations definitions
improve/update readme
partially update Delete.bat for qt6 libpack
add .gitignore
update signing.bat and add hashing command

WindowsInstaller: use --safe-mode in freecadcmd commands [skip ci]

WindowsInstaller: make windows 8 the minimum version [skip ci]

WindowsInstaller: allow configuring some values via command line

windows installer update for qt6 build

(cherry picked from commit d466ba037b)
2025-11-24 21:32:52 +01:00
Adrian Insaurralde Avalos 9931e01be7 CI: specify environment for fedora-daily workflow
otherwise it doesn't have access to the secrets it needs

(cherry picked from commit a847a794c4)
2025-11-24 21:32:52 +01:00
pre-commit-ci[bot] 7176a5c3bb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci

(cherry picked from commit 59715114f5)
2025-11-24 19:19:09 +01:00
chris ac39784aac core: fix various issues exporting step files, ie. #25540 #24962 #25567
(cherry picked from commit e226e9b06e)
2025-11-24 19:19:09 +01:00
chris da432a77af export: step file preserve last feature when exporting step file, fix issue #25567
(cherry picked from commit 9c48c9a3e3)
2025-11-24 19:19:09 +01:00
chris e6e0d03034 core: preserve body name in step file when exporting part that contains body with feature, fixes #24962
(cherry picked from commit 246218b28b)
2025-11-24 19:19:09 +01:00
PaddleStroke c5387aba66 Sketcher: External Face: decide between defining and construction (#25390)
(cherry picked from commit 74aafcee75)
2025-11-24 19:18:59 +01:00
Syres916 1d739f9773 [Gui] Reduce separator from 2px to 1px
(cherry picked from commit fc6a39658a)
2025-11-24 19:18:46 +01:00
Syres916 7c0c421401 [Gui] increase contrast of menu separators and down arrows in comboboxes
(cherry picked from commit cda9a107aa)
2025-11-24 19:18:46 +01:00
Kacper Donat 45c5b33db5 PartDesign: Use true tool positions for boolean preview
This fixes positioning of some previews for booleans that were misplaced
after #24750 was merged. It restores previous code that was correct for
most cases. The reason for some previews being misaligned is described
in the #25578 - the preview actually shows how the result should be but
due to some shortcuts taken in code the result is incorrect.

(cherry picked from commit 88543612e4)
2025-11-24 19:18:40 +01:00
tarman3 501f29a247 CAM: Engrave - Fix #22380 - duplicates 2025-11-24 18:37:13 +01:00
chris 57a1ac5812 part design: reimp feature to move datum objects using modal / dialogue box from right click menu in model tab
(cherry picked from commit 0fc96a1a6f)
2025-11-24 18:37:07 +01:00
marioalexis 680ccc0ecf Fem: Improve VTK import/export preference page
(cherry picked from commit 2457715d84)
2025-11-24 18:26:53 +01:00
pre-commit-ci[bot] 7a7cba5587 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci

(cherry picked from commit ada21269aa)
2025-11-24 18:26:53 +01:00
Chris Hennes c90f7d67df FEM: Add missing translation in InOutVTK
(cherry picked from commit 128dec534a)
2025-11-24 18:26:53 +01:00
marioalexis 402032c230 Fem: Improve Gmsh preference page implementation
(cherry picked from commit 7d218b3f9b)
2025-11-24 18:12:56 +01:00
Chris Hennes 4ba4d1b848 FEM: Translate log verbosity settings
(cherry picked from commit 16eb18abb2)
2025-11-24 18:12:56 +01:00
sliptonic 024e904c9a Merge pull request #25554 from tarman3/1-1_leadinout_overtravel6
CAM: 1.1 - LeadInOut - Fix regression after #24829
2025-11-24 11:00:24 -06:00
Kacper Donat 74879b6738 Attacher: Reduce unnecessary rotation around normal for midpoint
(cherry picked from commit 3e356491e2)
2025-11-24 17:48:21 +01:00
PaddleStroke e76fdd82dc Sketcher: Prevent bad coincidences (#25304)
(cherry picked from commit e38154474a)
2025-11-24 17:48:14 +01:00
pjcreath a7486c6fa9 Sketcher: prevent undo/redo crash when selected geometry goes away.
Fixes #25497

(cherry picked from commit efb10e1b28)
2025-11-24 17:32:32 +01:00
pjcreath 4a331340fe Sketcher: prevent crash on undo/redo while dragging.
Fixes #25500

(cherry picked from commit 16aff10544)
2025-11-24 16:00:22 +01:00
xtemp09 e3d0fe6bb6 [GUI] Handle ampersand in windowTitle
(cherry picked from commit eb0c980c1d)
2025-11-24 15:19:44 +01:00
Syres916 8c36c5390a [Gui] Fix string coding on selection changed
(cherry picked from commit a10fbf2e8c)
2025-11-24 08:00:33 +01:00
Syres916 2ed6528d61 [Part] Fix string encoding for document name and object name
(cherry picked from commit 76071ffbeb)
2025-11-24 08:00:33 +01:00
Syres916 1c54777405 [Gui] Fix string encoding for document name
(cherry picked from commit 83c01fae68)
2025-11-24 08:00:33 +01:00
pre-commit-ci[bot] 4cd7fdc2df [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci

(cherry picked from commit 6d8c5bd2f9)
2025-11-24 08:00:33 +01:00
Syres916 c637b532f1 [Gui] Fix string encoding for preselect, select and deselect
(cherry picked from commit eb08fe2a78)
2025-11-24 08:00:33 +01:00
pre-commit-ci[bot] d5da0227ee [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci

(cherry picked from commit 23df7e4cad)
2025-11-24 08:00:33 +01:00
Syres916 3446b933cb [Gui] Fix string encoding for document, object and subojects
(cherry picked from commit d19ab48231)
2025-11-24 08:00:33 +01:00
pre-commit-ci[bot] 6f999f8885 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci

(cherry picked from commit 78bb40c419)
2025-11-24 08:00:33 +01:00
Syres916 95c547bd5a [PartDesign] Fix string encoding for document name and face reference
(cherry picked from commit 1e30362dd4)
2025-11-24 08:00:33 +01:00
Syres916 7aed77aaec [Gui] Fix string encoding for document name
(cherry picked from commit 61db439744)
2025-11-24 08:00:33 +01:00
pre-commit-ci[bot] aa02543896 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci

(cherry picked from commit 4c8d140373)
2025-11-24 08:00:33 +01:00
Syres916 a6da44aa03 [Gui] Fix string encoding document name and object name
(cherry picked from commit fcd487e0ad)
2025-11-24 08:00:33 +01:00
Syres916 c8f629b8b4 [Gui] Fix incorrect document name when updating PropertyLink
(cherry picked from commit 093a070439)
2025-11-24 08:00:33 +01:00
chris b71344c07b sketcher: fix issue #13852 resolve issue with state not updating constraint text
(cherry picked from commit d806b4e5f3)
2025-11-24 06:11:50 +01:00
PaddleStroke 8e73bddec1 Sketcher: Rotate: Fix line length ignored (#25434)
(cherry picked from commit 1d30d079b0)
2025-11-24 06:11:21 +01:00
Roy-043 aa010759d3 Draft: fix number_length for imperial dimensions (#25369)
* The number_length function did not take imperial dimensions into account. For `9" + 7/8"` it would return 1.
* In ArchRoof reference number_length function from DraftGui.py to avoid duplicate code.

(cherry picked from commit 98240a6de5)
2025-11-24 06:11:04 +01:00
FEA-eng 383a51075c FEM: Add Thick Pipe Internal Pressure 2D example (#25191)
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
(cherry picked from commit 44bf1c35d6)
2025-11-24 06:10:44 +01:00
PaddleStroke aeb6fca064 Assembly: BOM: fix subassembly
(cherry picked from commit 40e4eb8770)
2025-11-24 06:10:22 +01:00
Chris 32bfee0ada Sketcher: allow grid snapping while hovering mouse over axis (#25226)
(cherry picked from commit 72d021108f)
2025-11-24 06:10:06 +01:00
Billy Huddleston cb4d6b9cb7 CAM: Ensure Chipload is restored and displayed with user-preferred units
Fixes an issue where Chipload and similar mixin-defined properties were added to
the schema but not reliably restored, because parameter restoration did not always
apply them to the toolbit object. This change ensures Chipload is restored from saved
data and displayed using the user's preferred unit schema, even when no document
is open. This update also ensures the toolbit editor respects the user’s unit schema
preference during editing, even outside an open document.

src/Mod/CAM/Path/Tool/toolbit/models/base.py:
- Restore Chipload (and other parameters) to toolbit.obj if the property exists.

src/Mod/CAM/Path/Tool/toolbit/ui/editor.py:
- Set units schema to user preference when opening the toolbit editor, so Chipload and other values display correctly.

(cherry picked from commit 4432575243)
2025-11-23 20:40:39 +01:00
sliptonic d2a99e83f7 Merge pull request #25573 from FreeCAD/backport-22738-to-releases/FreeCAD-1-1
[Backport releases/FreeCAD-1-1] CAM: Pocket BSplineSurface
2025-11-23 12:41:17 -06:00
sliptonic 78df9dd937 Merge pull request #25575 from FreeCAD/backport-25106-to-releases/FreeCAD-1-1
[Backport releases/FreeCAD-1-1] [CAM] Offer automatic migration of tools in (old) custom working directory to the new tool system
2025-11-23 12:40:58 -06:00
David Kaufman 0b92c77685 Hopefully placate CodeQL
(cherry picked from commit 767ee484ba)
2025-11-23 18:34:06 +00:00
David Kaufman b73a2cca0d migrate silently, no prompts
(cherry picked from commit f22d0e2292)
2025-11-23 18:34:06 +00:00
David Kaufman 205d024b74 remove unused import
(cherry picked from commit e2b4ea58b8)
2025-11-23 18:34:06 +00:00
David Kaufman fc317b16b0 automatically offer migration for tool libraries in custom working dir
(cherry picked from commit 21319f95d2)
2025-11-23 18:34:06 +00:00
David Kaufman 3b80c25339 [CAM] bugfix tools not imported properly during library import
(cherry picked from commit bb9ae3540e)
2025-11-23 18:34:06 +00:00
pre-commit-ci[bot] ccd3e778ff [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-11-23 18:06:12 +00:00
tarman3 7bf96e2ef0 CAM: LeadInOut - Fix regression after #24829 2025-11-23 20:02:15 +02:00
tarman3 387c3be2bf CAM: Pocket BSplineSurface
(cherry picked from commit 889dc7059c)
2025-11-23 18:02:10 +00:00
sliptonic 2c775840da Merge pull request #25403 from Connor9220/backport-24829-to-releases/FreeCAD-1-1
CAM: LeadInOut - Fix overtravel
2025-11-23 11:46:45 -06:00
sliptonic 14d93d24fb Merge pull request #25438 from Connor9220/FixBullnoseToolBit
CAM: Introduce unified ToolBit parameter migration logic for Bullnose tools
2025-11-23 11:39:34 -06:00
Andrew Burks c7b3353414 #25474 Added read-only warnings when saving documents (#25532)
* #25474 Added read-only warnings when saving documents

Block saving a file and notify user if windows is unable to save to the file for any reason, or the read-only attribute is checked. Also check std::filesystem::perms for write permission and other checks in FileInfo::isWritable(), although it doesn't seem to matter on windows.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
(cherry picked from commit bad2989b7b)
2025-11-23 07:24:49 +01:00
Adrian Insaurralde Avalos a469c45a2d pixi: enable building reverse engineering
(cherry picked from commit 3ab8dbe194)
2025-11-21 16:54:37 -06:00
Roy-043 4e6bb3f524 BIM: fix handling of BIM_Sketch view properties (#25339)
* BIM: fix handling of BIM_Sketch view properties

The handling of the sketch view properties was not correct:
* AutoColor was not set to `False`.
* PointSize was missing.
* PointColor was not set to the DefaultShapeVertexColor preference.
* Grid values were never applied. Sketches do not have a GridSnap property and gridSize is not the correct Draft preference.
* Sketch grid snap is a global setting that affects all sketches, the code should not change that setting IMO.

* Remove trailing white space

(cherry picked from commit 63c9b176e2)
2025-11-21 11:40:34 +01:00
Logstor ba5652e046 Removed sys in 'from os import sys, path'
(cherry picked from commit e802aa1821)
2025-11-21 08:47:32 +01:00
Jacob Oursland 40cd4fe772 Enable Reverse Engineering WB.
The Reverse Engineering WB was temporarily disabled as it didn't support Qt6.As it now supports Qt6,
it is time to re-enable the WB.

(cherry picked from commit f48db1f855)
2025-11-21 08:08:55 +01:00
Adrian Insaurralde Avalos 5f68507f6d set 1.1.0rc1 version in packaging files 2025-11-20 23:14:04 -03:00
PaddleStroke ae864aedb4 Assembly: Make the 'ground first part' dialog closable
(cherry picked from commit 2266a42009)
2025-11-20 07:58:52 +01:00
Chris Hennes d4f2c904f8 Gui: Translate 'Don't show me again'
(cherry picked from commit deab0abf8e)
2025-11-20 07:57:37 +01:00
Kacper Donat 2ff62e9727 Gui: Fix stylesheet loading order
For some platforms due to event loop and timer triggering being not
deterministic stylesheets could be loaded before style parameters were
fully loaded. This caused warnings about style parameters to appear
potentially confusing users.

This commit changes the stylesheet loading to happen much earlier in the
process so the stylesheet is applied before theme preselection has
chance to happen.

(cherry picked from commit 8995f43a15)
2025-11-19 20:18:03 +01:00
Kacper Donat 302fbc6765 Gui: Save defaults layout after first launch
(cherry picked from commit d1a8f99509)
2025-11-19 18:41:30 +01:00
PaddleStroke 456bc178c6 Assembly: Fix joint on Body-LCS not working
(cherry picked from commit 1cf6f5f3a6)
2025-11-19 14:09:37 +01:00
PaddleStroke 66ed85bb19 Assembly/TechDraw: Fix exploded view views (#25426)
(cherry picked from commit be7d41dea7)
2025-11-18 15:59:27 -06:00
pre-commit-ci[bot] cd2e26bbea [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-11-18 20:20:45 +00:00
Billy Huddleston 6058a47f58 Cleanup for 1.1 2025-11-18 15:17:45 -05:00
PaddleStroke 092ae3f8ea Assembly: Fix crash on moving unconnected parts
(cherry picked from commit 2a8d648ad3)
2025-11-18 20:28:06 +01:00
Billy Huddleston 3971ce2bf7 CAM: Introduce unified ToolBit parameter migration logic for Bullnose tools
- Added new migration system to handle legacy parameter conversion for ToolBit assets and objects.
- Implemented ParameterAccessor abstraction for consistent access to dicts and FreeCAD objects.
- Centralized migration logic for CornerRadius from TorusRadius or FlatRadius/Diameter, restricted to Bullnose shape-type.
- Updated asset and object initialization to use migration logic and filter Bullnose parameters.

src/Mod/CAM/Path/Tool/camassets.py:
- Integrate new migration logic for ToolBit assets using ParameterAccessor and migrate_parameters.
- Ensure shape-type is set before parameter migration; only write changes if migration occurred.

src/Mod/CAM/Path/Tool/toolbit/migration.py:
- Add ParameterAccessor class and migrate_parameters function for unified migration.
- Handle legacy parameter conversion for Bullnose tools.

src/Mod/CAM/Path/Tool/toolbit/models/base.py:
- Apply migration logic to ToolBit objects on restore.
- Filter Bullnose parameters to remove FlatRadius after migration.

src/Mod/CAM/Path/Tool/shape/models/bullnose.py:
- Add filter_parameters method to remove FlatRadius for Bullnose.

src/Mod/CAM/Path/Op/SurfaceSupport.py:
- Derive FlatRadius from CornerRadius and Diameter if both are present.

src/Mod/CAM/Path/Op/Surface.py:
- Remove obsolete setOclCutter method.
2025-11-18 13:38:39 -05:00
Chris 69498be228 Part: fix splitting of a split that is a container / group (#25293)
(cherry picked from commit 3f42824ffa)
2025-11-18 19:22:57 +01:00
tetektoza 08cceec9cf Gui: Use UTF-8 string instead of UTF-16 for Reset in Expression Editor
Currently `ExpLineEdit::apply()` passes `QString::constData()` to a
printf-style format string with %s. `QString::constData() returns a
const QChar* (UTF-16, 2 bytes per char), but %s expects a const char*
(UTF-8/ASCII with 1 byte per char).

This results in a string being interpreted as in "Container":
Byte 0: 'C'
Byte 1: 0x00 (high byte of UTF-16 'C', which gets interpreted as null
terminator)

So this patch uses proper conversion to null-terminated C-String before
passing it further.

(cherry picked from commit ca1528e2a9)
2025-11-18 17:51:51 +01:00
tetektoza 3c6cdb17e0 Gui: Differentiate completion activation modes in Expression Editor
Currently if user tries to press TAB during Expression Editor, it
inserts both the entry and its first subentry. Also, if user browses the
dropdown with arrows keys, it inserts it's values.

Root cause of that is the regression made in latest changes to chaining
completion logic which is triggered for all completion modes including
TAB, which already has its own refresh mechanism. Also,
ExpressionTextEdit connected both activated (Enter/click) and highlight
signals to the same slot, resulting in arrow key navigation inserting
completions.

So, this adds separate slots for ExpressionTextEdit to differentiate
completion modes. And also updates tab handling to pass
ActivationMode::Highlighted to prevent double chaining.

(cherry picked from commit 3f6a0ee78b)
2025-11-18 17:51:51 +01:00
PaddleStroke 15de64e30b Sketcher: ConstraintList: prevent N transaction on box selection (#25254)
(cherry picked from commit 6f90c5ea61)
2025-11-18 09:18:59 -06:00
captain0xff d936ba474c PartDesign: fix the interactive controls for revolution/groove
(cherry picked from commit 5d387ae014)
2025-11-18 16:11:54 +01:00
Billy Huddleston b44af1f768 CAM: Fix crash when Path panel widgets are deleted
Prevent RuntimeError by safely handling missing or deleted geometry import
widgets in Path operation panels. This ensures the UI update code does not
fail if the underlying C++ objects are destroyed, improving stability when
panels are closed or the UI changes.

src/Mod/CAM/Path/Op/Base.py:
- Wrap geometry import widget access in try/except to avoid crashes
- Add error handling for panel widget deletion scenarios

(cherry picked from commit 900d5ae255)
2025-11-18 14:12:09 +01:00
Chris Hennes f308fb92a3 Gui: Fix context of translation strings
(cherry picked from commit 0aec9c3b21)
2025-11-18 14:11:52 +01:00
Gaël Écorchard 98a1dd2f14 Remove functions that require Kuka files (#24984)
(cherry picked from commit c77e1d840c)
2025-11-18 14:11:42 +01:00
Chris Hennes 0887aa188b Gui: Add translation to 'No style sheet'
(cherry picked from commit 0a73f53990)
2025-11-18 14:11:31 +01:00
PaddleStroke 9a4cedf1a4 Assembly: Sub-assembly: fix support for Part-wb objects (#25279)
* Assembly: Sub-assembly: fix support for Part-wb objects

* [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>
(cherry picked from commit 551ab85076)
2025-11-18 11:05:47 +01:00
tarman3 894e1d9ae2 CAM: Engrave - Fix #9114 - Unable to engrave an arc
(cherry picked from commit a514cfdf4b)
2025-11-18 11:04:48 +01:00
PaddleStroke 37f014998c Sketcher: Remove transaction from TaskSketcherConstraints::doSetVisible (#25255)
* Sketcher: Remove transaction from TaskSketcherConstraints::doSetVisible

* [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>
(cherry picked from commit 33d1d80555)
2025-11-18 11:04:42 +01:00
chris 1d21e56ee1 sketcher wb: fix issue #25076, resolve grid snapping placement
(cherry picked from commit 1ec1f1506e)
2025-11-18 11:04:32 +01:00
PaddleStroke c43b615301 Assembly: Insert link: Handle partially loaded documents (#25275)
(cherry picked from commit 10cc4dea16)
2025-11-18 09:05:59 +01:00
Chris 125d3b65c7 Import: STEP export preserve body names (#25042)
(cherry picked from commit f218c5f25c)
2025-11-18 08:14:09 +01:00
pre-commit-ci[bot] 9946819e9f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-11-18 05:38:37 +01:00
Chris Hennes 06d55d50ce Build: Add network-failure fault tolerance to macOS signing (#25265)
(cherry picked from commit e0c5c89bd9)
2025-11-18 05:38:37 +01:00
pre-commit-ci[bot] 1678981185 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-11-17 20:23:55 +00:00
tarman3 4e2d2e3206 CAM: LeadInOut - Fix overtravel
(cherry picked from commit 2e3a4d541c)
2025-11-17 15:15:04 -05:00
David Carter 3fc8528692 Materials: Assigning material without appearance
Assigning a material without an appearance reset the appearance to the
default appearance.

There were two main problems. One was the comparison function for
App::Material objects. It would return false when the UUID or MatType
values were different although there are many circumstances where this
could be true and the appearance be the same. It also incorrectly
compared the imagePath.

The second problem was the logic for detecting if an object has already
been assigned an appearance by assigning a material or manually setting
the appearance. If assigned a material, the appearance should update but
not if it has been set manually. This logic has been corrected.

(cherry picked from commit f4e78e3163)
2025-11-17 18:32:15 +01:00
Chris Hennes 6508023e95 CI: Update macOS Intel target version in workflow
GitHub is deprecating macOS 13 runners -- the only remaining Intel runner is now macOS 15, and it is scheduled for retirement in 2027, at which point we will no longer be able to provide Intel weeklies.

(cherry picked from commit 50392855bf)
2025-11-17 18:07:17 +01:00
Chris Hennes ce6d9f361a Core: Convert transparency to alpha (#24891)
* Core: Convert transparency to alpha

Create new `Base::getVersion()` function for extracting a program
version enumeration given a version string.

Convert transparency to alpha value for old project files.

* Base/App: Address review comments

---------

Co-authored-by: wmayer <wmayer@freecad.org>
(cherry picked from commit 4d0c35dd2d)
2025-11-17 17:18:42 +01:00
Florian Foinant-Willig 95fe960485 TechDraw: fix "%.0w" format spec (#25367)
(cherry picked from commit 526f7f2550)
2025-11-17 06:41:03 +01:00
Connor9220 49d4375f70 Fix carriage returns in the Migrator Dialog Title. (#25379)
(cherry picked from commit 11eba3f25c)
2025-11-16 22:53:36 -06:00
Jiří Pinkava b0ffa6728c Tests: Fix value for Imperial pressure tests
The decimal was (wrongly) cahnged in 5379378626

(cherry picked from commit 5fc650b2ff)
2025-11-16 22:48:42 -06:00
PaddleStroke 38fccbacf6 TaskAttacher: Remove 'reset edit' causing trouble to assembly (#25277)
(cherry picked from commit 5da1e3d899)
2025-11-15 17:33:43 +01:00
theo-vt a8ba9b82a5 Sketcher: Proceed to chamfer/fillet on a vertex if there are more than 2 lines but only two non-construction lines
(cherry picked from commit 15d9e14851)
2025-11-15 10:09:45 -06:00
theo-vt 647877384a Sketcher.planegcs: solve reference constraints with lower priority (#25318)
(cherry picked from commit d4bfa82161)
2025-11-15 10:08:53 -06:00
Pieter Hijma a60b4698be Doc: Improve the documentation of transactions (#21494)
(cherry picked from commit 0083364dbe)
2025-11-15 08:03:16 +01:00
Roy-043 1a7fa655f3 Core: workaround for Building US unit system bug (#25288)
* Core: workaround for Building US unit system bug

Fixes #11345

This workaround should hopefully fix the Building US unit system bug at the level of the InputField code. This is the most feasible solution given that we are currently in the v1.1 feature freeze.

I use the word "hopefully" because I have not compiled and tested the code. But replacing `+` with `--` works in Python examples.

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

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

* Fix typo in comment

* [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>
(cherry picked from commit c422404020)
2025-11-15 06:24:11 +01:00
tarman3 6d023afaac CAM: DressupArray - Fix python import
(cherry picked from commit b0a79a6f2c)
2025-11-14 19:33:48 +01:00
Furgo 4642fecba3 Define DlgScale task panel's tab order (#25300)
* Define DlgScale task panel's tab order

To improve keyboard navigation.

Fixes: https://github.com/FreeCAD/FreeCAD/issues/23772

* [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>
(cherry picked from commit 93868d54b7)
2025-11-14 19:33:16 +01:00
Stephan T. Lavavej 2ae9f89982 Avoid using non-Standard std::locale::empty() for MSVC
(cherry picked from commit 9e6509a3a4)
2025-11-14 19:32:50 +01:00
Chris Hennes a6ec30a8fc Build: Change package version suffix from 'dev' to 'rc1' 2025-11-13 08:53:47 -06:00
1340 changed files with 255376 additions and 238395 deletions
+12 -2
View File
@@ -26,14 +26,21 @@
name: FreeCAD master CI
on: [workflow_dispatch, push, pull_request, merge_group]
on:
workflow_dispatch: ~
push:
branches:
- main
- releases/**
pull_request: ~
merge_group: ~
concurrency:
group: FC-CI-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
Prepare:
uses: ./.github/workflows/sub_prepare.yml
with:
@@ -47,18 +54,21 @@ jobs:
Ubuntu:
needs: [Prepare]
if: "!startsWith(github.ref, 'refs/heads/backport-')"
uses: ./.github/workflows/sub_buildUbuntu.yml
with:
artifactBasename: Ubuntu-${{ github.run_id }}
Windows:
needs: [Prepare]
if: "!startsWith(github.ref, 'refs/heads/backport-')"
uses: ./.github/workflows/sub_buildWindows.yml
with:
artifactBasename: Windows-${{ github.run_id }}
Lint:
needs: [Prepare]
if: "!startsWith(github.ref, 'refs/heads/backport-')"
uses: ./.github/workflows/sub_lint.yml
with:
artifactBasename: Lint-${{ github.run_id }}
+3 -1
View File
@@ -29,12 +29,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets.GH_TOKEN_FOR_CI_RUNNERS }}
- name: Create backport pull requests
uses: korthout/backport-action@d07416681cab29bf2661702f925f020aaa962997 # v3.4.1
with:
# Inputs documented here: https://github.com/korthout/backport-action?tab=readme-ov-file#inputs
github_token: ${{ github.token }}
github_token: ${{ secrets.GH_TOKEN_FOR_CI_RUNNERS }}
github_workspace: ${{ github.workspace }}
# permit PRs with merge commits to be backported
@@ -1,5 +1,7 @@
name: Weekly Build
name: Build Release
on:
release:
types: [created]
schedule:
- cron: "0 0 * * 3"
workflow_dispatch:
@@ -8,10 +10,10 @@ permissions:
contents: write
jobs:
tag_build:
upload_src:
runs-on: ubuntu-latest
outputs:
build_tag: ${{ steps.tag_build.outputs.build_tag }}
build_tag: ${{ steps.get_tag.outputs.build_tag }}
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
@@ -21,20 +23,25 @@ jobs:
- name: Checkout Source
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.sha }}
fetch-depth: 2
fetch-tags: true
submodules: 'recursive'
- name: Tag Build
id: tag_build
- name: get tag and create release if weekly
id: get_tag
shell: bash -l {0}
env:
GH_TOKEN: ${{ github.token }}
run: |
export BUILD_TAG=weekly-$(date "+%Y.%m.%d")
if [ "${{ github.event_name }}" = "release" ]; then
export BUILD_TAG="${{ github.event.release.tag_name }}"
else
export BUILD_TAG=weekly-$(date "+%Y.%m.%d")
gh release create ${BUILD_TAG} --title "Development Build ${BUILD_TAG}" -F .github/workflows/weekly-build-notes.md --prerelease || true
fi
echo "BUILD_TAG=${BUILD_TAG}" >> "$GITHUB_ENV"
echo "build_tag=${BUILD_TAG}" >> "$GITHUB_OUTPUT"
gh release create ${BUILD_TAG} --title "Development Build ${BUILD_TAG}" -F .github/workflows/weekly-build-notes.md --prerelease || true
- name: Upload Source
id: upload_source
@@ -42,10 +49,10 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
python3 package/rattler-build/scripts/make_version_file.py ../freecad_version.txt
python3 package/scripts/write_version_info.py ../freecad_version.txt
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config user.name 'github-actions[bot]'
git apply package/rattler-build/scripts/disable_git_info.patch
git apply package/disable_git_info.patch
git commit -a -m "Disable git info write to Version.h"
git archive HEAD -o freecad_source_${BUILD_TAG}.tar
git submodule foreach --recursive \
@@ -57,13 +64,13 @@ jobs:
gh release upload --clobber ${BUILD_TAG} "freecad_source_${BUILD_TAG}.tar.gz" "freecad_source_${BUILD_TAG}.tar.gz-SHA256.txt"
build:
needs: tag_build
needs: upload_src
strategy:
matrix:
include:
- { target: linux-64, os: ubuntu-22.04 }
- { target: linux-arm64, os: ubuntu-22.04-arm }
- { target: osx-64, os: macos-13 }
- { target: osx-64, os: macos-15-intel }
- { target: osx-arm64, os: macos-latest }
- { target: win-64, os: windows-latest }
fail-fast: false
@@ -88,10 +95,8 @@ jobs:
- name: Set Platform Environment Variables
shell: bash -l {0}
env:
BUILD_TAG: ${{ needs.tag_build.outputs.build_tag }}
OPERATING_SYSTEM: ${{ runner.os }}
run: |
echo "BUILD_TAG=${BUILD_TAG}" >> "$GITHUB_ENV"
if [[ $OPERATING_SYSTEM == 'Windows' ]]; then
echo 'PIXI_CACHE_DIR=D:\rattler' >> "$GITHUB_ENV"
echo 'RATTLER_CACHE_DIR=D:\rattler' >> "$GITHUB_ENV"
@@ -100,6 +105,7 @@ jobs:
- name: Checkout Source
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.sha }}
fetch-depth: 2
fetch-tags: true
submodules: 'recursive'
@@ -110,6 +116,7 @@ jobs:
cache: false
- name: Install the Apple certificate and provisioning profile
id: get_cert
if: runner.os == 'macOS'
env:
APP_SPECIFIC_PASSWORD: ${{ secrets.APP_SPECIFIC_PASSWORD }}
@@ -120,9 +127,15 @@ jobs:
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
run: |
if [ -z "$BUILD_CERTIFICATE_BASE64" ]; then
echo "has_cert=false" >> $GITHUB_OUTPUT
echo "No certificate avalable... skipping" && exit 0
else
echo "has_cert=true" >> $GITHUB_OUTPUT
fi
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/FreeCAD_Weekly.provisionprofile
PP_PATH=$RUNNER_TEMP/FreeCAD_bundle.provisionprofile
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
export KEYCHAIN_PASSWORD=$(openssl rand -base64 8)
@@ -152,12 +165,13 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGN_RELEASE: "true"
SIGN_RELEASE: ${{ steps.get_cert.outputs.has_cert }}
TARGET_PLATFORM: ${{ matrix.target }}
MAKE_INSTALLER: "true"
UPLOAD_RELEASE: "true"
BUILD_TAG: ${{ needs.upload_src.outputs.build_tag }}
run: |
python3 package/rattler-build/scripts/make_version_file.py ../freecad_version.txt
git apply package/rattler-build/scripts/disable_git_info.patch
python3 package/scripts/write_version_info.py ../freecad_version.txt
cd package/rattler-build
pixi install
pixi run -e package create_bundle
+1
View File
@@ -8,6 +8,7 @@ on:
jobs:
trigger-copr-build:
environment: fedora-daily
env:
copr_token: ${{ secrets.COPR_TOKEN }}
runs-on: ubuntu-latest
+1 -1
View File
@@ -3,7 +3,7 @@ files_to_sync:
- .packit.yaml
actions:
post-upstream-clone:
- bash -c 'BUILD_TAG=dev /usr/bin/python3 package/rattler-build/scripts/make_version_file.py freecad_version.txt'
- bash -c '/usr/bin/python3 package/scripts/write_version_info.py freecad_version.txt'
- rm -f freecad-sources.tar.gz
changelog-entry:
- bash -c 'git log --no-merges --pretty="format:- %s (%an)" $(git describe --tags --abbrev=0 )..HEAD -- |sed 's/%/%%/g''
+1 -5
View File
@@ -82,15 +82,11 @@ persistent=yes
# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.8
py-version=3.10
# Discover python modules and packages in the file system subtree.
recursive=no
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
+1 -1
View File
@@ -53,7 +53,7 @@ project(FreeCAD)
set(PACKAGE_VERSION_MAJOR "1")
set(PACKAGE_VERSION_MINOR "1")
set(PACKAGE_VERSION_PATCH "0") # number of patch release (e.g. "4" for the 0.18.4 release)
set(PACKAGE_VERSION_SUFFIX "dev") # either "dev" for development snapshot or "" (empty string)
set(PACKAGE_VERSION_SUFFIX "rc2") # either "dev" for development snapshot or "" (empty string)
set(PACKAGE_BUILD_VERSION "0") # used when the same FreeCAD version will be re-released (for example using an updated LibPack)
set(PACKAGE_VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
-4
View File
@@ -71,10 +71,6 @@
"type": "BOOL",
"value": "ON"
},
"BUILD_REVERSEENGINEERING": {
"type": "BOOL",
"value": "OFF"
},
"ENABLE_DEVELOPER_TESTS": {
"type": "BOOL",
"value": "ON"
Binary file not shown.
+5
View File
@@ -0,0 +1,5 @@
*.exe
*-SHA256.txt
MSVCRedist
FreeCAD
version.nsh
+47
View File
@@ -0,0 +1,47 @@
del /S *_d.*
del /S *_debug.*
del /S *.pyc
del /S *.pdb
del /S boost*-gd-*.dll
cd bin
del assistant.exe
del Coin4d.dll
del designer.exe
del freetyped.dll
del libcrypto-3d.dll
del libEGLd.dll
del libGLESv2d.dll
del libssl-3d.dll
del linguist.exe
del qdoc.exe
del Qt6Concurrentd.dll
del Qt6Cored.dll
del Qt6DBusd.dll
del Qt6DesignerComponentsd.dll
del Qt6Designerd.dll
del Qt6Guid.dll
del Qt6Helpd.dll
del Qt6LabsAnimationd.dll
del Qt6LabsFolderListModeld.dll
del Qt6LabsPlatformd.dll
del Qt6LabsSettingsd.dll
del Qt6LabsSharedImaged.dll
del Qt6LabsWavefrontMeshd.dll
del Qt6MultimediaWidgetsd.dll
del Qt6Multimediad.dll
del Qt6Networkd.dll
del Qt6OpenGLWidgetsd.dll
del Qt6OpenGLd.dll
del Qt6PrintSupportd.dll
del Qt6SpatialAudiod.dll
del Qt6Sqld.dll
del Qt6SvgWidgetsd.dll
del Qt6Svgd.dll
del Qt6Testd.dll
del Qt6UiToolsd.dll
del Qt6Widgetsd.dll
del Qt6Xmld.dll
del QtWebEngineProcessd.exe
del Quarter1d.dll
del xerces-c_3_2D.dll
del zlibd.dll
@@ -5,7 +5,7 @@
\pard\nowidctlpar\hyphpar0\sa140\sl276\slmult1\par
\pard\nowidctlpar\hyphpar0\sl276\slmult1\b\fs28 Third-party libraries licenses\b0\fs24\par
\pard\nowidctlpar\hyphpar0\sa140\sl276\slmult1\par
\pard\nowidctlpar\hyphpar0\sl276\slmult1\fs18 The different libraries used in FreeCAD and their respective licenses are described on the\line\fs24{\field{\*\fldinst{HYPERLINK "https://www.freecadweb.org/wiki/Third_Party_Libraries" }}{\fldrslt{\cf2\ul\fs18 Third Party Libraries wiki page}}}\cf0\ulnone\f0\fs18 .\fs24\par
\pard\nowidctlpar\hyphpar0\sl276\slmult1\fs18 The different libraries used in FreeCAD and their respective licenses are described on the\line\fs24{\field{\*\fldinst{HYPERLINK "https://www.freecad.org/wiki/Third_Party_Libraries" }}{\fldrslt{\cf2\ul\fs18 Third Party Libraries wiki page}}}\cf0\ulnone\f0\fs18 .\fs24\par
\par
\pard\noline\nowidctlpar\hyphpar0\sa283\fs12\par
\pard\nowidctlpar\hyphpar0\sl276\slmult1\b\fs18 GNU LIBRARY GENERAL PUBLIC LICENSE\b0\fs24\par
@@ -81,4 +81,5 @@
\pard\nowidctlpar\hyphpar0\sb240\sa180\sl276\slmult1\b\fs24 3D Mouse Support\b0\par
\pard\nowidctlpar\hyphpar0\sb180\sa180\sl276\slmult1\fs18 Development tools and related technology provided under license from 3Dconnexion.(c) 1992 - 2012 3Dconnexion. All rights reserved\fs12\par
}
@@ -1,7 +1,7 @@
# Creating a Windows installer for FreeCAD
These are instructions for building an NSIS-based installer for FreeCAD. They were designed for FreeCAD 0.21 and later,
and presume that you have cloned a copy of FreeCAD's source code, and therefore have the directory *src/WindowsInstaller*.
and presume that you have cloned a copy of FreeCAD's source code, and therefore have the directory *package/WindowsInstaller*.
## Install NSIS
To set up your system for building an NSIS installer:
@@ -15,16 +15,13 @@ To set up your system for building an NSIS installer:
4. Download and install the nsProcess plugin from https://nsis.sourceforge.io/NsProcess_plugin -- you will need the version that supports Unicode, so make sure to follow the appropriate instructions on their site to install that one (as of this writing it involves manually copying and renaming the plugin DLL file).
## Build the installer
Next, update the installer settings for the current version of FreeCAD. Starting from the *src/WindowsInstaller* folder in the FreeCAD source tree:
1. Set the appropriate version strings for the release you are creating. These are used to construct the filename of the installer, among other things. If you have to upload a new version of the installer for the exact same release of FreeCAD, increment `APP_VERSION BUILD` as needed.
```
!define APP_VERSION_MAJOR 0
!define APP_VERSION_MINOR 21
!define APP_VERSION_REVISION 0
Next, update the installer settings for the current version of FreeCAD. Starting from the *package/WindowsInstaller* folder in the FreeCAD source tree:
1. Set the appropriate version strings for the release you are creating. These are used to construct the filename of the installer, among other things. If you have to upload a new version of the installer for the exact same release of FreeCAD, increment `APP_VERSION BUILD` as needed. The main version numbers are dynamically obtained by calling `freecadcmd.exe`.
```nsis
!define APP_VERSION_EMERGENCY "RC1"
!define APP_VERSION_BUILD 1
```
2. Within the folder *src/WindowsInstaller*, create a new folder called MSVCRedist and copy the following files from your MSVC installation into it:
2. If the installer will be made from a LibPack build create a new folder called MSVCRedist within the folder *package/WindowsInstaller* and copy the following files from your MSVC installation into it:
```
vcruntime140.dll
concrt140.dll
@@ -33,28 +30,38 @@ vcamp140.dll
vccorlib140.dll
vcomp140.dll
```
3. Open the file *Settings.nsh* with a text editor (both jEdit and Visual Studio Code are good editors for NSIS files). Edit the following paths to correspond to your system: `FILES_FREECAD` corresponds to your installation directory (e.g. `CMAKE_INSTALL_PREFIX` if you self-compiled) and `FILES_DEPS` is the folder you created with the MSVC redistributable files in it.
```
!define FILES_FREECAD "C:\FreeCAD\Installer\FreeCAD"
!define FILES_DEPS "C:\FreeCAD\Installer\MSVCRedist"
3. If required open the file *Settings.nsh* with a text editor (both jEdit and Visual Studio Code are good editors for NSIS files). Edit the following paths to correspond to your system: `FILES_FREECAD` corresponds to your installation directory (e.g. `CMAKE_INSTALL_PREFIX` if you self-compiled), `FILES_THUMBS` is the directory where the thumbnailer dll is located and `FILES_DEPS` is the folder you created with the MSVC redistributable files in it. `FILES_DEPS` is not needed if the installer is created from a conda bundle so it is not set by default. These can be set via /D argument for `makensis.exe` or by editing *Settings.nsh*.
```nsis
!ifndef FILES_FREECAD
!define FILES_FREECAD "${__FILEDIR__}\FreeCAD"
!endif
!ifndef FILES_THUMBS
!define FILES_THUMBS "${__FILEDIR__}\thumbnail"
!endif
#!define FILES_DEPS "${__FILEDIR__}\MSVC_Redist"
```
4. Ensure the FreeCAD files are in place. Here you have two options:
* If you are working from an already-compiled version of FreeCAD provided to you by an outside source: in this case, simply ensure that `FILES_FREECAD` is set to the directory containing those files.
* If you compiled FreeCAD on your own as described [here](https://wiki.freecad.org/Compile_on_Windows) (and using the Install option outlined there). Then:
* Open the file *Settings.nsh* as described in step 3. above and set there</br>
`!define FILES_FREECAD` to the folder you specified as `CMAKE_INSTALL_PREFIX`
* Copy into that folder the file *Delete.bat* that is part of the installer
* Copy into the installation folder the file *Delete.bat* that is part of the installer
* open a command line in Windows and change to the folder
* run the comamand</br>
* run the command</br>
`Delete.bat`
* (These steps assure that the installer only contains files users need. Moreover it assures that the
overall files size is below 2 GB and we can use the most compact compression for the installer.)
5. Right-click on the file *FreeCAD-installer.nsi* and choose **Compile NSIS script**
to compile the installer.
to compile the installer. You can also run from command line to specify some settings
```cmd
%your_nsis_path%\makensis.exe /D'FILES_FREECAD="D:\some\path\FreeCAD"' /D'FILES_DEPS="${__FILEDIR__}\MSVC_Redist" /D'ExeFile="my-FreeCAD-installer.exe"' FreeCAD-installer.nsi
```
NOTE: For test builds of the installer you can turn off the compression. This speeds up
NOTE: For test builds of the installer you can turn off compression. This speeds up
the build time for the installer a lot but increases its file size. The compression
is turned off by uncommenting the line</br>
is turned off by commenting the line</br>
`SetCompressor /SOLID lzma`</br>
in the file *Settings.nsh*.
in the file *Settings.nsh* or by defining `FC_TEST_BUILD` in command line
```cmd
%your_nsis_path%\makensis.exe [OPTIONS] /DFC_TEST_BUILD FreeCAD-installer.nsi
```
+58
View File
@@ -0,0 +1,58 @@
/*
Settings for FreeCAD installer
These typically need to be modified for each FreeCAD release
*/
# Make the installer as small as possible
# Using /SOLID is usually better for file size but it can't be used if the original size is
# more than 2GB, if building with /SOLID fails try disabling it
# comment this or use /DFC_TEST_BUILD command line option for testing builds since it will reduce
# the time to create an installer a lot at the cost of a much greater file size.
# So assure it is active for release builds!
!ifndef FC_TEST_BUILD
SetCompressor /SOLID lzma
!endif
#--------------------------------
# File locations
# !!! you may need to adjust them to the folders in your Windows system !!!
# can be specified with /D command line argument to makensis.exe
!ifndef FILES_FREECAD
!define FILES_FREECAD "${__FILEDIR__}\FreeCAD"
!endif
!ifndef FILES_THUMBS
!define FILES_THUMBS "${__FILEDIR__}\thumbnail"
!endif
# msvc redistributables location is required for LibPack builds but not conda
# when using a LibPack build set the redistributables directory location here
# or with /D command line argument to makensis.exe
#!define FILES_DEPS "${__FILEDIR__}\MSVCRedist"
#--------------------------------
# get version info from freecadcmd
!system "${FILES_FREECAD}\bin\freecadcmd.exe --safe-mode $\"${__FILEDIR__}\write_version_nsh.py$\"" = 0
!include "${__FILEDIR__}\version.nsh"
!delfile "${__FILEDIR__}\version.nsh"
!define APP_VERSION_EMERGENCY "" # use "1" for an emergency release of FreeCAD otherwise ""
# alternatively you can use APP_VERSION_EMERGENCY for a custom suffix of the version number
!define APP_EMERGENCY_DOT "" # use "." for an emergency release of FreeCAD otherwise ""
!define APP_VERSION_BUILD 1 # Start with 1 for the installer releases of each version
!define APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}${APP_EMERGENCY_DOT}${APP_VERSION_EMERGENCY}" # Version to display
#--------------------------------
# Installer file name
# Typical names for the release are "FreeCAD-020-Installer-1.exe" etc.
!ifndef ExeFile
!define ExeFile "${APP_NAME}_${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}${APP_VERSION_EMERGENCY}-Windows-x86_64-installer-${APP_VERSION_BUILD}.exe"
!endif
#--------------------------------
# installer bit type - FreeCAD is only provided as 64bit build
!define MULTIUSER_USE_PROGRAMFILES64
@@ -1 +1,2 @@
signtool.exe sign /f FCweborg.pfx /p FreeCADIsCool /fd sha512 /tr http://timestamp.digicert.com /td sha512 /v %1
certutil -hashfile %1 SHA256 > %1-SHA256.txt
Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 91 KiB

@@ -13,13 +13,13 @@ Configuration and variables of FreeCAD installer
# Names and version
!define APP_NAME "FreeCAD"
!define APP_VERSION_NUMBER "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}.${APP_VERSION_BUILD}"
!define APP_VERSION_NUMBER "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}.${APP_VERSION_BUILD}"
# For the proposed install folder we use the scheme "FreeCAD 0.18"
# however for the Registry, we need the scheme "FreeCAD 0.18.x" in order
# to check if it is exactly this version (to support side-by-side installations)
!define APP_SERIES_NAME "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}"
!define APP_SERIES_KEY "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_REVISION}${APP_VERSION_EMERGENCY}"
!define APP_SERIES_KEY2 "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}${APP_EMERGENCY_DOT}${APP_VERSION_EMERGENCY}"
!define APP_SERIES_KEY "${APP_VERSION_MAJOR}${APP_VERSION_MINOR}${APP_VERSION_PATCH}${APP_VERSION_EMERGENCY}"
!define APP_SERIES_KEY2 "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}${APP_EMERGENCY_DOT}${APP_VERSION_EMERGENCY}"
!define APP_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe"
!define APP_DIR "${APP_NAME} ${APP_SERIES_NAME}"
# Fixme: FC should use different preferences folder for every release
@@ -60,7 +60,7 @@ Configuration and variables of FreeCAD installer
!define SETUP_ICON "icons\FreeCAD.ico"
!define SETUP_HEADERIMAGE "graphics\header.bmp"
!define SETUP_WIZARDIMAGE "graphics\orange.bmp"
!define SETUP_WIZARDIMAGE "graphics\banner.bmp"
!define SETUP_UNINSTALLER "Uninstall-${APP_NAME}.exe"
!define SETUP_UNINSTALLER_KEY "${APP_NAME}${APP_SERIES_KEY}"
@@ -92,7 +92,7 @@ BrandingText " "
VIProductVersion "${APP_VERSION_NUMBER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP_NAME}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${APP_DIR}.${APP_VERSION_REVISION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${APP_DIR}.${APP_VERSION_PATCH}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APP_INFO}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${APP_VERSION}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "${APP_COPYRIGHT}"
@@ -50,7 +50,7 @@ Function PostMultiUserPageInit
# check if there is an existing FreeCAD installation of the same FreeCAD series
# we usually don't release more than 10 versions so with 20 we are safe to check if a newer version is installed
IntOp $4 ${APP_VERSION_REVISION} + 20
IntOp $4 ${APP_VERSION_PATCH} + 20
${for} $5 0 $4
ReadRegStr $0 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}${APP_VERSION_MAJOR}${APP_VERSION_MINOR}$5" "DisplayVersion"
# also check for an emergency release
@@ -110,7 +110,8 @@ Function .onInit
${orif} $R0 == "5.1" # XP
${orif} $R0 == "5.2" # 2003
${orif} $R0 == "6.0" # Vista
MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows 7 or newer." /SD IDOK
${orif} $R0 == "6.1" # 7
MessageBox MB_OK|MB_ICONSTOP "${APP_NAME} ${APP_VERSION} requires Windows 8 or newer." /SD IDOK
Quit
${endif}
@@ -130,7 +131,7 @@ Function .onInit
# plugin must be unloaded
${nsProcess::Unload}
# initialize the multi-uder installer UI
# initialize the multi-user installer UI
!insertmacro MULTIUSER_INIT
# this can be reset to "true" in section SecDesktop
@@ -18,8 +18,8 @@
# and returns the number of the character in the FindStr where the SearchStr was found (Pointer)
# if nothing was found or the search is impossible the Pointer is set to -1
StrLen $R2 ${SearchStr}
StrLen $R4 ${FindStr}
StrLen $R2 "${SearchStr}"
StrLen $R4 "${FindStr}"
StrCpy $R5 0
${if} $R2 == 0
${orif} $R4 == 0
@@ -27,8 +27,8 @@
${endif}
IntCmp $R4 $R2 loopA NotFound
loopA:
StrCpy $R3 ${FindStr} $R2 $R5
StrCmp $R3 ${SearchStr} Found
StrCpy $R3 "${FindStr}" $R2 $R5
StrCmp $R3 "${SearchStr}" Found
IntOp $R5 $R5 + 1
IntCmp $R4 $R5 loopA NotFound
Goto loopA
@@ -7,7 +7,7 @@ Language: English
${LangFileString} TEXT_INSTALL_CURRENTUSER "(Installed for Current User)"
${LangFileString} TEXT_WELCOME "This wizard will guide you through the installation of $(^NameDA), $\r$\n\
${LangFileString} TEXT_WELCOME "This wizard will guide you through the installation of $(^NameDA). $\r$\n\
$\r$\n\
$_CLICK"
@@ -8,14 +8,15 @@ Installation of program files, dictionaries and external components
#--------------------------------
# Program files
!include LogicLib.nsh
Section -ProgramFiles SecProgramFiles
# if the $INSTDIR does not contain "FreeCAD" we must add a subfolder to avoid that FreeCAD will e.g.
# be installed directly to C:\programs - the uninstaller will then delete the whole
# C:\programs directory
StrCpy $String $INSTDIR
StrCpy $Search ${APP_NAME}
StrCpy $String "$INSTDIR"
StrCpy $Search "${APP_NAME}"
Call StrPoint # function from Utils.nsh
${if} $Pointer == "-1"
StrCpy $INSTDIR "$INSTDIR\${APP_DIR}"
@@ -38,8 +39,11 @@ Section -ProgramFiles SecProgramFiles
File /r "${FILES_FREECAD}\bin\*.*"
# MSVC redistributable DLLs
SetOutPath "$INSTDIR\bin"
File "${FILES_DEPS}\*.*"
!ifdef FILES_DEPS
!echo "Including MSVC Redist files from ${FILES_DEPS}"
SetOutPath "$INSTDIR\bin"
File "${FILES_DEPS}\*.*"
!endif
# Others
SetOutPath "$INSTDIR\data"
@@ -52,10 +56,6 @@ Section -ProgramFiles SecProgramFiles
File /r "${FILES_FREECAD}\lib\*.*"
SetOutPath "$INSTDIR\Mod"
File /r "${FILES_FREECAD}\Mod\*.*"
SetOutPath "$INSTDIR\resources"
File /r "${FILES_FREECAD}\resources\*.*"
SetOutPath "$INSTDIR\translations"
File /r "${FILES_FREECAD}\translations\*.*"
SetOutPath "$INSTDIR"
File /r "${FILES_THUMBS}"
@@ -0,0 +1,20 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# this script is meant to be called by nsis installer scripts, it gets version information
# from freecad and writes version.nsh file in the directory the script is located at
import FreeCAD
import datetime
import os
filepath=os.path.join(os.path.dirname(os.path.abspath(__file__)),"version.nsh")
v=FreeCAD.Version()
content=f'''\
!define COPYRIGHT_YEAR {datetime.date.today().year}
!define APP_VERSION_MAJOR "{v[0]}"
!define APP_VERSION_MINOR "{v[1]}"
!define APP_VERSION_PATCH "{v[2]}"
!define APP_VERSION_REVISION "{v[3].split()[0]}"
'''
with open(filepath, "w", encoding="utf-8") as file:
file.writelines(content)
+2 -2
View File
@@ -16,7 +16,7 @@
Name: freecad
Epoch: 1
Version: 1.1.0~dev
Version: 1.1.0~rc2
Release: 1%{?dist}
Summary: A general purpose 3D CAD modeler
@@ -44,7 +44,7 @@ Source0: freecad-sources.tar.gz
# Utilities
BuildRequires: cmake gcc-c++ gettext doxygen swig graphviz gcc-gfortran desktop-file-utils tbb-devel ninja-build strace
%if %{with tests}
BuildRequires: xorg-x11-server-Xvfb python3-typing-extensions
BuildRequires: xorg-x11-server-Xvfb python3-typing-extensions
%if %{without bundled_gtest}
BuildRequires: gtest-devel gmock-devel
%endif
+12
View File
@@ -0,0 +1,12 @@
linux/AppDir/usr
linux/AppDir/*.desktop
linux/AppDir/*.svg
linux/AppDir/packages.txt
windows/FreeCAD_*Windows*
osx/FreeCAD.app
**.AppImage
**.AppImage.zsync
**.dmg
**.7z
**.exe
**-SHA256.txt
+1
View File
@@ -37,6 +37,7 @@ cmake \
-D OCC_LIBRARY_DIR:FILEPATH="$PREFIX/lib" \
-D Python_EXECUTABLE:FILEPATH="$PYTHON" \
-D Python3_EXECUTABLE:FILEPATH="$PYTHON" \
-D BUILD_DYNAMIC_LINK_PYTHON:BOOL=OFF \
-B build \
-S .
+26 -7
View File
@@ -1,7 +1,7 @@
#!/bin/bash
set -e
set -x
set -x
conda_env="AppDir/usr"
@@ -9,9 +9,6 @@ mkdir -p ${conda_env}
cp -a ../.pixi/envs/default/* ${conda_env}
export PATH="${PWD}/${conda_env}/bin:${PATH}"
export CONDA_PREFIX="${PWD}/${conda_env}"
echo -e "\nDelete unnecessary stuff"
rm -rf ${conda_env}/include
find ${conda_env} -name \*.a -delete
@@ -49,7 +46,7 @@ rm -rf ${conda_env}/lib/cmake/
find . -name "*.h" -type f -delete
find . -name "*.cmake" -type f -delete
python_version=$(python -c 'import platform; print("py" + platform.python_version_tuple()[0] + platform.python_version_tuple()[1])')
python_version=$(${conda_env}/bin/python -c 'import platform; print("py" + platform.python_version_tuple()[0] + platform.python_version_tuple()[1])')
version_name="FreeCAD_${BUILD_TAG}-Linux-$(uname -m)-${python_version}"
echo -e "\################"
@@ -62,6 +59,20 @@ sed -i "1s/.*/\nLIST OF PACKAGES:/" AppDir/packages.txt
curl -LO https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage
chmod a+x appimagetool-$(uname -m).AppImage
if [ "${UPLOAD_RELEASE}" == "true" ]; then
case "${BUILD_TAG}" in
*weekly*)
GH_UPDATE_TAG="weeklies"
;;
*rc*)
GH_UPDATE_TAG="${BUILD_TAG}"
;;
*)
GH_UPDATE_TAG="latest"
;;
esac
fi
echo -e "\nCreate the appimage"
# export GPG_TTY=$(tty)
chmod a+x ./AppDir/AppRun
@@ -69,7 +80,7 @@ chmod a+x ./AppDir/AppRun
--comp zstd \
--mksquashfs-opt -Xcompression-level \
--mksquashfs-opt 22 \
-u "gh-releases-zsync|FreeCAD|FreeCAD|${BUILD_TAG}|FreeCAD*$(uname -m)*.AppImage.zsync" \
-u "gh-releases-zsync|FreeCAD|FreeCAD|${GH_UPDATE_TAG}|FreeCAD*$(uname -m)*.AppImage.zsync" \
AppDir ${version_name}.AppImage
# -s --sign-key ${GPG_KEY_ID} \
@@ -77,5 +88,13 @@ echo -e "\nCreate hash"
sha256sum ${version_name}.AppImage > ${version_name}.AppImage-SHA256.txt
if [ "${UPLOAD_RELEASE}" == "true" ]; then
gh release upload --clobber ${BUILD_TAG} "${version_name}.AppImage" "${version_name}.AppImage-SHA256.txt"
gh release upload --clobber ${BUILD_TAG} "${version_name}.AppImage" "${version_name}.AppImage.zsync" "${version_name}.AppImage-SHA256.txt"
if [ "${GH_UPDATE_TAG}" == "weeklies" ]; then
generic_name="FreeCAD_weekly-Linux-$(uname -m)"
mv "${version_name}.AppImage" "${generic_name}.AppImage"
mv "${version_name}.AppImage.zsync" "${generic_name}.AppImage.zsync"
mv "${version_name}.AppImage-SHA256.txt" "${generic_name}.AppImage-SHA256.txt"
gh release create weeklies --prerelease | true
gh release upload --clobber weeklies "${generic_name}.AppImage" "${generic_name}.AppImage.zsync" "${generic_name}.AppImage-SHA256.txt"
fi
fi
+2 -5
View File
@@ -9,9 +9,6 @@ mkdir -p ${conda_env}
cp -a ../.pixi/envs/default/* ${conda_env}
export PATH="${PWD}/${conda_env}/bin:${PATH}"
export CONDA_PREFIX="${PWD}/${conda_env}"
# delete unnecessary stuff
rm -rf ${conda_env}/include
find ${conda_env} -name \*.a -delete
@@ -50,7 +47,7 @@ cmake --build build
mkdir -p FreeCAD.app/Contents/MacOS
cp build/FreeCAD FreeCAD.app/Contents/MacOS/FreeCAD
python_version=$(python -c 'import platform; print("py" + platform.python_version_tuple()[0] + platform.python_version_tuple()[1])')
python_version=$(${conda_env}/bin/python -c 'import platform; print("py" + platform.python_version_tuple()[0] + platform.python_version_tuple()[1])')
version_name="FreeCAD_${BUILD_TAG}-macOS-$(uname -m)-${python_version}"
application_menu_name="FreeCAD_${BUILD_TAG}"
@@ -71,7 +68,7 @@ rm -rf ${conda_env}/Library
if [[ "${SIGN_RELEASE}" == "true" ]]; then
# create the signed dmg
./macos_sign_and_notarize.zsh -p "FreeCAD" -k ${SIGNING_KEY_ID} -o "${version_name}.dmg"
../../scripts/macos_sign_and_notarize.zsh -p "FreeCAD" -k ${SIGNING_KEY_ID} -o "${version_name}.dmg"
else
# create the dmg
dmgbuild -s dmg_settings.py "FreeCAD" "${version_name}.dmg"
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
# Ensure default values are set in defines if they are not already provided
defines.setdefault('containing_folder', '.')
defines.setdefault('app_name', 'FreeCAD.app')
File diff suppressed because it is too large Load Diff
+11 -17
View File
@@ -1,14 +1,15 @@
[workspace]
channels = [
"https://prefix.dev/pixi-build-backends",
"https://prefix.dev/conda-forge",
"freecad",
"conda-forge",
]
platforms = ["linux-64", "linux-aarch64", "osx-64", "osx-arm64", "win-64"]
preview = ["pixi-build"]
[package]
name = "freecad"
version = "1.1.0dev"
version = "1.1.0rc2"
homepage = "https://freecad.org"
repository = "https://github.com/FreeCAD/FreeCAD"
description = "FreeCAD"
@@ -22,44 +23,37 @@ freecad = { path = "." }
[feature.package.dependencies]
python = ">=3.11,<3.12"
[feature.package.tasks]
create_bundle = 'bash -c "cd $(bash scripts/get_os.bash) && bash create_bundle.sh"'
## Linux (x86-64)
[feature.package.target.linux-64.dependencies]
coreutils = "*"
[feature.package.target.linux-64.tasks]
create_bundle = 'bash -c "cd linux && bash create_bundle.sh"'
## Linux (aarch64)
[feature.package.target.linux-aarch64.dependencies]
coreutils = "*"
[feature.package.target.linux-aarch64.tasks]
create_bundle = 'bash -c "cd linux && bash create_bundle.sh"'
## macOS (Intel)
[feature.package.target.osx-64.dependencies]
coreutils = "*"
dmgbuild = "*"
pyobjc-framework-Quartz = "*"
sed = "*"
[feature.package.target.osx-64.tasks]
create_bundle = 'bash -c "cd osx && bash create_bundle.sh"'
## macOS (Apple Silicon)
[feature.package.target.osx-arm64.dependencies]
coreutils = "*"
dmgbuild = "*"
pyobjc-framework-Quartz = "*"
sed = "*"
[feature.package.target.osx-arm64.tasks]
create_bundle = 'bash -c "cd osx && bash create_bundle.sh"'
## Windows dependencies (x86-64)
[feature.package.target.win-64.dependencies]
git = "*"
[feature.package.target.win-64.tasks]
create_bundle = 'bash -c "cd windows && bash create_bundle.sh"'
nsis = { version = "*", build = "*_log*" }
7zip = "*"
vs2022_win-64 = "*"
[environments]
default = ["freecad"]
+1 -2
View File
@@ -1,5 +1,5 @@
context:
version: "1.1.0dev"
version: "1.1.0rc2"
package:
name: freecad
@@ -145,7 +145,6 @@ requirements:
- gmsh
- graphviz
- ifcopenshell
- jinja2
- lark
- lxml
- matplotlib-base
@@ -1,13 +0,0 @@
diff --git a/src/Tools/SubWCRev.py b/src/Tools/SubWCRev.py
index 1f3f0a436343..c314003736f1 100644
--- a/src/Tools/SubWCRev.py
+++ b/src/Tools/SubWCRev.py
@@ -523,7 +523,7 @@ def main():
inp = open("%s/src/Build/Version.h.in" % (bindir))
lines = inp.readlines()
inp.close()
- lines = i.writeVersion(lines)
+ #lines = i.writeVersion(lines)
out = open("%s/src/Build/Version.h.out" % (bindir), "w")
out.writelines(lines)
out.write("\n")
@@ -1,53 +0,0 @@
import sys
import os
import subprocess
import platform
from datetime import datetime
import freecad
import FreeCAD
package_manager = "conda"
system = platform.platform().split("-")[0]
arch = platform.machine()
# Windows uses a different syntax
if arch == "AMD64":
arch = "x86_64"
if "ARCH" in os.environ:
if os.environ["ARCH"] != "":
arch = os.environ["ARCH"]
python_version = platform.python_version().split(".")
python_version = "py" + python_version[0] + python_version[1]
date = str(datetime.now()).split(" ")[0]
version_info = FreeCAD.Version()
build_version_suffix = FreeCAD.ConfigGet("BuildVersionSuffix")
dev_version = version_info[0] + "." + version_info[1] + "." + version_info[2] + build_version_suffix
revision = version_info[3].split(" ")[0]
if system == "macOS":
import jinja2
print("create plist from template")
osx_directory = os.path.join(os.path.dirname(__file__), "..", "osx")
with open(os.path.join(osx_directory, "Info.plist.template")) as template_file:
template_str = template_file.read()
template = jinja2.Template(template_str)
rendered_str = template.render( FREECAD_VERSION="{}-{}".format(dev_version, revision),
APPLICATION_MENU_NAME="FreeCAD-{}-{}".format(dev_version, revision) )
with open(os.path.join(osx_directory, "FreeCAD.app", "Contents", "Info.plist"), "w") as rendered_file:
rendered_file.write(rendered_str)
if "DEPLOY_RELEASE" in os.environ and os.environ["DEPLOY_RELEASE"] == "weekly-builds":
dev_version = "weekly-builds"
revision_separator = "-"
else:
revision_separator = ""
revision = ""
bundle_name = f"FreeCAD_{dev_version}{revision_separator}{revision}-{package_manager}-{system}-{arch}-{python_version}"
with open("bundle_name.txt", "w") as bundle_name_file:
bundle_name_file.write(bundle_name)
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
if [[ "$OSTYPE" =~ (msys*|cygwin*|mingw*) ]]; then
echo windows
elif [[ "$OSTYPE" == darwin* ]]; then
echo osx
elif [[ "$OSTYPE" == linux* ]]; then
echo linux
fi
@@ -1,56 +0,0 @@
set conda_env="fc_env"
robocopy ..\.pixi\envs\default\* %conda_env% /S /MT:%NUMBER_OF_PROCESSORS% > nul
%conda_env%\python ..\scripts\get_freecad_version.py
set /p freecad_version_name= <bundle_name.txt
echo **********************
echo %freecad_version_name%
echo **********************
REM remove arm binaries that fail to extract unless using latest 7zip
for /r %conda_env% %%i in (*arm*.exe) do (@echo "%%i will be removed" & @del "%%i")
set copy_dir="FreeCAD_Conda_Build"
mkdir %copy_dir%
REM Copy Conda's Python and (U)CRT to FreeCAD/bin
robocopy %conda_env%\DLLs %copy_dir%\bin\DLLs /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Lib %copy_dir%\bin\Lib /XD __pycache__ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Scripts %copy_dir%\bin\Scripts /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\python*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\msvc*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\ucrt*.* %copy_dir%\bin\ /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy meaningful executables
robocopy %conda_env%\Library\bin %copy_dir%\bin\ ccx.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin %copy_dir%\bin\ gmsh.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin %copy_dir%\bin\ dot.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\bin %copy_dir%\bin\ unflatten.exe /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\mingw-w64\bin * %copy_dir%\bin\ /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy Conda's QT5/plugins to FreeCAD/bin
robocopy %conda_env%\Library\plugins %copy_dir%\bin\ /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\resources %copy_dir%\resources /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\translations %copy_dir%\translations /MT:%NUMBER_OF_PROCESSORS% > nul
REM get all the dependency .dlls
robocopy %conda_env%\Library\bin *.dll %copy_dir%\bin /XF *.pdb /XF api*.* /MT:%NUMBER_OF_PROCESSORS% > nul
REM Copy FreeCAD build
robocopy %conda_env%\Library\bin FreeCAD* %copy_dir%\bin /XF *.pdb /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\data %copy_dir%\data /XF *.txt /S /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Ext %copy_dir%\Ext /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\lib %copy_dir%\lib /XF *.lib /XF *.prl /XF *.sh /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\Mod %copy_dir%\Mod /S /XD __pycache__ /MT:%NUMBER_OF_PROCESSORS% > nul
robocopy %conda_env%\Library\doc %copy_dir%\doc ThirdPartyLibraries.html LICENSE.html /MT:%NUMBER_OF_PROCESSORS% > nul
REM Apply Patches
rename %copy_dir%\bin\Lib\ssl.py ssl-orig.py
copy ssl-patch.py %copy_dir%\bin\Lib\ssl.py
cd %copy_dir%\..
ren %copy_dir% %freecad_version_name%
dir
REM if errorlevel1 exit 1
"%ProgramFiles%\7-Zip\7z.exe" a -t7z -mx9 -mmt=%NUMBER_OF_PROCESSORS% %freecad_version_name%.7z %freecad_version_name%\ -bb
certutil -hashfile "%freecad_version_name%.7z" SHA256 > "%freecad_version_name%.7z"-SHA256.txt
echo %date%-%time% >>"%freecad_version_name%.7z"-SHA256.txt
+45 -21
View File
@@ -3,23 +3,9 @@
set -e
set -x
conda_env="fc_env"
conda_env="$(pwd)/../.pixi/envs/default/"
mkdir -p ${conda_env}
cp -a ../.pixi/envs/default/* ${conda_env}
export PATH="${PWD}/${conda_env}/bin:${PATH}"
export CONDA_PREFIX="${PWD}/${conda_env}"
# remove arm binaries that fail to extract unless using latest 7zip
rm $(find ${conda_env} -name \*arm\*.exe)
# delete unnecessary stuff
rm -rf ${conda_env}/include
find ${conda_env} -name \*.a -delete
copy_dir="FreeCAD_Conda_Build"
copy_dir="FreeCAD_Windows"
mkdir -p ${copy_dir}/bin
# Copy Conda's Python and (U)CRT to FreeCAD/bin
@@ -48,16 +34,28 @@ cp -a ${conda_env}/Library/lib ${copy_dir}/lib
cp -a ${conda_env}/Library/Mod ${copy_dir}/Mod
mkdir -p ${copy_dir}/doc
cp -a ${conda_env}/Library/doc/{ThirdPartyLibraries.html,LICENSE.html} ${copy_dir}/doc
rm -rf ${conda_env}/bin_tmp
# delete unnecessary stuff
find ${copy_dir} -name \*.a -delete
find ${copy_dir} -name \*.lib -delete
find ${copy_dir} -name \*arm\*.exe -delete # arm binaries that fail to extract unless using latest 7zip
# Apply Patches
mv ${copy_dir}/bin/Lib/ssl.py ssl-orig.py
mv ${copy_dir}/bin/Lib/ssl.py .ssl-orig.py
cp ssl-patch.py ${copy_dir}/bin/Lib/ssl.py
echo '[Paths]' >> ${copy_dir}/bin/qt6.conf
echo 'Prefix = ../lib/qt6' >> ${copy_dir}/bin/qt6.conf
python_version=$(python -c 'import platform; print("py" + platform.python_version_tuple()[0] + platform.python_version_tuple()[1])')
# convenient shortcuts to run the binaries
if [ -x /c/ProgramData/chocolatey/tools/shimgen.exe ]; then
pushd ${copy_dir}
/c/ProgramData/chocolatey/tools/shimgen.exe -p bin/freecadcmd.exe -i "$(pwd)/../../../WindowsInstaller/icons/FreeCAD.ico" -o "$(pwd)/FreeCADCmd.exe"
/c/ProgramData/chocolatey/tools/shimgen.exe --gui -p bin/freecad.exe -i "$(pwd)/../../../WindowsInstaller/icons/FreeCAD.ico" -o "$(pwd)/FreeCAD.exe"
popd
fi
python_version=$("${copy_dir}"/bin/python.exe -c 'import platform; print("py" + platform.python_version_tuple()[0] + platform.python_version_tuple()[1])')
version_name="FreeCAD_${BUILD_TAG}-Windows-$(uname -m)-${python_version}"
echo -e "################"
@@ -69,11 +67,37 @@ sed -i '1s/.*/\nLIST OF PACKAGES:/' ${copy_dir}/packages.txt
mv ${copy_dir} ${version_name}
"${PROGRAMFILES}/7-Zip/7z.exe" a -t7z -mx9 -mmt=${NUMBER_OF_PROCESSORS} ${version_name}.7z ${version_name} -bb
7z a -t7z -mx9 -mmt=${NUMBER_OF_PROCESSORS} ${version_name}.7z ${version_name} -bb
# create hash
sha256sum ${version_name}.7z > ${version_name}.7z-SHA256.txt
if [ "${MAKE_INSTALLER}" == "true" ]; then
FILES_FREECAD="$(cygpath -w $(pwd))\\${version_name}"
nsis_cpdir=$(pwd)/.nsis_tmp
cp -r "${CONDA_PREFIX}/NSIS" "${nsis_cpdir}"
# curl -L -o ".nsis-log.zip" http://prdownloads.sourceforge.net/nsis/nsis-3.11-log.zip # we use the log variant of the package already
# curl -L -o ".nsis-strlen_8192.zip" "http://prdownloads.sourceforge.net/nsis/nsis-3.11-strlen_8192.zip"
curl -L -o ".NsProcess.7z" "https://nsis.sourceforge.io/mediawiki/images/1/18/NsProcess.zip"
if [ ! $(echo fc19fc66a5219a233570fafd5daeb0c9b85387b379f6df5ac8898159a57c5944 .NsProcess.7z | sha256sum --check --status) ]; then
7z x .NsProcess.7z -o"${nsis_cpdir}" -y
mv "${nsis_cpdir}"/Plugin/nsProcess.dll "${nsis_cpdir}"/Plugins/x86-ansi/nsProcess.dll
mv "${nsis_cpdir}"/Plugin/nsProcessW.dll "${nsis_cpdir}"/Plugins/x86-unicode/nsProcess.dll
"${nsis_cpdir}"/makensis.exe -V4 \
-D"ExeFile=${version_name}-installer.exe" \
-D"FILES_FREECAD=${FILES_FREECAD}" \
-X'SetCompressor /FINAL lzma' \
../../WindowsInstaller/FreeCAD-installer.nsi
mv ../../WindowsInstaller/${version_name}-installer.exe .
sha256sum ${version_name}-installer.exe > ${version_name}-installer.exe-SHA256.txt
else
echo "Error: Failed to get NsProcess plugin. Aborting installer creation..."
fi
rm -rf "${nsis_cpdir}"
fi
if [ "${UPLOAD_RELEASE}" == "true" ]; then
gh release upload --clobber ${BUILD_TAG} "${version_name}.7z" "${version_name}.7z-SHA256.txt"
if [ "${MAKE_INSTALLER}" == "true" ]; then
gh release upload --clobber ${BUILD_TAG} "${version_name}-installer.exe" "${version_name}-installer.exe-SHA256.txt"
fi
fi
@@ -83,8 +83,11 @@ fi
# Check for dmgbuild executable
if ! command -v dmgbuild &> /dev/null; then
echo "Error: dmgbuild not installed. Please install it for example using pip:"
echo 'pip3 install "dmgbuild[badge_icons]>=1.6.0,<1.7.0"'
echo 'Error: dmgbuild not installed. Please install it'
echo '- using pixi:'
echo 'pixi g install dmgbuild --with pyobjc-framework-Quartz'
echo '- using pip:'
echo 'pip3 install dmgbuild pyobjc-framework-Quartz'
exit 1
fi
@@ -119,8 +122,96 @@ run_codesign "${CONTAINING_FOLDER}/${APP_NAME}"
echo "Creating disk image ${DMG_NAME}"
dmgbuild -s ${DMG_SETTINGS} -Dcontaining_folder="${CONTAINING_FOLDER}" -Dapp_name="${APP_NAME}" "${VOLUME_NAME}" "${DMG_NAME}"
# Submit it for notarization (requires that an App Store API Key has been set up in the notarytool)
time xcrun notarytool submit --wait --keychain-profile "${KEYCHAIN_PROFILE}" "${DMG_NAME}"
ID_FILE="${DMG_NAME}.notarization_id"
# Assuming that notarization succeeded, it's a good practice to staple that notarization to the DMG
xcrun stapler staple "${DMG_NAME}"
# Submit it for notarization (requires that an App Store API Key has been set up in the notarytool)
# This is a *very slow* process, and occasionally the GitHub runners lose the internet connection for a short time
# during the run. So in order to be fault-tolerant, this script polls, instead of using --wait
submit_notarization_request() {
if [[ -s "${ID_FILE}" ]]; then
cat "${ID_FILE}"
return
fi
local out
if ! out=$(xcrun notarytool submit --keychain-profile "${KEYCHAIN_PROFILE}" \
--output-format json --no-progress "${DMG_NAME}" 2>&1); then
print -r -- "$out" >&2
return 1
fi
# We asked for JSON output so we had something stable, but of course parsing JSON with ZSH is ugly, so a quick bit of
# Python does it instead...
local id
id=$(print -r -- "$out" |
/usr/bin/python3 -c 'import sys, json; print(json.load(sys.stdin).get("id",""))'
)
[[ -n "$id" ]] || { print -r -- "Could not parse submission id" >&2; return 1; }
print -r -- "$id" > "${ID_FILE}"
print -r -- "$id" # ID is a string here, not an integer, so I can't just return it
}
wait_for_notarization_result() {
local id="$1" attempt=0
while :; do
if xcrun notarytool wait "$id" --keychain-profile "${KEYCHAIN_PROFILE}" \
--timeout 10m --no-progress >/dev/null; then
return 0
fi
(( attempt++ ))
# If the failure was transient (timeout/HTTP/connection) just retry, but make sure to check to see if the problem
# was actually that the signing failed before retrying.
local tmp_json
tmp_json=$(mktemp)
trap 'rm -f "$tmp_json"' EXIT INT TERM
xcrun notarytool info "$id" --keychain-profile "${KEYCHAIN_PROFILE}" --output-format json 2>/dev/null > "$tmp_json"
/usr/bin/python3 - "$tmp_json" <<'PY'
import sys, json
try:
with open(sys.argv[1]) as f:
s = (json.load(f).get("status") or "").lower()
if s in ("invalid", "rejected"):
sys.exit(2)
else:
sys.exit(0)
except Exception:
sys.exit(1)
PY
rc=$?
rm -f "$tmp_json"
if [[ $rc == 2 ]]; then
print -r -- "Notarization was not accepted by Apple:" >&2
xcrun notarytool log "$id" --keychain-profile "${KEYCHAIN_PROFILE}" >&2
return 3
fi
if [[ $attempt -gt 120 ]]; then
print -r -- "🏳️ Notarization is taking too long, bailing out. 🏳️" >&2
return 4
fi
sleep $(( (attempt<6?2**attempt:60) + RANDOM%5 )) # Increasing timeout plus jitter for multi-run safety
done
}
if ! id="$(submit_notarization_request)"; then
print -r -- "❌ Failed to submit notarization request" >&2
exit 1
fi
if [[ -z "$id" ]]; then
print -r -- "❌ Submission succeeded but no ID was returned" >&2
exit 1
fi
print "Notarization submission ID: $id"
if wait_for_notarization_result "$id"; then
print "✅ Notarization succeeded. Stapling..."
xcrun stapler staple "${DMG_NAME}"
print "Stapled: ${DMG_NAME}"
rm -f "${ID_FILE}"
else
rc=$?
print "❌ Notarization failed (code $rc)." >&2
exit "$rc"
fi
@@ -11,12 +11,10 @@ import SubWCRev
gitInfo = SubWCRev.GitControl()
gitInfo.extractInfo("","")
gitDescription = os.environ['BUILD_TAG']
i = open("src/Build/Version.h.cmake")
content = []
for line in i.readlines():
line = line.replace("-${PACKAGE_VERSION_SUFFIX}",gitDescription)
line = line.replace("${PACKAGE_WCREF}",gitInfo.rev)
line = line.replace("${PACKAGE_WCDATE}",gitInfo.date)
line = line.replace("${PACKAGE_WCURL}",gitInfo.url)
@@ -28,6 +26,14 @@ with open("src/Build/Version.h.cmake", "w") as o:
content.append('#define FCRepositoryBranch "%s"\n' % (gitInfo.branch))
o.writelines(content)
with open("src/Tools/SubWCRev.py", "r") as f:
new_subwcrev = f.read()
new_subwcrev = new_subwcrev.replace("lines = i.writeVersion(lines)",
"#lines = i.writeVersion(lines) # this source package already has git info, we do nothing here")
with open("src/Tools/SubWCRev.py", "w") as f:
f.writelines(new_subwcrev)
with open(os.sys.argv[1], "w") as f:
f.write(f"rev_number: {gitInfo.rev}\n")
f.write(f"branch_name: {gitInfo.branch}\n")
@@ -35,8 +41,9 @@ with open(os.sys.argv[1], "w") as f:
f.write(f"commit_hash: {gitInfo.hash}\n")
f.write(f"remote_url: {gitInfo.url}\n")
p = subprocess.Popen(["git", "-c", "user.name='github-actions[bot]'", "-c", "user.email='41898282+github-actions[bot]@users.noreply.github.com'",
"commit", "-a", "-m", "add git information"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen(["git", "-c", "user.name='github-actions[bot]'", "-c",
"user.email='41898282+github-actions[bot]@users.noreply.github.com'", "commit", "-a", "-m",
"add git version information"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
+7724 -7061
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -3,7 +3,7 @@ name = "FreeCAD"
version = "1.0.0"
description = "pixi instructions for FreeCAD"
authors = ["looooo <sppedflyer@gmail.com>"]
channels = ["conda-forge"]
channels = ["freecad", "conda-forge"]
platforms = [ "linux-64", "linux-aarch64", "osx-64", "osx-arm64", "win-64" ]
requires-pixi = ">=0.48"
@@ -145,31 +145,31 @@ sed = "*"
sed = "*"
[target.win-64.dependencies]
pthreads-win32 = "*"
winpthreads-devel = "*"
[pypi-dependencies]
freecad-stubs = "*"
## Qt 6 Configuration Presets
[target.linux-64.tasks]
configure-debug = { cmd = [ "cmake", "--preset", "conda-linux-debug", "-DBUILD_REVERSEENGINEERING=OFF" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-linux-release", "-DBUILD_REVERSEENGINEERING=OFF" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-debug = { cmd = [ "cmake", "--preset", "conda-linux-debug" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-linux-release" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
[target.linux-aarch64.tasks]
configure-debug = { cmd = [ "cmake", "--preset", "conda-linux-debug", "-DBUILD_REVERSEENGINEERING=OFF" ], depends-on= ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-linux-release", "-DBUILD_REVERSEENGINEERING=OFF" ], depends-on= ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-debug = { cmd = [ "cmake", "--preset", "conda-linux-debug" ], depends-on= ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-linux-release" ], depends-on= ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
[target.osx-64.tasks]
configure-debug = { cmd = [ "cmake", "--preset", "conda-macos-debug", "-DBUILD_REVERSEENGINEERING=OFF" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-macos-release", "-DBUILD_REVERSEENGINEERING=OFF" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-debug = { cmd = [ "cmake", "--preset", "conda-macos-debug" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-macos-release" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
[target.osx-arm64.tasks]
configure-debug = { cmd = [ "cmake", "--preset", "conda-macos-debug", "-DBUILD_REVERSEENGINEERING=OFF" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-macos-release", "-DBUILD_REVERSEENGINEERING=OFF" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-debug = { cmd = [ "cmake", "--preset", "conda-macos-debug" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-macos-release" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
[target.win-64.tasks]
configure-debug = { cmd = [ "cmake", "--preset", "conda-windows-debug", "-DBUILD_REVERSEENGINEERING=OFF", "-DCMAKE_GENERATOR_PLATFORM=", "-DCMAKE_GENERATOR_TOOLSET=" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-windows-release", "-DBUILD_REVERSEENGINEERING=OFF", "-DCMAKE_GENERATOR_PLATFORM=", "-DCMAKE_GENERATOR_TOOLSET=" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-debug = { cmd = [ "cmake", "--preset", "conda-windows-debug", "-DCMAKE_GENERATOR_PLATFORM=", "-DCMAKE_GENERATOR_TOOLSET=" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
configure-release = { cmd = [ "cmake", "--preset", "conda-windows-release", "-DCMAKE_GENERATOR_PLATFORM=", "-DCMAKE_GENERATOR_TOOLSET=" ], depends-on = ["initialize"], env={ CFLAGS="", CXXFLAGS="", DEBUG_CFLAGS="", DEBUG_CXXFLAGS="" }}
freecad-debug = { cmd = [ ".pixi/envs/default/Library/bin/FreeCAD.exe" ], depends-on = ["install-debug"]}
freecad-release = { cmd = [ ".pixi/envs/default/Library/bin/FreeCAD.exe" ], depends-on = ["install-release"]}
+3
View File
@@ -630,6 +630,9 @@ fs::path ApplicationDirectories::findHomePath(const char* sCall)
#include <cstdio>
#include <cstdlib>
#include <sys/param.h>
#if defined(__FreeBSD__)
#include <sys/sysctl.h>
#endif
fs::path ApplicationDirectories::findHomePath(const char* sCall)
{
+44 -23
View File
@@ -31,31 +31,38 @@ namespace App
class Application;
/// Helper class to manager transaction (i.e. undo/redo)
/**
* @brief A helper class to manage transactions (i.e. undo/redo).
*
* An AutoTransaction object is meant to be allocated on the stack and governs
* the transactions in that scope.
*/
class AppExport AutoTransaction
{
public:
/// Private new operator to prevent heap allocation
/// Delete the new operator to prevent heap allocation.
void* operator new(std::size_t) = delete;
public:
/** Constructor
/**
* @brief Construct an auto transaction.
*
* @param name: optional new transaction name on construction
* @param tmpName: if true and a new transaction is setup, the name given is
* @param[in] name: optional new transaction name on construction
* @param[in] tmpName: if true and a new transaction is setup, the name given is
* considered as temporary, and subsequent construction of this class (or
* calling Application::setActiveTransaction()) can override the transaction
* name.
*
* The constructor increments an internal counter
* (Application::_activeTransactionGuard). The counter prevents any new
* active transaction being setup. It also prevents close (i.e. commits) the
* current active transaction until it reaches zero. It does not have any
* effect on aborting transaction, though.
* active transactions being setup. It also prevents to close
* (i.e. commits) the current active transaction until it reaches zero. It
* does not have any effect on aborting transactions though.
*/
AutoTransaction(const char* name = nullptr, bool tmpName = false);
/** Destructor
/**
* @brief Destruct an auto transaction.
*
* This destructor decrease an internal counter
* (Application::_activeTransactionGuard), and will commit any current
@@ -63,15 +70,19 @@ public:
*/
~AutoTransaction();
/** Close or abort the transaction
/**
* @brief Close or abort the transaction.
*
* This function can be used to explicitly close (i.e. commit) the
* transaction, if the current transaction ID matches the one created inside
* the constructor. For aborting, it will abort any current transaction
* the constructor. For aborting, it will abort any current transaction.
*
* @param[in] abort: if true, abort the transaction; otherwise, commit it.
*/
void close(bool abort = false);
/** Enable/Disable any AutoTransaction instance in the current stack
/**
* @brief Enable/Disable any AutoTransaction instance on the current stack.
*
* Once disabled, any empty temporary named transaction is closed. If there
* are non-empty or non-temporary named active transaction, it will not be
@@ -79,6 +90,8 @@ public:
*
* This function may be used in, for example, Gui::Document::setEdit() to
* allow a transaction live past any command scope.
*
* @param[in] enable: if true, enable the AutoTransaction; otherwise, disable it.
*/
static void setEnable(bool enable);
@@ -87,47 +100,55 @@ private:
};
/** Helper class to lock a transaction from being closed or aborted.
/**
* @brief Helper class to lock a transaction from being closed or aborted.
*
* The helper class is used to protect some critical transaction from being
* The helper class is used to protect some critical transactions from being
* closed prematurely, e.g. when deleting some object.
*/
class AppExport TransactionLocker
{
public:
/** Constructor
* @param lock: whether to activate the lock
/**
* @brief Construct a transaction locker.
*
* @param[in] lock: whether to activate the lock
*/
TransactionLocker(bool lock = true);
/** Destructor
* Unlock the transaction is this locker is active
/**
* @brief Destruct a transaction locker.
*
* Unlock the transaction if this locker is active
*/
~TransactionLocker();
/** Activate or deactivate this locker
* @param enable: whether to activate the locker
/**
* @brief Activate or deactivate this locker.
*
* An internal counter is used to support recursive locker. When activated,
* the current active transaction cannot be closed or aborted. But the
* closing call (Application::closeActiveTransaction()) will be remembered,
* and performed when the internal lock counter reaches zero.
*
* @param enable: whether to activate the locker
*/
void activate(bool enable);
/// Check if the locker is active
/// Check if the locker is active.
bool isActive() const
{
return active;
}
/// Check if transaction is being locked
/// Check if transaction is being locked.
static bool isLocked();
friend class Application;
public:
/// Private new operator to prevent heap allocation
/// Delete the new operator to prevent heap allocation.
void* operator new(std::size_t) = delete;
private:
+2 -2
View File
@@ -199,12 +199,12 @@ const std::string& ComplexGeoData::elementMapPrefix()
std::string ComplexGeoData::getElementMapVersion() const
{
return "4";
return "5";
}
bool ComplexGeoData::checkElementMapVersion(const char* ver) const
{
return !boost::equals(ver, "3") && !boost::equals(ver, "4") && !boost::starts_with(ver, "3.");
return !boost::ends_with(ver, "5");
}
size_t ComplexGeoData::getElementMapSize(bool flush) const
+1 -1
View File
@@ -279,7 +279,7 @@ public:
return _elementMap->setElementName(element, name, masterTag, sid, overwrite);
}
bool hasElementMap()
bool hasElementMap() const
{
return _elementMap != nullptr;
}
+9 -4
View File
@@ -179,10 +179,15 @@ App::DatumElement* LocalCoordinateSystem::getDatumElement(const char* role) cons
if (featIt != features.end()) {
return static_cast<App::DatumElement*>(*featIt);
}
std::stringstream err;
err << "LocalCoordinateSystem \"" << getFullName() << "\" doesn't contain feature with role \""
<< role << '"';
throw Base::RuntimeError(err.str().c_str());
// During restore, if role lookup fails (e.g. timing issues or fallback to internal name),
// we suppress the error. The default getSubObject will try to resolve it by Internal Name next.
if (!getDocument()->testStatus(App::Document::Restoring)) {
std::stringstream err;
err << "LocalCoordinateSystem \"" << getFullName()
<< "\" doesn't contain feature with role \"" << role << '"';
throw Base::RuntimeError(err.str().c_str());
}
return nullptr;
}
App::Line* LocalCoordinateSystem::getAxis(const char* role) const
+16
View File
@@ -1792,6 +1792,12 @@ bool Document::saveToFile(const char* filename) const
// realpath is canonical filename i.e. without symlink
std::string nativePath = canonical_path(filename);
// check if file is writeable, then block the save if it is not.
Base::FileInfo originalFileInfo(nativePath);
if (originalFileInfo.exists() && !originalFileInfo.isWritable()) {
throw Base::FileException("Unable to save document because file is marked as read-only or write permission is not available.", originalFileInfo);
}
// make a tmp. file where to save the project data first and then rename to
// the actual file name. This may be useful if overwriting an existing file
// fails so that the data of the work up to now isn't lost.
@@ -2086,6 +2092,16 @@ bool Document::afterRestore(const std::vector<DocumentObject*>& objArray, bool c
FC_ERR("Failed to restore " << obj->getFullName() << ": " << e.what());
}
catch (...) {
// If a Python exception occurred, it must be cleared immediately.
// Otherwise, the interpreter remains in a dirty state, causing
// Segfaults later when FreeCAD interacts with Python.
if (PyErr_Occurred()) {
Base::Console().error("Python error during object restore:\n");
PyErr_Print(); // Print the traceback to stderr/Console
PyErr_Clear(); // Reset the interpreter state
}
d->addRecomputeLog("Unknown exception on restore", obj);
FC_ERR("Failed to restore " << obj->getFullName() << ": " << "unknown exception");
}
+52
View File
@@ -30,6 +30,7 @@
#include <Base/Console.h>
#include <Base/Matrix.h>
#include <Base/Placement.h>
#include <Base/Tools.h>
#include <Base/Writer.h>
@@ -1615,3 +1616,54 @@ void DocumentObject::onPropertyStatusChanged(const Property& prop, unsigned long
getDocument()->signalChangePropertyEditor(*getDocument(), prop);
}
}
Base::Placement DocumentObject::getPlacementOf(const std::string& sub, DocumentObject* targetObj)
{
Base::Placement plc;
auto* propPlacement = freecad_cast<App::PropertyPlacement*>(getPropertyByName("Placement"));
if (propPlacement) {
// If the object has no placement (like a Group), plc stays identity so we can proceed.
plc = propPlacement->getValue();
}
std::vector<std::string> names = Base::Tools::splitSubName(sub);
if (names.empty() || this == targetObj) {
return plc;
}
DocumentObject* subObj = getDocument()->getObject(names.front().c_str());
if (!subObj) {
return plc;
}
std::vector<std::string> newNames(names.begin() + 1, names.end());
std::string newSub = Base::Tools::joinList(newNames, ".");
return plc * subObj->getPlacementOf(newSub, targetObj);
}
Base::Placement DocumentObject::getPlacement() const
{
Base::Placement plc;
if (auto* prop = getPlacementProperty()) {
plc = prop->getValue();
}
return plc;
}
App::PropertyPlacement* DocumentObject::getPlacementProperty() const
{
if (auto linkExtension = getExtensionByType<App::LinkBaseExtension>(true)) {
if (auto linkPlacementProp = linkExtension->getLinkPlacementProperty()) {
return linkPlacementProp;
}
return linkExtension->getPlacementProperty();
}
return getPropertyByName<App::PropertyPlacement>("Placement");
}
+13
View File
@@ -27,9 +27,11 @@
#include <App/TransactionalObject.h>
#include <App/PropertyExpressionEngine.h>
#include <App/PropertyGeo.h>
#include <App/PropertyLinks.h>
#include <App/PropertyStandard.h>
#include <Base/SmartPtrPy.h>
#include <Base/Placement.h>
#include <bitset>
#include <unordered_map>
@@ -708,6 +710,17 @@ public:
/// Check if the subname reference ends with hidden marker.
static const char* hasHiddenMarker(const char* subname);
/* Find the placement of a target object as seen from this.
If no targetObj given, the last object found in the subname is used as target.
*/
virtual Base::Placement getPlacementOf(const std::string& sub, DocumentObject* targetObj = nullptr);
/* Returns the Placement property value if any.*/
virtual Base::Placement getPlacement() const;
/* Returns the Placement property to use if any*/
virtual App::PropertyPlacement* getPlacementProperty() const;
protected:
/// recompute only this object
virtual App::DocumentObjectExecReturn* recompute();
+7
View File
@@ -329,3 +329,10 @@ class DocumentObject(ExtensionContainer):
Return true if the object is part of a document, false otherwise.
"""
...
def getPlacementOf(self, subname: str, target: DocumentObject = None, /) -> Any:
"""
Return the placement of the sub-object relative to the link object.
getPlacementOf(subname, [targetObj]) -> Base.Placement
"""
...
+30
View File
@@ -23,6 +23,7 @@
#include <Base/GeometryPyCXX.h>
#include <Base/MatrixPy.h>
#include <Base/PlacementPy.h>
#include <Base/PyWrapParseTupleAndKeywords.h>
#include "DocumentObject.h"
@@ -1003,3 +1004,32 @@ void DocumentObjectPy::setNoTouch(Py::Boolean value)
{
getDocumentObjectPtr()->setStatus(ObjectStatus::NoTouch, value.isTrue());
}
PyObject* DocumentObjectPy::getPlacementOf(PyObject* args)
{
char* subname;
PyObject* target = Py_None; // Initialize to None
if (!PyArg_ParseTuple(args, "s|O", &subname, &target)) {
return nullptr;
}
App::DocumentObject* targetObj = nullptr;
// Check if a target was provided and is not None
if (target && target != Py_None) {
// Now perform the type check manually
if (!PyObject_TypeCheck(target, &DocumentObjectPy::Type)) {
PyErr_SetString(PyExc_TypeError, "Target argument must be a DocumentObject or None");
return nullptr;
}
targetObj = static_cast<DocumentObjectPy*>(target)->getDocumentObjectPtr();
}
PY_TRY
{
Base::Placement p = getDocumentObjectPtr()->getPlacementOf(subname, targetObj);
return new Base::PlacementPy(new Base::Placement(p));
}
PY_CATCH
}
+5 -1
View File
@@ -1192,7 +1192,11 @@ void ElementMap::addChildElements(long masterTag, const std::vector<MappedChildE
// do child mapping only if the child element count >= 5
const int threshold {5};
if ((child.count >= threshold && child.tag != 0) || !child.elementMap) {
// skip encoding only when masterTag=0, child.tag=0, and count is exactly at threshold
bool skipEncoding = (masterTag == 0 && child.tag == 0 && child.count == threshold && child.elementMap);
if ((child.count >= threshold && !skipEncoding) || !child.elementMap) {
encodeElementName(child.indexedName[0],
tmp,
ss,
+98
View File
@@ -25,6 +25,7 @@
#include <App/DocumentObjectPy.h>
#include <Base/Interpreter.h>
#include <Base/MatrixPy.h>
#include <Base/PlacementPy.h>
#include <Base/Tools.h>
#include "FeaturePython.h"
@@ -632,6 +633,103 @@ bool FeaturePythonImp::editProperty(const char* name)
return false;
}
FeaturePythonImp::ValueT FeaturePythonImp::isLink() const
{
_FC_PY_CALL_CHECK(isLink, return (NotImplemented));
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(object->getPyObject(), true));
Py::Boolean ok(Base::pyCall(py_isLink.ptr(), args.ptr()));
return ok ? Accepted : Rejected;
}
catch (Py::Exception&) {
if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
PyErr_Clear();
return NotImplemented;
}
Base::PyException e; // extract the Python error text
e.reportException();
return Rejected;
}
}
FeaturePythonImp::ValueT FeaturePythonImp::isLinkGroup() const
{
_FC_PY_CALL_CHECK(isLinkGroup, return (NotImplemented));
Base::PyGILStateLocker lock;
try {
Py::Tuple args(1);
args.setItem(0, Py::Object(object->getPyObject(), true));
Py::Boolean ok(Base::pyCall(py_isLinkGroup.ptr(), args.ptr()));
return ok ? Accepted : Rejected;
}
catch (Py::Exception&) {
if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
PyErr_Clear();
return NotImplemented;
}
Base::PyException e; // extract the Python error text
e.reportException();
return Rejected;
}
}
bool FeaturePythonImp::getPlacementOf(
Base::Placement& ret,
const char* subname,
App::DocumentObject* target
) const
{
FC_PY_CALL_CHECK(getPlacementOf); // Standard macro check
Base::PyGILStateLocker lock;
try {
Py::Tuple args(3);
// Arg 0: The object itself
args.setItem(0, Py::Object(object->getPyObject(), true));
// Arg 1: The subname string
args.setItem(1, Py::String(subname ? subname : ""));
// Arg 2: The target object (or None)
if (target) {
args.setItem(2, Py::Object(target->getPyObject(), true));
}
else {
args.setItem(2, Py::None());
}
// Call the Python method
Py::Object res(Base::pyCall(py_getPlacementOf.ptr(), args.ptr()));
// Check if Python returned None (implies "use base implementation")
if (res.isNone()) {
return false;
}
// Check return type
if (!PyObject_TypeCheck(res.ptr(), &Base::PlacementPy::Type)) {
throw Py::TypeError("getPlacementOf expects a Base.Placement object return");
}
// Convert Python object back to C++ Placement
ret = *static_cast<Base::PlacementPy*>(res.ptr())->getPlacementPtr();
return true;
}
catch (Py::Exception&) {
if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) {
PyErr_Clear();
return false;
}
Base::PyException e;
e.reportException();
return false;
}
}
// ---------------------------------------------------------
namespace App
+44 -1
View File
@@ -91,6 +91,11 @@ public:
bool editProperty(const char* propName);
ValueT isLink() const;
ValueT isLinkGroup() const;
bool getPlacementOf(Base::Placement& ret, const char* subname, App::DocumentObject* target) const;
private:
App::DocumentObject* object;
bool has__object__ {false};
@@ -114,7 +119,10 @@ private:
FC_PY_ELEMENT(hasChildElement) \
FC_PY_ELEMENT(isElementVisible) \
FC_PY_ELEMENT(setElementVisible) \
FC_PY_ELEMENT(editProperty)
FC_PY_ELEMENT(editProperty) \
FC_PY_ELEMENT(isLink) \
FC_PY_ELEMENT(isLinkGroup) \
FC_PY_ELEMENT(getPlacementOf)
#define FC_PY_ELEMENT_DEFINE(_name) Py::Object py_##_name;
@@ -349,6 +357,41 @@ public:
}
}
bool isLink() const override
{
switch (imp->isLink()) {
case FeaturePythonImp::Accepted:
return true;
case FeaturePythonImp::Rejected:
return false;
default:
return FeatureT::isLink();
}
}
bool isLinkGroup() const override
{
switch (imp->isLinkGroup()) {
case FeaturePythonImp::Accepted:
return true;
case FeaturePythonImp::Rejected:
return false;
default:
return FeatureT::isLinkGroup();
}
}
Base::Placement getPlacementOf(const std::string& sub, DocumentObject* targetObj = nullptr) override
{
Base::Placement ret;
// Try to call the python implementation first
if (imp->getPlacementOf(ret, sub.c_str(), targetObj)) {
return ret;
}
// Fallback to C++ implementation
return FeatureT::getPlacementOf(sub, targetObj);
}
PyObject* getPyObject() override
{
if (FeatureT::PythonObject.is(Py::_None())) {
+2 -33
View File
@@ -316,42 +316,11 @@ Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj,
App::DocumentObject* rootObj,
const std::string& sub)
{
if (!targetObj || !rootObj) {
if (!rootObj) {
return Base::Placement();
}
std::vector<std::string> names = Base::Tools::splitSubName(sub);
App::Document* doc = rootObj->getDocument();
Base::Placement plc = getPlacementFromProp(rootObj, "Placement");
if (targetObj == rootObj) {
return plc;
}
if (rootObj->isLink()) {
// Update doc in case its an external link.
doc = rootObj->getLinkedObject()->getDocument();
}
for (auto& name : names) {
App::DocumentObject* obj = doc->getObject(name.c_str());
if (!obj) {
return Base::Placement();
}
plc = plc * getPlacementFromProp(obj, "Placement");
if (obj == targetObj) {
return plc;
}
if (obj->isLink()) {
// Update doc in case its an external link.
doc = obj->getLinkedObject()->getDocument();
}
}
// If targetObj has not been found there's a problem
return Base::Placement();
return rootObj->getPlacementOf(sub, targetObj);
}
Base::Placement GeoFeature::getGlobalPlacement(App::DocumentObject* targetObj,

Some files were not shown because too many files have changed in this diff Show More