Sharing code between FreeCAD and BlenderBIM
As first proposed by @bernd over at the FreeCAD forums, I think it's a great idea to share code between FreeCAD and BlenderBIM. I'm posting to start the discussion off with a very simple draft proposal of a new set of utility classes and functions which will be part of IfcOpenShell, which we can then use.
Here's a few ideas off the top of my head just to get started (definitely full of holes!), we can then organise them into classes (perhaps ifcopenshell.util.material
, ifcopenshell.util.qto
(do automagic calculations?) and ifcopenshell.util.pset
, etc etc
- get_material(element)
- get_unit_scale() - stuff related to SI and imperial unit conversions and all that
- convert_unit()
- get_property() - note this needs to handle not just simple properties but complex list and tabular properties too - also qto can be merged into this since buildingSMART is planning to merge them anyway for IFC5
- calculate_volume/area/length()?
- convert_true_north_angle()?
- fetch_epsg()?
- dd2dms() and dms2dd() definitely
- local_to_global(coordinate)?
- map_class(element) - e.g. mapping between IFC classes and uniclass, omniclass, AIA CAD layers ...
In addition, various utilities can be shared:
- IFC diffing
- IFC COBie
- IFC CSV spreadsheet export
- IFC recycling / garbage collector
- Ifc Patching
Comments
Has there been any progress for this with FreeCAD?
Ping @yorik :)
This thread is a little old, and there's been a ton of new additions since then too! Exciting times!
No there has not been much done in FreeCAD in this regard recently. Both Yorik and me have been busy with other development and work
https://github.com/FreeCAD/FreeCAD/commits/master/src/Mod/Arch/importIFC.py
https://github.com/FreeCAD/FreeCAD/commits/master/src/Mod/Arch/importIFCHelper.py
https://github.com/FreeCAD/FreeCAD/commits/master/src/Mod/Arch/importIFCmulticore.py
https://github.com/FreeCAD/FreeCAD/commits/master/src/Mod/Arch/exportIFC.py
https://github.com/FreeCAD/FreeCAD/commits/master/src/Mod/Arch/exportIFCHelper.py
Great! Let's revive the subject! :)
Great news :)
Incidentally, it seems there are some bugs and crash in FreeCAD without enough resources to be tackled - anticipate the sharing improve efficiency in utilitisation of IFC and add synergy in both application. I hope I understand IFC but it proves too difficult for me at the moment :(
Even Autodesk finds IFC too difficult for them. Don't feel bad @paullee :D
Want to pitch in here. IFC import seems to take quite a while in Revit with, eg. one of the sample Archicad projects. In Blender it imports pretty fast.
I imagine it may be mesh straightforward representation vs FC trying to rebuild everything in solids?
The main speed hog in FreeCAD is when building the GUI objects, probably because there it needs to connect a lot of Qt signals. As a proof of that theory, if you import an IFC file in console mode, it is very fast, similar to Blender.
The strategy i want to try aftwr the 0.20 release is to allow to import an IFC file GUI-less even if you are using the GUI, store the result in an (or several, ex one per floor) external file and xref that file into the current document. This should give us huge speed gains and allow to work with very large files
There are a few things which allow IfcOpenShell, via the BlenderBIM Add-on, to process IFCs very quickly.
Not all of these apply to FreeCAD, but a number of these I believe aren't used in FreeCAD yet and the BlenderBIM Add-on is proudly serving as a testing platform :) Things like context filters and HDF5 cache are probably things FreeCAD can implement very easily after we've been battle testing it for a good half a year or so.
Autodesk is in the process of switching to the ODA IFC libraries - so let's hope for some improvement. They already say there are speed improvements.
As many of you may have hear Richard Petrie of bS died recently, he was a nice guy who has played a big part in building bS to what they are today.
I don't understand why 'speed' still is not a creterium for IFC developments and cerfification. It is curial and very important if you want people to work with it.
Happens to be a post about IFC import speed in FreeCAD forum :D
https://forum.freecadweb.org/viewtopic.php?f=39&t=68196#p590272