Furgo 6812de49a3 BIM: implement baseless walls creation (#24595)
* 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>
2026-01-13 09:30:37 +01:00
2026-01-10 12:30:35 +01:00
2025-11-23 10:54:51 -03:00
2025-11-11 13:45:27 +01:00
2025-11-23 10:54:51 -03:00
2024-07-14 09:24:22 +02:00
2025-10-06 11:43:26 -05:00
2025-10-25 14:37:36 -05:00

Your own 3D Parametric Modeler

WebsiteDocumentationForumBug trackerGit repositoryBlog

Release Crowdin

Overview

  • Freedom to build what you want FreeCAD is an open-source parametric 3D modeler made primarily to design real-life objects of any size. Parametric modeling allows you to easily modify your design by going back into your model history to change its parameters.

  • Create 3D from 2D and back FreeCAD lets you sketch geometry-constrained 2D shapes and use them as a base to build other objects. It contains many components to adjust dimensions or extract design details from 3D models to create high quality production-ready drawings.

  • Designed for your needs FreeCAD is designed to fit a wide range of uses including product design, mechanical engineering and architecture, whether you are a hobbyist, programmer, experienced CAD user, student or teacher.

  • Cross platform FreeCAD runs on Windows, macOS and Linux operating systems.

  • Underlying technology

    • OpenCASCADE A powerful geometry kernel, the most important component of FreeCAD
    • Coin3D library Open Inventor-compliant 3D scene representation model
    • Python FreeCAD offers a broad Python API
    • Qt Graphical user interface built with Qt

Installing

Precompiled packages for stable releases are available for Windows, macOS and Linux on the latest releases page.

On most Linux distributions, FreeCAD is also directly installable from the software center application.

For weekly development releases visit the releases page.

Other options are described on the wiki Download page.

Compiling

FreeCAD requires several dependencies to correctly compile for development and production builds. The following pages contain updated build instructions for their respective platforms:

Reporting Issues

To report an issue please:

  • Consider posting to the Forum, Discord channel, or Reddit to verify the issue;
  • Search the existing issues for potential duplicates;
  • Use the most updated stable or development versions of FreeCAD;
  • Post version info from Help > About FreeCAD > Copy to clipboard;
  • Restart FreeCAD in safe mode Help > Restart in safe mode and try to reproduce the issue again. If the issue is resolved it can be fixed by deleting the FreeCAD config files.
  • Start recording a macro Macro > Macro recording... and repeat all steps. Stop recording after the issue occurs and upload the saved macro or copy the macro code in the issue;
  • Post a Step-By-Step explanation on how to recreate the issue;
  • Upload an example file (FCStd as ZIP file) to demonstrate the problem;

For more details see:

Note

The FPA offers developers the opportunity to apply for a grant to work on projects of their choosing. Check jobs and funding to know more.

Usage & Getting Help

The FreeCAD wiki contains documentation on general FreeCAD usage, Python scripting, and development. View these pages for more information:

The FreeCAD forum is a great place to find help and solve specific problems when learning to use FreeCAD.


This project receives generous infrastructure support from and KiCad Services Corp.

Description
No description provided
Readme LGPL-2.1 7.9 GiB
2026-02-27 16:25:02 +00:00
Languages
C++ 51.5%
Python 45.8%
C 1.3%
CMake 0.8%
NSIS 0.2%
Other 0.2%