IfcOpenShell / IfcOpenShell

Open source IFC library and geometry engine
GNU Lesser General Public License v3.0
1.79k stars 712 forks source link

BlenderBIM error creating virtual element boundary #3994

Open brunopostle opened 10 months ago

brunopostle commented 10 months ago

Where two spaces are connected but there is no wall or slab between them it is necessary to create a Virtual Element (without a Body representation) and give it a boundary geometry for each space.

However creating a Boundary from a Virtual Element and a Space produces this error:

Error: Python: Traceback (most recent call last):
  File "/usr/share/blender/3.6/scripts/addons/blenderbim/tool/ifc.py", line 201, in execute
    IfcStore.execute_ifc_operator(self, context)
  File "/usr/share/blender/3.6/scripts/addons/blenderbim/bim/ifc.py", line 336, in execute_ifc_operator
    result = getattr(operator, "_execute")(context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/blender/3.6/scripts/addons/blenderbim/bim/module/boundary/operator.py", line 600, in _execute
    raycast = related_building_element_obj.closest_point_on_mesh(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error: Object 'IfcVirtualElement/Wall' has no evaluated mesh data

Workaround is to create a dummy Wall, give it boundaries, reassign the class to Virtual Element, then delete the Body representation.

See also #1676 and #3493

CyrilWaechter commented 8 months ago

It is not really clear for me to understand the expected behavior you are looking for but I think I have 2 proposals.

Workflow1 (spaces already exist)

  1. User select 2 spaces
  2. User press Add Boundary
  3. Result: An IfcVirtualElement and an IfcRelSpaceBoundary relating to each space are created. For geometry, I think all the 3 should share the same 3D geometry although it would be nice for the IfcVirtualElement to have a 2D representation too for plan/section views.

    Workflow2 (spaces are not created yet)

  4. Create an IfcVirtualElement with a surface as 3D geometry
  5. Generate space on each side (we need to make sure that the algorithm takes IfcVirtualElement in account in addition to walls)
  6. Generate boundaries by selecting space and virtual element or space only (algorithm already takes IfcVirtualElement in account)

Both workflows requires to code some new features.