Wednesday, October 7, 2015

Separating elements by their material layers

An advantage that IfcOpenShell has over the many mesh-based viewers is that it is backed by a powerful modelling kernel called Open Cascade. This has already proven its significance for example in the ease of creating 2d floor plans from 3d elements in the SVG exporter. Now, a new feature in IfcOpenShell is introduced, once again demonstrating IfcOpenShell as a forerunner in terms of accurate and advanced visualisation of IFC geometry.

As building professionals readily know, building elements such as walls and slabs can be built up using several layers, for example including brick, thermal insulation and an air gap. This information is typically represented in IFC using an IfcMaterialLayerSet, which describes the thickness of such layers relatively to the axis of the wall. Therefore, it is not a direct part of the geometric representation of the element and therefore not visible in most IFC viewers. Alternatively, IFC exporters can choose to decompose the wall element into several IfcBuildingElementParts describing every of such layers as a separate product.

IfcOpenShell now introduces the possibility to separate the body representation according to its layers, with the appropriate style information applied. Furthermore, topological information that describes how wall end points connect to one another is used to fold such layers around corners where connecting walls meet. To our knowledge this is functionality that is currently not offered in any other IFC viewer, let me know if otherwise.

Currently this feature is in extended testing and is available in a development branch. It will be part of the upcoming new build once testing is complete. Note that it is potentially a time intensive operation and hence will have to be enable with the flag --enable-layerset-slicing in the IfcConvert utility.

Visuals rendered using IfcBlender of the Duplex apartment building model by USACE ERDC and buildingSMART Alliance. 1. A view from the outside with one window removed. 2. An exploded view of the lower level walls showcasing how layers are folded based on topological connectivity with other walls. 3. An image for contrast from a common IFC viewer with only a single surface style per product.

Sunday, July 26, 2015

Creating 2d SVG floor plans from IFC files

SVG floor plans extracted from the Medical Clinic model by USACE ERDC and buildingSMART Alliance
IfcConvert converts IFC files into a variety of output formats. Most of you will know these formats include geometrical models, either tessellated and easy to understand for importing applications, such as Wavefront OBJ and Collada, or Boundary Representation models in STEP or IGES with support for curved surfaces. Some of you might know the 0.5.0 branch also features an XML output format that contains a decomposition tree and property data of the building elements.

In collaboration with ROOT B.V. a new two-dimensional geometrical output format is added, called SVG (Scalable Vector Graphics). In order to turn the three-dimensional IFC model into 2d floor plans, the model is sliced at horizontal cross-sections. ROOT B.V. uses this format for their web-based tool flatt., an online facility management platform that aggregates sources of additional information into a two-dimensional overview. The development of the SVG conversion has been executed by AECgeeks, a consultancy company founded by one of the main contributors to IfcOpenShell. Both companies are strongly committed to free open source software, so we are happy to see that these developments are merged back into IfcOpenShell for the greater public good.

The SVG output format of IfcConvert is integrated into the public IfcOpenShell source code as of today. The image on the right does not show the direct output of IfcConvert, the isometric projection is added in a vector graphics manipulation tool.

Thursday, February 26, 2015

Two new IfcOpenShell releases

It has been a long wait since the previous official IfcOpenShell release. But now, two releases are presented at once, to make up for testing the patience of the community to this extent. On the one hand the new 0.4 release candidate improves on the stability of the 0.4 branch. The 0.5 preview release features more bleeding-edge work. Both releases have been updated for changes in upstream projects and include builds for the new blender 2.73 and 3ds Max 2015 and are built using Open Cascade 6.7.1 (OCE 0.16).

Both releases can be downloaded from the website. As always, it includes IfcBlender, IfcMax and IfcConvert. The 0.5 release now introduces ifcopenshell-python, a Python module for parsing and writing IFC files and creating BReps and explicit triangulated geometry from the implicit IFC geometry. The BIMserver plug-in has been provided with updated executables for its geometry interpretation.

The 0.4 release

An excerpt of the improvements is provided below:
  • More faithful use of precision information in IFC
  • Fixes and improvements for IfcLShapeProfileDef, IfcCShapeProfileDef, IfcRectangleHollowProfileDef, IfcCartesianTransformOperator3D, IfcSpecularExponent, IfcFacetedBrep, IfcPolyline, IfcPolyLoop
  • Prevent errors in triangulations due to zero-length normals
  • Fixes for parsing files with comments
  • Write unique IDs in Collada files
  • Speed up output of Wavefront OBJ files
  • Less unnecessary nurbs conversion in the STEP and IGES output
  • Check the validity of solids and fillets
  • Make parsing and serialization locale-independent

The 0.5 preview release

Simultaneously, a large amount of improvements and new features have been added to the 0.5 branch, which we do not want to withhold from the community. Hence, a preview of the 0.5 branch is released for adventurous users. Most notably, it contains all the improvements to geometry handling as outlined in this post and a brand new Python interface and coupling with pythonOCC. The Python interface has been built in collaboration with the FreeCAD team and its users, which are about to release a new version that includes a very promising full blown IFC importer and exporter. For programmers a new API is introduced that supersedes the IfcGeomObjects API. A new output format is added to IfcConvert which provides textual output from the IFC file that describes the header, decomposition structure and property values in XML format.

Introducing IfcOpenShell Academy

