Blender now supports IFC export

This forum section is only for IFC-related issues
Post Reply
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Blender now supports IFC export

Post by bernd »

tested this file https://forum.freecadweb.org/viewtopic.php?f=39&t=38440 For me both slabs are just grey in Blender. BTW how to fit the view in Blender after importing?
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Blender now supports IFC export

Post by carlopav »

bernd wrote: Tue Mar 31, 2020 10:57 am BTW how to fit the view in Blender after importing?
press A to select all, then press the point (".") in the numpad
or just press the home key.
it should work.
follow my experiments on BIM modelling for architecture design
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Blender now supports IFC export

Post by bernd »

carlopav wrote: Tue Mar 31, 2020 12:24 pm
bernd wrote: Tue Mar 31, 2020 10:57 am BTW how to fit the view in Blender after importing?
press A to select all, then press the point (".") in the numpad
or just press the home key.
it should work.
works great here !
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Blender now supports IFC export

Post by Moult »

@bernd, the slab colour issue is a bug. It is now fixed: https://github.com/IfcOpenShell/IfcOpen ... e79fcc2f61

I really appreciate this testing :)
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
paullee
Veteran
Posts: 5136
Joined: Wed May 04, 2016 3:58 pm

Re: Blender now supports IFC export

Post by paullee »

hmmm... still nothing.

Finding way to upload the ifc.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Blender now supports IFC export

Post by bernd »

Moult wrote: Tue Mar 31, 2020 10:29 pm @bernd, the slab colour issue is a bug. It is now fixed: https://github.com/IfcOpenShell/IfcOpen ... e79fcc2f61

I really appreciate this testing :)
great !

we do a lot of duplicate code. You in blenderBIM (ifcopenshell) and Yorik, me, you and others in FreeCAD. An example is extracting the colors of an object out of an ifc. Since there are a lot different implementation in different CAD this is quite some code. Another example would be the property sets and properties. This applys for import and export. As an example see https://github.com/FreeCAD/FreeCAD/blob ... #L240-L458 more than 200 lines of code.

It would makes sense if we would use the same code for this. We would not need to do all twice and blenderBIM and FreeCAD would handle the ifc the same way. IMHO this code should be in ifcopenshell.
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Blender now supports IFC export

Post by Moult »

Absolutely agree. It would be amazing to share code - in fact, I've written a lot of the code in BlenderBIM completely agnostic of Blender. I suspect it can be reused pretty easily. We'd need to agree on some common utility functions that we can share. We should perhaps discuss this in another thread in the OSArch forums (agnostic to any software).

However, of course, the devil is in the details. For example, in that code snippet just linked, issues with transparency, distinguishing between surface, diffuse, and specular colours (which Blender is quite well suited to), or even externally defined materials (Blender can read a Cycles/Eevee material, for example, linked in an IFC file), the deprecation of IfcPresentationStyleAssignment, and of course the fundamental way that Blender works is by recognising multiple representation (sub)contexts.

These are all solvable, and sharing code is _definitely_ the right way forward :) There will be a little OSArch online meeting this weekend, perhaps we can discuss it then? Just started: https://community.osarch.org/discussion ... m/p1?new=1
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
paullee
Veteran
Posts: 5136
Joined: Wed May 04, 2016 3:58 pm

Re: Blender now supports IFC export

Post by paullee »

Moult wrote: Tue Mar 31, 2020 6:56 am
- Can you provide the 210_King_Merged.ifc model? I'd like to see :) Otherwise, @carlopav's suggestion seems sensible.
Uploaded to Google Drive, see if it works :-

https://drive.google.com/file/d/1BNykQB ... sp=sharing
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Blender now supports IFC export

Post by Moult »

@paullee, the file fails to import because it contains some IfcStyledItem which should have a list of materials, but contains an empty list. This is an invalid IFC. e.g. #3917826= IFCSTYLEDITEM(#3917827,(),$);

That said, it doesn't justify a failed import, and so I've fixed it :) https://github.com/IfcOpenShell/IfcOpen ... 3c3ca72353

By the way, there is also an experimental (i.e. has some bugs, but slowly becoming more stable) multicore import option, which can make imports happen twice as fast, or even faster. You can enable it in the scene properties -> model view definitions panel -> experimental modes -> import with cpu multiprocessing.

You can see a picture of the successful import below. As you can see, there are still a few things off with this export geometrically - perhaps due to issues in the BIMServer.org export. I've created a bug: https://github.com/IfcOpenShell/IfcOpenShell/issues/821 - I wonder if the same output happens in FreeCAD. You can notice in the bugreport that although XBim does a better job, it still has strange geometry in areas - so I suspect the IFC file export itself has errors.
king.PNG
king.PNG (784.72 KiB) Viewed 3038 times
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Blender now supports IFC export

Post by bernd »

Which ifcoenshell does use blenderBIM?

- something which was installed with blenderBIM install
or
- the one I have installed on /usr/local

or the other way around

What do I need to install wher to test if you made a change in ifcopenshell?

I am on Debian Buster.
Post Reply