Modelling for IFC export

This forum section is only for IFC-related issues
cadgiru
Posts: 82
Joined: Thu Oct 27, 2016 9:53 am
Location: Norway
Contact:

Re: Modelling for IFC export

Postby cadgiru » Tue Sep 25, 2018 5:36 am

Regarding arch and ifc export.
Think it is time we do some basic study of the exports.
Have modeled some simple examples and exported to ifc.
Results are not always as desired.

Suggested plan,:
Make some simple examples of basic objects
Make some compound objects
Document how these are exported

By basic, I am thinking we start with wall:

First basic wall -> seems to export ok
Wall with cut -> seems to export ok
Wall with addition -> does not seem to export ok
Joined walls -> do no seem to export ok

When stating ok / not ok, this does not mean they are not exported. It means the resulting IFC entities are not as desired.

Hope someone will participate in this testing.

Propose we set up a sandbox:ifcexport page on wiki.

Yorik, what is your view on this?

regards
Last edited by cadgiru on Sat Sep 29, 2018 5:03 am, edited 1 time in total.
paullee
Posts: 2044
Joined: Wed May 04, 2016 3:58 pm

Re: Modelling for IFC export

Postby paullee » Tue Sep 25, 2018 7:45 am

cadgiru wrote:
Tue Sep 25, 2018 5:36 am
By basic, I am stinking we start with wall:

First basic wall -> seems to export ok
Wall with cut -> seems to export ok
Wall with addition -> does not seem to export ok
Joined walls -> do no seem to export ok
Yes, categorise the issues. Following your examples... :)

ArchWall on 'Simple Sketch' # -> Export OK
ArchWall on 'Complex Sketch' #-> Export NOT OK

# See Sketch geometry, IfcOpenShell+FC setup etc. in post below.
https://forum.freecadweb.org/viewtopic. ... 10#p257347
cadgiru
Posts: 82
Joined: Thu Oct 27, 2016 9:53 am
Location: Norway
Contact:

Re: Modelling for IFC export

Postby cadgiru » Tue Sep 25, 2018 1:02 pm

paullee wrote:
Tue Sep 25, 2018 7:45 am
cadgiru wrote:
Tue Sep 25, 2018 5:36 am
By basic, I am stinking we start with wall:

First basic wall -> seems to export ok
Wall with cut -> seems to export ok
Wall with addition -> does not seem to export ok
Joined walls -> do no seem to export ok
Yes, categorize the issues. Following your examples... :)

ArchWall on 'Simple Sketch' # -> Export OK
ArchWall on 'Complex Sketch' #-> Export NOT OK

# See Sketch geometry, IfcOpenShell+FC setup etc. in post below.
https://forum.freecadweb.org/viewtopic. ... 10#p257347
How about trying to really work through the ifc issues, 'bottom up'. Have a feeling there are quite a few issues.
Believe we need to document what happens in each case, and how structures are built. Also believe to have a good ifc support, we will also need to look at relations (all kinds of). Have found that people want to build all kind of relationships into ifc file, ranging from use of spaces to psets.
Material defs and ifcstyled items and so on.

If some of us can help Yorik build the ifc handling of our dreams in FC, that would be great. Also when we later get into ifc4, there are great structures for handling MEP in ways that none of the big guys currently do. Among other stuff ifc4 also has support for image textures.
paullee
Posts: 2044
Joined: Wed May 04, 2016 3:58 pm

Re: Modelling for IFC export

Postby paullee » Tue Sep 25, 2018 3:07 pm

cadgiru wrote:
Tue Sep 25, 2018 1:02 pm

How about trying to really work through the ifc issues, 'bottom up'. Have a feeling there are quite a few issues.
Believe we need to document what happens in each case, and how structures are built. Also believe to have a good ifc support, we will also need to look at relations (all kinds of). Have found that people want to build all kind of relationships into ifc file, ranging from use of spaces to psets.
Material defs and ifcstyled items and so on.

If some of us can help Yorik build the ifc handling of our dreams in FC, that would be great. Also when we later get into ifc4, there are great structures for handling MEP in ways that none of the big guys currently do. Among other stuff ifc4 also has support for image textures.
Would follow you, I am not really familiar with IFC but feel this should be done as main stream software seems want to avoid for any reason.

Maybe start with a separate thread on ArchWall? As I have already posted some preliminary findings earlier :)
cadgiru
Posts: 82
Joined: Thu Oct 27, 2016 9:53 am
Location: Norway
Contact:

Re: Modelling for IFC export

Postby cadgiru » Fri Sep 28, 2018 4:55 am

bernd wrote:
Sun Sep 23, 2018 6:45 pm
cadgiru wrote:
Sun Sep 23, 2018 6:14 pm
The one running is downloaded from ifcopenshell, not compiled by myself. I sadly never got that to work.
Compiling ifcopenshell is not difficault. which system are you on?
Maybe

Personally I have not managed yet.. Any help is much appreciated

If successful, I will do my best to document it
regards

OS: Ubuntu 18.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.14796 (Git)
Build type: Release
Branch: master
Hash: 3653d7ed11e9b4d1cf859c9c5231ef2ce4517ee2
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
User avatar
yorik
Site Admin
Posts: 11645
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Modelling for IFC export

