* Sketcher: Fix symmetry of slot redundancy false positive
Perturb symmetric geometries when using the 'create symmetric constraints' option to avoid numerical singularities in the solver (Jacobian Rank).
If geometry is "perfect", the solver cannot distinguish between the derivative of a Symmetry constraint and an Equal constraint, flagging one as redundant.
* BIM: Implement smart base removal for Walls
Previously, removing the Base object from an Arch Wall would cause the
wall to reset its position to the document origin and could lead to
unintended geometric changes for complex walls.
This commit introduces a "smart debasing" mechanism integrated into the
Component Task Panel's "Remove" button:
- For walls based on a single straight line, the operation now preserves
the wall's global position and parametric `Length`, making it an
independent object.
- For walls with complex bases (multi-segment, curved), a warning dialog
is now presented to the user, explaining the consequences (shape
alteration and position reset) before allowing the operation to
proceed.
This is supported by new API functions `Arch.is_debasable()` and
`Arch.debaseWall()`, which contain the core logic for the feature.
Fixes: https://github.com/FreeCAD/FreeCAD/issues/24453
* BIM: Move wall debasing logic into ArchWall proxy
The logic for handling the removal of a wall's base object was previously
implemented directly within the generic `ComponentTaskPanel` in
`ArchComponent.py`. This created a tight coupling, forcing the generic
component UI to have specific knowledge about the `ArchWall` type.
This commit refactors the implementation to follow a more object-oriented
and polymorphic design:
1. A new overridable method, `handleComponentRemoval(subobject)`, has been
added to the base `ArchComponent` proxy class. Its default implementation
maintains the standard removal behavior.
2. The `_Wall` proxy class in `ArchWall.py` now overrides this method. All
wall-specific debasing logic, including the eligibility check and the
user-facing warning dialog, now resides entirely within this override.
3. The `ComponentTaskPanel.removeElement` method has been simplified. It is
now a generic dispatcher that calls `handleComponentRemoval` on the
proxy of the object being edited, with no specific knowledge of object types.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* BIM: Add interactive creation of baseless walls
Introduce a new workflow for creating Arch Walls without a dependency on
a baseline object (e.g., a Draft Line).
- The `Arch_Wall` command is enhanced with a "No baseline" mode, controlled
by a new "Walls baseline" preference, allowing users to create
placement-driven walls directly in the 3D view.
- The existing `debaseWall` function has been refactored for correctness
and consistency with the new baseless wall geometry.
Co-authored-by: Yorik van Havre <yorik@uncreated.net>
* BIM: Refactor structure of the Arch Wall command
Refactor the `Arch_Wall` GUI command (`BimWall.py`) for improved
readability, maintainability, and architectural clarity.
- A `WallBaselineMode` Enum is introduced to replace the original
integer values, making the code self-documenting.
- The monolithic `create_wall` method is broken down into smaller,
single-responsibility helper functions for each creation mode.
- The `addDefault` method has been removed, with its logic
integrated into the new structure.
* BIM: Add Draft Stretch support for baseless walls
This commit makes the new baseless Arch Walls graphically editable using
the `Draft_Stretch` tool.
- An API for stretching (`calc_endpoints` and `set_from_endpoints`)
has been added to the `ArchWall` proxy.
- The `Draft_Stretch` tool is now aware of baseless walls and calls this
new proxy API to perform the stretch operation, enabling users to
stretch them.
Co-authored-by: Yorik van Havre <yorik@uncreated.net>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* BIM: address CodeQL warnings
* BIM: Fix wall alignment for GUI creation of baseless walls
Fixes an issue whereby creating a baseless wall from the GUI would
ignore the selected `Align` property, always resulting in a
center-aligned wall.
- The underlying geometry generation for baseless walls now correctly
honors the `Align` property passed by the GUI and API.
- To ensure predictable behavior, the implementation uses the same
geometric convention as walls built from a base object, making the
`Align` property work uniformly for all wall types.
- This also corrects the behavior of the `Arch.makeWall` function for
baseless walls.
- Update unit tests to test wall alignment.
* BIM: Refactor wall geometry generation for improved clarity and maintainability
Improves the internal logic for wall geometry creation, addressing CodeQL warnings and enhancing overall maintainability without changing external behavior.
- The `build_base_from_scratch` method is refactored to unify the separate logic paths for single- and multi-layer walls, reducing code duplication.
- A local helper function is introduced to create face geometry, for better modularity and readability.
- In the `_Wall.execute` method, the control flow that relied on implicit type checking is replaced with an explicit strategy pattern for fusing solids, making the logic more robust.
- Variable names are made more descriptive.
- A NumPy-style docstring is added to better document the function.
* Draft: fix stretching of rotated baseless walls
* BIM: add unit test for stretching baseless walls
* BIM: add regression tests for working-plane-relative coordinates and reuse of base sketches
* BIM: Fix baseless wall creation to respect the working plane
Corrects an issue where baseless walls were created using global
coordinates instead of being relative to the active Draft working plane.
The calculated local placement of the wall is now correctly transformed
into the global coordinate system by multiplying it with the working
plane's placement.
* BIM: Ensure unique baselines for subsequent wall creation
Fixes a bug where creating multiple walls with baselines would
incorrectly reuse the same underlying Sketch or Draft Line object.
The object retrieval logic after the `doCommand` call now correctly uses
`ActiveObject` to get a reliable reference to the new object instead of
relying on a hardcoded name.
* BIM: Make the wall's base object label translatable
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* BIM: use singular for consistency with other labels
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
* Fix typo
* BIM: address reviewer's comments about improving object reference passing between Python and FreeCAD contexts, and functions
* BIM: remove defensive programming: the callback is only executed as a result of a user's GUI action
* BIM: use the params API to define WallBaseline parameter
* BIM: add Arch Wall tests for joining wall logic
* BIM: add joining logic
* BIM: re-add ArchSketch support
* BIM: re-add multimaterial support on wall creation
* BIM: address CodeQL warning, remove module duplication
* BIM: fix check for SketchArch module when creating sketch-based walls
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Yorik van Havre <yorik@uncreated.net>
Co-authored-by: Roy-043 <70520633+Roy-043@users.noreply.github.com>
* Part: Fix Part_Extrude taper angle regression for internal faces
The taper angle for holes (inner wires) in `Part_Extrude` was not being
negated after the toponaming refactor, causing internal faces to taper
in the wrong direction compared to v0.21.2.
The original makeDraft function correctly handled inner wires by:
- Negating taper for all inner wires in Part_Extrude
- Negating taper only for multi-edge inner wires in PartDesign
This logic was controlled via an isPartDesign function parameter.
When makeElementDraft was introduced for toponaming support, it was
designed to use innerTaperAngleFwd/innerTaperAngleRev fields that were
never ported from realthunder's branch. The cleanup (commit 709eab3018)
removed references to these non-existent fields, leaving makeElementDraft
with no inner wire taper handling at all.
So, this fix ports the makeDraft inner wire logic to makeElementDraft by
adding the flag, and counting wires and then triggering proper angle
flip depending on the flag/wire situation.
---------
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Arc segments with extremely large radius compared to chord length can
cause floating-point precision issues in simulation. This change
introduces ARC_LINEARIZATION_THRESHOLD to treat such arcs as linear,
improving numerical stability in the simulator.
The following g-code was causing erractic behavior in the simulator due
to large-radius arcs:
```
G2 I88775.835760 J-1936991.545892 K0.000000 X102.063107 Y100.102815 Z12.700001
```
src/Mod/CAM/PathSimulator/AppGL/MillPathSegment.cpp:
- Added ARC_LINEARIZATION_THRESHOLD constant
- Updated arc motion detection to treat large-radius arcs as linear
- Improved handling of arc vs. linear segment classification
* Add None check before constraining new_point
* [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>
* Gui: Add common types to Add Property dialog
Add a preselection of commonly used types in the Add Property dialog.
The dialog supports now all properties that have an editor. This
doesn't necessarily mean that the editor is shown in the Add Property
dialog; some properties should not show their editor in the Add Property
dialog, such as vector and placement.
* Gui: Make Add Property dialog Qt 6 compatible
This change stops using a Qt 6.10 feature and makes it compatible with
all of Qt 6.
* Update src/Gui/Dialogs/DlgAddProperty.cpp
---------
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
* added a copy button which copies all the errors and traceback to clipboard
* removed unused variable
* removed space at end of Copy string
* copied text notification in status bar
* removed unwanted header
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Test: Address review comments
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
This is followup for https://github.com/FreeCAD/FreeCAD/pull/26563 which
fixed previews for a given file but broke it for others.
This approach should be more robust as it is applied in the Feature
itself and not on view provider level which should give us more precise
control and per feature transform ability.
This commit introduces PreviewUpdateScheduler class that is responsible
to schedule the true recompute of the preview. View Providers (or other
components) can use this service to ask for the preview recompute to
happend at a time that is convinent for a program and that won't impact
performance.
The provided implementation uses Queued Connections in Qt to calculate
preview essentially on next run of the event loop. It allows business
logic in FreeCAD (like property propagation) to execute fully and then
recompute preview once. This greately reduces number of recompute calls
for previews.
- The initial commit to block shortcuts in text edit fields
(particularly for MacOS, where those shortcuts would activate FreeCAD
functionality rather than text edit functionality) made a wrong
assumption.
- It assumed that there were no text edit fields where we would want to
actually use application shortcuts. In retrospect, this was very
wrong, and I completely missed the macro editor.
- For now, it should be fine to change the field to only cover
'LineEdit'. I cannot imagine a case where you'd want to (e.g.) save
text/document from a LineEdit, but if anyone knows of one then please
let me know.
- This does mean there are some quirks. For example in the materials
editor, the description is a TextEdit field. Some text editing
shortcuts won't work in here now (similar to how they didn't before
the original commit that I made).
- I've since learned that freecad also has a text editor functionality,
I've tested that now Cmd+S works for save as it should.
Major refactor of the Machine Editor to use QTabWidget for section
navigation. Added tabbed spindle management with add/remove
functionality, split machine configuration into Output Options, G-Code
Blocks, and Processing Options tabs. Updated preferences UI to use tabs
instead of QToolBox.
src/Mod/CAM/Gui/Resources/preferences/PathJob.ui:
- Replace QToolBox with QTabWidget for preferences tabs
src/Mod/CAM/Path/Dressup/Gui/Preferences.py:
- Use QWidget with vertical layout instead of QToolBox for dressup
preferences
src/Mod/CAM/Path/Machine/ui/editor/machine_editor.py:
- Refactor to use QTabWidget for editor sections
- Implement tabbed spindle management with add/remove
- Split configuration into Output Options, G-Code Blocks, and Processing
Options tabs
- Update post processor selection logic
src/Mod/CAM/Path/Main/Gui/PreferencesJob.py:
- Update to use tabWidget instead of toolBox
src/Mod/CAM/Path/Tool/assets/ui/preferences.py:
- Use QWidget and direct layout instead of QToolBox for asset
preferences
This recompute seemed unnecessary, and caused slowdowns when opening the file and recomputing. This decreases the time necessary to both open and recompute files that use boolean operations, and should not change anything regarding preview computation when the dialog is open.
* Adding retract annotation to drilling commands
checkpoint
* [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>
* CAM: Dropped trailing percent from fanuc post processor output.
A trailing percent cause one Fanuc controller to hang when the program
is completed when drip feeding G code, and the minicom ascii upload
was unable to complete the upload.
Had to use emergecy stop to get the machine out of the hang.
* CAM: Adjust Fanuc post processor test to no longer expect trailing percent.
* Patch for DXF without CODE30 (Z for POINT)
Time to time I use DXF file from measurement microscope without Z for POINT.
This patch help me for download this files without errors.
* [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>