Automatic generation of indoor space

edited May 2023 in General

Hello,
I am working on the automatic generation of indoor spaces from IFC files. The idea is to take the different building elements and to try generation the "holes" between them. Has anyone worked on this subject before ?

Massimo

Comments

  • Might I ask for what purpose? Normally the spaces come frome the authoring app.
    The approach people here focus on is generally exactly the opposite, you create spaces and generate the rest - this is also arguably philosophically the more correct approach.

  • Hi,
    The approach you are describing is suitable for conceptors and constructors. But for owners, facility and property managers, the approach is opposite. They generally receive a 3D model from the constructor, who focused on building elements. (Which is normal, since it s what he will build), but who didn't map all the voids with ifcspaces. The facility and property managers need those spaces to analyse the performance of building, and to study potential transformation of the building destination.
    Excuse my english, I am not a native speaker.

  • Ok. And I assume you are trying to do that headlessly with ifcopenshell?

  • I tried with ifopenshell/IfcEngine(C++) but doesn't seem to be the appropriate tool. IfcOpenShell will serve for the last operation. (Transforming the geometry to IfcEntities). I don't know my way around the geom part of IfcOpenShell, so I am a little bit stuck for the moment.

  • @MaoZerhouni this is an interesting topic and something I believe is worth solving, as it has applications in BIM authoring - for facility management and BEM zoning are two usecases I would've loved this functionality. IfcOpenShell allows you to convert any IFC geometry into a BREP, so your algorithm can be normalised, but that's all it does - most other geometry analysis would require the use of another library (e.g. raycasting).

    Ping @aothms in case he has already thought of a strategy for this.

    Just thinking out loud, let's say we start with a model with pure geometry (we can't rely on any other metadata, as the BIM model may be incomplete or messy) , with everything except for spaces. I believe a good place to start would be to isolate walls and slabs to be "room bounding" (to use Revit terminology) - as after all that is what the ISO IFC definition of walls and slabs are. Then there are two approaches: 1) user-driven, and 2) automated. In a user driven approach, the user picks a starting point within the room. In an automated approach, perhaps we should pick a wall, and heuristically pick a point with an offset from the normal of say 10cm of the wall. From a starting point, we can use some bounding box intersections and raycasting to at the very least easily figure out a slab top and bottom... but this is so far just assuming a prismatic room... maybe a strategy would be to find the nearest set of planes where the starting point is on the same "side" of the plane, then those planes may be extended, intersected, and joined.

    Anybody more familiar with these types of spatial algorithms can perhaps suggest some good reading material? I wouldn't be surprised if there was a name of this problem in the game design word.

  • edited March 2021

    The approach I am testing is based on boolean operations. I would start by isolating all IfcBuildingElement. (Spaces can be bounded by IfcRoof, by IfcWindow, IfcDoor ...) and all IfcVirualElement. Then generating the ConvexHull for all those elements. (This is doable with CGAL library). Then, doing the difference between this ConvexHull and the shape of the IfcBuildingElement selected. That will result in all the "holes" contained in the building. The problem I am facing is the result in CGAL is a single mesh with all the disjointed volumes. So next step is to split this mesh into jointed meshes. Then, using IfcOpenShell, to convert those volumes to IfcEntities, create IfcSpaces and assign representation to them. A last step would be assinging the Qte propertysets to those IfcSpaces, based on the generated geometry.
    The limit of this approach are that there is no specification of a precision. so, there should be no unwanted link between the holes.

    JanF
  • @MaoZerhouni The problem is that the IFC model is unlikely to be 'airtight', so the spaces will leak into each other. An untested way of dealing with this would be to construct a low-resolution voxel model of the IFC solid entities, then 'grow' these voxels to eliminate gaps and tiny voids. You can then identify the number of voids in the voxel model, and will be able to identify points within these voids. You can then use ray-casting as suggested by @Moult to assign IFC entities as boundaries for each of these spaces.

  • @MaoZerhouni other than not airtight, it is possible that the model is not manifold, especially during earlier concept phase.

  • Great discussion guys. This is all spot on.

    You can have a look at https://github.com/opensourceBIM/voxelization_toolkit which basically allows what you're aiming for on a 3d voxel grid:

    1. Union everything together
    2. Start from a point outside, do graph traversal to get a exterior volume
    3. Negate exterior volume to get interior volume
    4. Subtract step 1 from interior volume

    This works, and closes the small gaps @brunopostle mentioned (this is especially important in CGAL where there isn't a "fuzziness" as is in OCCT, so space will leak through even a touching walls that are only separated by a floating point rounding error) assuming you use the exact kernel.

    The difficulty is then of course to have the voxel volume components as a reasonable IFC representation. You can with some hacks trace them back to the original IFC surfaces, but it still isn't a manifold brep, but maybe a starting point.

    Alternatively I have been working for quite a while now on a CGAL implementation of IfcOpenShell https://github.com/tudelft3d/IfcOpenShell/tree/cgal with the aim of something very similar, but to get the exterior volume. The IfcOpenShell codebase is public, the processing code will be rather soon. We follow the same approach but before union we make all shapes a bit bigger (using Minkowski_sum) and then after union shrink the result back. This is all rather computationally intensive though.

    Also general note, very few buildings are perfectly convex, perhaps you can have a look at CGAL's 3D Alpha shapes package too, to give you convex hull with a search radius.

    lukasdimitar
  • just a little step remaining until the universal import/export tool for ifc :-)
    The authoring tools have no excuses anymore for bad imports when they argue the input file is bad..

  • Since most IFC-files I recieve lacks IFCSpaces and I do not have access to the authoring tools, the possibility to create IFCSpaces would help me a lot. Do you have any idea how to use https://github.com/opensourceBIM/voxelization_toolkit ?

  • edited July 2021

    Exactly. That's for the entire building interior including interior walls. You can subtract the walls and slabs or all element categories again from this result to obtain spaces. Issue #1523 on github uses export_ifc() to export the subset of building elements, but you can also use mesh() to simply mesh the voxel sets to obj file format. This results in a dense mesh, but you can simplify it using https://github.com/AECgeeks/ifc-pipeline/blob/voxels/application/simplify_obj.py or any other mesh decimation tool.

  • Thanks for your help. I have still no idea how to run these toolkits, you lost me at dependencies and compiling. I guess this is not for me.

  • If you run linux you can just get a build from the github releases https://github.com/opensourceBIM/voxelization_toolkit/releases/tag/v0.2.3

  • Thanks again for your help. Unfortunately I am stuck in Windows. Installing and learning a new operative system is a big undertaking.

  • but in a blender scripting-window, one can run ifcopenshell commands beside python? (once BlenderBIM ist installed). This is all win10 ?

  • @lukas yes, but this is not pure IfcOpenShell, this is the voxelization toolkit, which is not shipped with the BlenderBIM Add-on.

  • It also doesn't have python bindings (yet) it's an executable with it's own weird scripting language.

  • I noted that there has been a lot of work regarding voxelization toolkit and I wonder if it would be useful for generating room volumes or IfcSpaces for windows/BlenderBIM at this point?

Sign In or Register to comment.