Commit Graph

574 Commits

Author SHA1 Message Date
Roy-043
483ffdae8b Rebased 2025-10-20 09:00:22 -05:00
Roy-043
d95d52658f BIM: fix multi-material transparency IFC export issue (#24643)
* BIM: fix multi-material transparency IFC export issue

Fixes #22896.
2025-10-20 08:44:37 -05:00
Roy-043
b754898b0b BIM: fix Arch_RemoveShape attribute error
Fixes #24610.

Note that the command (after this PR) does not work properly (as was the case in v0.21).
2025-10-19 22:23:35 -05:00
Roy-043
5778a4c4d0 BIM: fix several dialog regressions (#24590)
* BIM: fix BIM_Classification dialog regression

* Fixed issues with more scenarios
2025-10-19 22:23:05 -05:00
Furgo
5c5f1d743f BIM: Fix widget value setting in ArchMaterial (#24710)
ArchMaterial's view provider has a setTaskValue helper to set values of widgets inside a task panel. While specific to ArchMaterial, the real place where the helper is called is at BIM_Classification. It appears it's not a general but more like an ad-hoc API for a specific purpose and for a specific object.

In any case, this fix allows widgets that expect a numerical value to have their value set. Before, their value was set as text, unexpectedly.
2025-10-19 09:13:51 +00:00
paul
c8162b34cd [ArchStairs] Fix StringerOverlap & StructureOffset (#24608)
1. Fix #24321
2. Fix - The 'Structure Offset' property does not allow to insert negative values

(Forum Discussion
- https://forum.freecad.org/viewtopic.php?t=100060 contains discussion on the above 2 issues)
2025-10-18 14:44:21 +00:00
Furgo
994990c283 BIM: Prevent editing label on double-click (#24712)
Before this fix, double-clicking on an ArchMultimaterial object opened its task panel as expected. Unexpectedly, its label was selected and set for edit.

- The tree view's double-click handling expects the view-provider to declare whether it handled the double-click.
- The ViewProvider API's doubleClicked() is documented to return bool (True if handled).
- If a view provider's doubleClicked method returns None/False, the tree falls back to the default Qt behavior (which is beginning inline editing of the item label).
- In ArchMaterial.py the view provider calls self.edit() (or FreeCADGui.ActiveDocument.setEdit(...)) but the method that the tree actually calls (the view provider's doubleClicked) does not return True. Because the method returns None, the tree continues and starts inline label-editing.

In summary: setEdit returning True is fine, but doubleClicked is the method the tree checks; it must return True to suppress the default inline rename.
2025-10-18 15:34:10 +02:00
Furgo
f1b8c0dba3 BIM: replace obsolete urllib2 in BimTutorial 2025-10-16 21:21:40 +02:00
Furgo
01e87a2072 BIM: remove obsolete Python 2 urllib2 import
Python 3 combined the former `urllib`, `urllib2`, `urlparse` Python 2 modules into subpackages of `urllib`. FreeCAD is written in Python 3, thus the `urllib2` import fallback will not work and needs to be removed.
2025-10-16 21:21:40 +02:00
Chris Hennes
c1af83fb54 Merge pull request #24692 from Roy-043/BIM-improve-MultiMaterial-task-panel
BIM: improve MultiMaterial task panel
2025-10-16 12:56:20 -05:00
Furgo
c78b8930ba BIM: add missing DraftGeomUtils import (#24683)
Added import for DraftGeomUtils to ArchCommands.makeFace to prevent crash.
2025-10-16 18:00:32 +02:00
Roy-043
791e4bdd85 BIM: improve MultiMaterial task panel
Remove extra left margin from the first column in the tree view.
2025-10-16 14:58:59 +02:00
tetektoza
f43af65eca BIM: Remove icon after unclone (#24654)
As the title says - upon unclone icon is not being removed, but the
cloned item stops mirroring original item which is correct, so this just
aligns the icon removal logic with the correct behavior.
2025-10-15 10:21:38 +02:00
marcuspollio
c55e1c3bba BIM: Prevent crash when removing a wall's base component (#24633)
* BIM: Prevent crash when removing a wall's base component

When a user selected a wall's base object in the Tree View and used the
`Arch_Remove` command, a traceback occurred due to an `AttributeError`.

The `removeComponents` function was incorrectly checking for the `.Base`
attribute on a list of subtractions (`s.Base`) instead of on the parent
host object (`h.Base`).

This commit corrects the reference to check against the parent object,
resolving the crash and allowing the component to be removed.

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

Authored-by:  furgo16 <148809153+furgo16@users.noreply.github.com>

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

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

---------

Co-authored-by: Furgo <148809153+furgo16@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-14 11:19:43 +02:00
Furgo
6345b824e5 Add BIM workbench to .pre-commit-config.yaml (#21591)
* Add BIM workbench to .pre-commit-config.yaml

* pre-commit: ignore translations

* pre-commit: add additional ignore pattern

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-13 13:07:48 +02:00
DONGGEUN YOO
270cf8bb6b BIM: Fix IFC import options dialog not showing until Preferences are opened (#24574) 2025-10-11 18:22:55 +02:00
marcuspollio
384b303a85 BIM: add formatting off comments (#24502) 2025-10-08 21:48:08 +02:00
Chris Hennes
8500ed0520 Update translations 2025-10-05 2025-10-07 19:21:58 +02:00
Roy-043
a5b984cbf4 BIM: fix BimMaterial dialog regression
Fixes #24381
2025-10-05 19:12:46 -05:00
Roy-043
970b65d3b4 BIM: fix update behavior of BIM views panel (#24273)
* BIM: fix update behavior of BIM views panel

Fixes #17415
Fixes #17868

To avoid unnecessarily updating the trees an `oldData` list is used.
2025-10-05 19:05:37 -05:00
Furgo
e37b788148 BIM: Fix ArchSite View Provider lifecycle, property constraints and defaults (#23844)
* BIM: Fix Site view provider initialization and constraints

This commit fixes bugs in the `_ViewProviderSite` lifecycle, ensuring
that sun path properties are correctly initialized with valid defaults
and that their constraints are reliably restored when a document is
opened.

Previously, two main problems existed:
1. New Objects: When a new `Site` object was created, its sun path
   properties (e.g., `SunDateMonth`) would default to 0, which is an
   invalid value. The property editor in the GUI would also lack the
   appropriate min/max constraints.
2. Restored Objects: When a document containing a `Site` was opened, the
   property constraints were not reapplied. This happened because the
   view provider's initialization logic was not being reliably triggered
   due to race conditions during the document deserialization process.

These issues are addressed now by a deferred initialization sequence:

- For New Objects: In `_ViewProviderSite.__init__`, constraint and
  default value setup is deferred using `QTimer.singleShot(0)`. The
  `restoreConstraints` method also now sets sensible defaults (e.g.,
  month 6, day 21) when it detects a new object.
- For Restored Objects: The data object's `_Site.onDocumentRestored`
  hook is now used as a trigger to start the view provider's
  initialization. This is a necessary workaround, as the `ViewProvider`
  lacks its own restoration hook. This method now ensures the view
  provider's properties are present and then schedules
  `restoreConstraints` to run via `QTimer`.

* BIM: add ArchSite GUI tests and fixtures

- Additionally clean up and document the CMakeLists.txt file for better
  maintainability and readability

* BIM: Enable GUI tests on CI

- The line to enable the BIM workbench has been commented out, as
  previously it occasioned a timeout error on CI
- The BIM GUI tests have been uncommented out to enable them
2025-10-05 11:47:56 +02:00
paul
8b63c20f73 [ArchStairs] Fix Blondel Ratio and Winders (#24350)
* [ArchStairs] Fix Blondel Ratio and Winders

Fix #24065
Fix #24051

1. Blondel Ratio is not calculated, this if fixed now.  Blondel Ratio property is changed to Length following wiki's descripition.
2. Winders is not implemented as commented in wiki.  The property is not added at the moment until it is implemented.

* [ArchStairs] Fix Blondel Ratio and Winders - Remove old Property

For existing Stairs object, remove old property which is Float and add new propety which is Length.
2025-10-05 09:29:40 +02:00
Roy-043
2a805a76fb BIM: Arch_MergeWalls: issue message when walls are not the same
Fixes #21228.
2025-09-29 17:28:53 +02:00
Chris Hennes
3a91404f98 Merge pull request #21541 from furgo16/bim-refactor-arch-iter-2
BIM: Arch module refactor, Arch.makeWindow documentation and tests - iteration 2
2025-09-26 19:58:49 -05:00
Roy-043
b0cf38efb8 BIM: fix linked document of BIM_Library task panel (#24169)
* BIM: fix linked document of BIM_Library task panel

Fixes #22437.

The task panel of the BIM_Library command would be linked to the active document, which would to be the temporary Viewer document if that option was checked. Closing that document in the `Insert` function would therefore also close the task panel resulting in errors for following code.

Additionally:
The code to close the temporary Viewer document was moved to the `Reject` function. Otherwise that document would stay open if the task panel was closed without inserting.
2025-09-27 00:54:31 +00:00
Roy-043
bb043ac411 BIM: prevent dialogs being opened twice
Fixes #20403
Partly fixes issue #17983

I have basically copied Yorik's solution (#22446), but have added a call to `raise_()`.
2025-09-26 15:09:38 -05:00
Furgo
16009e9370 BIM: DEBUG, disable part of the Gui tests 2025-09-26 12:07:23 +02:00
Furgo
237060bc95 BIM: set up TestArchGui, clean up CLI/GUI tests
- Also update TechDraw templates path after reorganization from https://github.com/FreeCAD/FreeCAD/pull/23719
2025-09-26 00:46:16 +02:00
Furgo
2d668b1f4e BIM: ArchWindow, add unit tests
TODO: check comments on test_create_with_width_height_no_baseobj_initially
2025-09-26 00:46:01 +02:00
Furgo
53587a246d BIM: Arch.makeWindow, expand docstring, add examples 2025-09-25 18:51:33 +02:00
Furgo
fec92e568d BIM: Arch.makeWindow, add type hinting 2025-09-25 18:51:33 +02:00
Chris Hennes
1c6d9c79fb Update translations 2025-09-25 2025-09-25 17:25:13 +02:00
Gaël Écorchard
0c54b11f12 BIM: fix regression in DAE import, support for polylists (#24031)
* BIM: fix regression in DAE import, support for polylists

The support for non-triangular faces was remove in
commit 346c7581d4.
Now, the support for them is restored, by triangulating them
during the import (with a warning and changing the object name).

Signed-off-by: Gaël Écorchard <gael@km-robotics.cz>

* BIM: Remove translation calls console

Use raw strings for console messages, as they are usually not
translated.

---------

Signed-off-by: Gaël Écorchard <gael@km-robotics.cz>
Co-authored-by: Gaël Écorchard <gael@km-robotics.cz>
2025-09-25 14:28:05 +02:00
Furgo
8a83cdab46 Apply wording suggestions from code review
Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>
2025-09-25 14:26:54 +02:00
Furgo
9b0ac4370b BIM: enable live updates of the cut when changing placement 2025-09-25 14:26:54 +02:00
Furgo
e00e0011ab BIM: redesign rotation, center and resize controls 2025-09-25 14:26:54 +02:00
Furgo
a1bfc2afb5 BIM: separate scope and placement & visuals in Task panel 2025-09-25 14:26:54 +02:00
Furgo
f4e642a729 BIM: Fix inverted cut direction for rotated SectionPlane
Rotating an ArchSectionPlane object caused its cutting effect to flip,
affecting both the live `CutView` and 2D projections. The
`_SectionPlane.execute()` method incorrectly tried to auto-correct the
orientation of a temporary plane before applying the object's final
placement. The fix refactors this to a "transform-then-verify" pattern:
the object's full `Placement` is now applied to the temporary plane
first, and only then is the resulting face's actual normal validated
against the intended normal from the `Placement`. This ensures the
`Shape` is always geometrically consistent with the `Placement`, making
the cut direction predictable at all angles.
2025-09-25 14:26:54 +02:00
Furgo
50d98ceeb7 BIM: make cut view a toggle button 2025-09-25 14:26:54 +02:00
Furgo
9359af070a BIM: Use correct icon for SectionPlane 2025-09-25 14:26:54 +02:00
Furgo
4e2ea3bc2d BIM: Change SectionPlane task panel button from OK to Close 2025-09-25 14:26:54 +02:00
Furgo
d0ff3e8dee BIM: Fix SectionPlane's label being editable on double-click 2025-09-25 14:26:54 +02:00
Furgo
50122d651c BIM: add Cut View toggle on SectionPlane task panel 2025-09-25 14:26:54 +02:00
Pascal de Bruijn
ea30e5bbb9 TechDraw: reorganize Templates (#23719) 2025-09-23 13:40:13 -05:00
Paul Lee
c379d5d713 [ArchCurtainWall] Regression Curve Support
Fix https://github.com/FreeCAD/FreeCAD/issues/23945

"Arch_CurtainWall results in an error when trying to create it based on a sketch consisting of spline or arc."

This fixes the regression introduced in -
147e97d407 (diff-b4849bbc0941a0f60f25d13c40d4bfeca94171f55bd78a6196362343c3fdcf6fR287)
2025-09-22 17:30:35 +02:00
Roy-043
a5763bee07 BIM: fix material handling of equipment 2025-09-22 17:26:58 +02:00
luzpaz
975b8103ff BIM: Pin upstream pyshp shapefile.py URL to version 2.4.1
This is the safest solution for now until someone can vet the upstream breaking changes (https://github.com/GeospatialPython/pyshp/blob/master/README.md#breaking-changes)
2025-09-19 09:58:43 +02:00
luzpaz
a7d8cdecd6 BIM: Update shapefile import URL to latest version
Fixes #23911
2025-09-19 09:58:43 +02:00
Chris Hennes
02721eec37 Update translations 2025-09-15 2025-09-16 09:55:13 +02:00
FEA-eng
06737f7dee Fix typos in the strings reported in Crowdin (#23956)
* BIM: Update dialogWelcome.ui

* BIM: Update dialogWelcome.ui

* Mesh: Update Command.cpp

* MeshPart: Update Tessellation.cpp

* Mesh: Update Selection.ui

* Robot: Update TaskTrajectoryDressUpParameter.ui

* Core: Update MayaGestureNavigationStyle.cpp

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-15 21:51:56 -05:00