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!

Tuesday, January 7, 2014

Converting IFC files to STEP, IGES and Collada files

One of the brand new features in the upcoming IfcOpenShell 0.4 release is the ability to convert geometry in IFC files into three new file formats by using the new IfcConvert utility. The in total four supported output formats now are:
  • Wavefront OBJ (.obj)
  • Collada Digital Asset Exchange (.dae)
  • STEP (.stp)
  • IGES (.igs)
Wavefront OBJ conversion was already supported by the IfcObj utility. This utility is now obsolete. Both the Wavefront and Collada files, as created by IfcConvert, contain only tessellated geometry. More specifically: when using these formats all geometry is defined using explicit triangular polygons and curved surfaces would be approximated using these triangles. The great thing about these formats is that they can be imported by virtually any application, at the expense of some precision in the geometry definition.

For example consider the following statement:
#106 = IFCISHAPEPROFILEDEF(.AREA., $, #103, 302., 1008., 21., 40., 30.);
This defines an I-beam profile cross-section with a 302mm width, 1008mm height, a thickness of 21mm for the web, 40mm for the flanges and a fillet radius of 30mm. The left-most image depicts how such a beam, with a single opening added, would be defined using triangles. Notice how the fillet radius where the web and the flanges meet is approximated using planar surfaces and the round opening is in fact an n-gon.

Where STEP and IGES are different is that these formats allow the exporter to specify the surfaces using a boundary representation that supports curved surfaces and faces with holes. Therefore, no geometrical fidelity is lost in the conversion process. This can be useful in many of the engineering applications that do not natively support importing IFC files, but do provide support for either STEP or IGES files. After all, even though STEP and IFC(-SPF) share the same notation format (ISO 10303-21), STEP has been around for longer and is used in a variety of domains, where IFC is used only for describing building data. An illustration of the same beam without the triangular tessellation is provided on the right.

Stay posted for the first Release Candidate of the new IfcOpenShell 0.4, to be made available soon, which includes this new utility!