With the introduction of the Python interface to IfcOpenShell and the integration with pythonOCC, IfcOpenShell becomes even more suitable as a platform for academia, research and rapid development. With Python+IfcOpenShell+pythonOCC+Qt a complete framework is presented to interactively and visually present, analyse and construct IFC data. IfcOpenShell Academy provides an overview of quick recipes or building blocks to accomplish common tasks related to IFC. If you wish to contribute a recipe to the cookbook contact

Enjoy! And remember that IfcOpenShell still needs your help!

Friday, December 19, 2014

Combining IfcOpenShell and pythonOCC

One of the strengths of the IfcOpenShell library is the vast amount of shape analysis and healing tools that Open Cascade provides. This allows for transforming, validating, generating and analysing geometry in IFC files, for example, to compute missing IfcProperty values, validate geometrical constraints, implement clash- and interference checking and the generation of new geometry.

pythonOCC exposes the rich set of functionality that Open Cascade provides to a Python environment, which allows for intuitive rapid prototyping. Since IfcOpenShell also provides a Python wrapper, the two of them can be easility tied together to create a development environment for working with geometry in IFC files in an interactive, quick, but also, very powerful way.

To demonstrate the possibilities, or rather, the first baby steps towards a more interesting and meaningful demonstration, I put together a quick example here: The set of dependencies to get the system running is long, but it is worth it!

Tuesday, May 6, 2014

Updates on Geometry

Primarily IfcOpenShell focusses on the geometrical content of IFC files. This post provides an overview of some of the recent accomplishments related to our core business of processing IFC geometry.

Parametric profile definitions
IfcOpenShell already supported most parametric profile definitions, but until recently implementation for some of them remained. All parametric profile definitions are now supported. Contrary to many other implementations of the IFC format, IfcOpenShell takes special care of correctly converting all fillet radii and leg slope attributes.

One of the promising additions that IFC4 brings to the table is the support for b-spline surfaces. With support for this elementary example of a twisted cube defined using IfcBSplineSurfaceWithKnots, provided by GeometryGym, the first baby steps towards IfcOpenShell as a IFC4 compliant geometry engine have been made.

Constructive Solid Geometry
IfcOpenShell now supports all CSG primitives and boolean operand connectives.

BIMserver Render Engine improvements
The project reached an important milestone recently with its 1.3.0 release. IfcOpenShell contributed to this release by supplying a Render Engine that converts the IFC product representations into explicit triangular geometry. For example for use in their web-based viewer called BIMsurfer. In close collaboration with the BIMserver team we took special care of making sure that the engine is fault-tolerant and in the meantime took the time to implement initial support for surface styles and colors.

Apart from interpreting geometry, more and more so IfcOpenShell is stepping up to provide a framework for generating geometry as well. Recently the code to generate the IfcOpenHouse example, an IFC building model generated entirely from code, has been updated to conform a little bit better to the CoordinationView implementers agreements. You can read more on our struggle with actual parametric interoperability here.

Read more about IfcOpenShell as an IFC creation framework in the recent blog post by Yorik van Havre as he discusses the promising steps towards IFC support in FreeCAD.

Be sure to check how your favorite IFC viewer compares to IfcOpenShell by looking at the sample files here (just note that these developments are not yet part of the official built releases). Also note that some of these recent developments where funded by an generous external party and implemented by AECgeeks a company founded by Thomas, one of the principle IfcOpenShell developers.

Friday, February 7, 2014

Surface styles

Support for IfcSurfaceStyles, when importing geometry from IFC files, is a feature that has been requested much over the years. Starting with IfcOpenShell 0.4 surface styles are supported. Some refer to these styles as materials, but within the realms of IFC, surface styles and materials are actually two different beasts. Materials (IfcMaterialDefinition) describe metadata that pertain to the physically built structure. For example: the composite structure of an insulated brick wall can be described using an IfcMaterialLayerSet.

Surface styles on the other hand govern the way that surfaces or solids are visualised in IFC viewers. Often there is some correlation between the two: that the style of a surface is actually an indication of the material, but this is not necessarily the case. For example in MEP models, surface styles can also be used to colour code the contents or direction of flow segments, as can be seen above. In this post you find two images attached that derive their colouring straight from the IFC file: the Hitos HVAC model and an interior part of the Cobie Duplex Architectural model. In the image below you can also see how multiple distinct styles can be applied to different items within the same product.

Subsequent releases of IfcOpenShell will also account for surface styles linked to IfcMaterials and will provide an option to slice the geometric representation of elements according to their compound layer structure defined in the IfcMaterialLayerSet.

Sunday, January 12, 2014

IfcOpenShell 0.4.0 rc1 released!

It has been a while, but today the immediate availability of the first release candidate for the IfcOpenShell 0.4 release is announced! On this blog some of the new features of this release will be highlighted in detail. For example on file format conversion. Please report all issues found (by leaving a comment, starting a thread on the forums, a message on IRC, e-mail or a letter, you know where to find us)!

Changes since 0.3:
  • Introduction of IfcConvert 
    • A new utility that writes STEP, Collada, IGES and Wavefront OBJ files
  • Support for IfcSurfaceStyles when importing geometry
    • Surface styles govern the colours applied to elements in IFC viewers
  • More robust support for clipped representations
  • Blender IFC importer updated for 2.69
  • 3ds Max IFC importer updated for 3ds Max 2014
  • Improved performance and stability

The release can be downloaded from the website:

Enjoy! And remember that IfcOpenShell still needs your help!