Postby yorik » Sat Sep 29, 2018 2:41 pm

Basically almost all IFC export problems come down to this:

IFC geometry can be made of many different ways: extrusions of 2D profiles, booleans (subtractions, unions), or simply faceted brep objects (defined by a series of flat faces), or, most advanced (AFAIK only IfcOpenShell is capable todo that), NURBS-based brep objects (defined by a series of NURBS surfaces).

IfcOpenShell, in its latest versions, now has a "serializer" functionality, where you give it an OCC shape, any kind of shape, and it will produce an adequate IFC geometry: NURBS, faceted, or anything else. It is implemented in FreeCAD (there is an IFC preference option to enable), but it hasn't been tested extensively.

The thing is, for us, exporting as NURBS would be the safest. 100% guarantee that the IFC geometry is the same as in FreeCAD. If an object has only flat faces, faceted brep is also 100% guaranteed. Since each face is defined by a series of vertices, there is basically no room for error.

The problem is, other BIM applications are far less tolerant than FreeCAD. Revit particularly is extremely picky on what it can do with the contents of an IFC file. So, in FreeCAD, we try as much as possible to export geometry as something that Revit likes more, such as extrusions of a 2D profile. This has also the advantage that some of the modeling history (the 2D profile + the extrusion) is stored in the IFC file too, making it already much more parametric. However, that's where problems begin. The whole system of geometry positioning in IFC is very complex and error-prone, and even worse, not all applications interpret placements the same way. Same goes for unions, subtractions, or several objects that share a same geometry.

So usually, if you export something from FreeCAD and it's not correct in the IFC file, the number one culprit is the extrusion/placement. When exporting, in the report view you will be able to see how a particular object has been exported (extrusion, brep or reusing shared geometry)

A quick way to test (and solve), is to select the problematic object in FreeCAD, and Arch->Utils->Toggle Brep flag. This stores a value in the object's IfcAttributes property, that makes the IFC exporter force-export the object as a faceted brep. If the object didn't export correctly as an extrusion but does export correctly as brep, then we have our culprit. If the brep exported object works ok for you (depends on the application you'll import the IFC file to), this is a good workaround.

Of course we need to improve the extrusion export system. But we need to isolate cases that should be exported as extrusions and don't work correctly.

The case of "complex" sketches is complicated. Internally, an Arch wall built on such a complex sketch will build a wall on each wire found in the sketch, then union those wires. So the IFC exporter doesn't have a 2D profile to extrude. Maybe as a quick workaround we could force-export these walls as breps. But I am still not sure what would be a better solution...
User avatar
sgrogan
Posts: 5586
Joined: Wed Oct 22, 2014 5:02 pm

Re: Modelling for IFC export

Postby sgrogan » Sat Sep 29, 2018 4:03 pm

cadgiru wrote:
Fri Sep 28, 2018 4:55 am
Personally I have not managed yet.. Any help is much appreciated
I will rebuild from scratch and post some instructions.
yorik wrote:
Sat Sep 29, 2018 2:41 pm
IfcOpenShell, in its latest versions, now has a "serializer" functionality, where you give it an OCC shape
Do you know how recent? Perhaps I need to update the version in the Win bundles.
paullee
Posts: 2044
Joined: Wed May 04, 2016 3:58 pm

Re: Modelling for IFC export

Postby paullee » Sat Sep 29, 2018 5:54 pm

sgrogan wrote:
Sat Sep 29, 2018 4:03 pm
I will rebuild from scratch and post some instructions.
yorik wrote:
Sat Sep 29, 2018 2:41 pm
IfcOpenShell, in its latest versions, now has a "serializer" functionality, where you give it an OCC shape
Do you know how recent? Perhaps I need to update the version in the Win bundles.
Good to have some instructions !

- I am attempting again on Fedora 27, stopped at OpenCollada, aothms of IfcOpenShell give some hints on github and currently build_all.py is fetching python-3.2.6u ....
- https://github.com/IfcOpenShell/IfcOpenShell/issues/480
- In fact, I think we only need IfcOpenShell-python right?

- Reference : https://freecadweb.org/wiki/Import/Expo ... enShell/en
User avatar
sgrogan
Posts: 5586
Joined: Wed Oct 22, 2014 5:02 pm

Re: Modelling for IFC export

Postby sgrogan » Sat Sep 29, 2018 5:57 pm

paullee wrote:
Sat Sep 29, 2018 5:54 pm
- In fact, I think we only need IfcOpenShell-python right?
Correct, I've disabled collada support myself.
I also use cmake-gui.
paullee
Posts: 2044
Joined: Wed May 04, 2016 3:58 pm

Re: Modelling for IFC export

Postby paullee » Sat Sep 29, 2018 6:02 pm

sgrogan wrote:
Sat Sep 29, 2018 5:57 pm

Correct, I've disabled collada support myself.
I also use cmake-gui.
Thanks!

Without understanding build_all.py, I don't know how to 'disable' that - it is still compiling in another window :)

(In fact, I was asking in IfcOpenShell hoping there maybe some hints on this)

Anyway, see if I get the compilation done this time.