FreeCAD / FreeCAD

This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler.
https://www.freecad.org
Other
19.42k stars 4.01k forks source link

BIM: Recompute issue related to Roof subtraction #17071

Open Roy-043 opened 5 days ago

Roy-043 commented 5 days ago

Is there an existing issue for this?

Problem description

In the attached file a roof has been subtracted from two wall. But the result is only correct for one of the walls. Getting the other wall to update requires a certain recompute sequence.

  1. Open the file.
  2. Select "OG Wände" ("2nd floor walls").
  3. Right-click and select "Recompute object" from the Tree view context menu.
  4. The roof is now correctly subtracted. Also openings for widows and doors show.
  5. Invoke Std_Refresh to recompute the objects that now require this.
  6. Result: Everything seems OK now.
  7. Right-click the document and select "Mark to recompute".
  8. Invoke Std_Refresh.
  9. Result: There is a "OG Wände has no solid" warning which seems incorrect.

If you just open the file and only follow steps 7 and 8 "OG Wände" does not update.

File (remove .zip): Dachtest2.FCStd.zip

Forum post: https://forum.freecad.org/viewtopic.php?p=782628

Full version info

OS: Windows 8 build 9600
Word size of FreeCAD: 64-bit
Version: 1.1.0dev.38871 (Git)
Build type: Release
Branch: main
Hash: 813ee36cb80e0d29c2c9b991a7b2fee2c61f5cf6
Python 3.11.9, Qt 5.15.13, Coin 4.0.3, Vtk 9.2.6, OCC 7.7.2
Locale: Dutch/Netherlands (nl_NL)
Stylesheet/Theme/QtStyle: unset/FreeCAD Classic/Qt default
Installed mods:

Subproject(s) affected?

BIM

Anything else?

No response

Code of Conduct

paullee0 commented 5 days ago

Confirmed. Roof do have some recompute() problem.

Recompute the Roof first, then the Wall, there is no more problem.

kaiwas commented 5 days ago

I use the ForceRecompute macro and its upgrade, which recalculates selected objects. I have already gotten into the habit of recalculating the walls (and the roof)


import FreeCADGui as Gui

objs = Gui.Selection.getSelection()
for obj in objs:
    obj.recompute()

Force_Recompute2

https://github.com/user-attachments/assets/61e6b0bd-6a64-4916-a6d2-6b8f06a05a1c

UPD/ I figured out what the problem was. I didn't have the error display turned on. Visually, everything is fine, but the object is not solid. Снимок экрана_20241008_031800

In any case, it is more convenient to get an error with such a macro )))

kaiwas commented 5 days ago

The error occurs even if you change the order. try recalculating the roof at the first stage. After that, the wall can no longer be repaired. I assume that the problem is in the wall, not the roof.

https://github.com/user-attachments/assets/0840f94c-b2d2-45ea-bd7b-c93d2700c42b

I am not completely sure, but I think the problem is in the sketch from which the walls are made. Perhaps it is not closed.

I have been told many times to make sketches as simple as possible, and this is the very case where I would like to agree with this.

kaiwas commented 4 days ago

Surprisingly, despite the error, this object (not a solid) has volume. Снимок экрана_20241008_083201

yorikvanhavre commented 4 days ago

OCCT might still be able to calculate a volume from a non-solid object.

But even after the "OG Wände has no solid" message, The shape is still solid:

shp.Solids
[<Solid object at 0x55e8f2889380>]

The message is printed at https://github.com/FreeCAD/FreeCAD/blob/main/src/Mod/BIM/ArchComponent.py#L951 but it shouldn't pop up in that case, because we have a solid... Maybe this message was printed at an intermediary stage?