If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)

BlenderBIM with late binding schema?

edited May 2021 in General

Hi,
On a 1 to 10 scale, how difficult would it be to use Blender with the late binding mode of IfcOpenShell?
I'd like to play with it with an unreleased schema (IFC 4x3 RC3) and would love to visualize the geometry as well :-)
So far the python code looks like :

>>> import ifcopenshell
>>> import ifcopenshell.express
>>> schema = ifcopenshell.express.parse('IFC4x3_RC3.exp')
>>> ifc_file = ifcopenshell.open("whatever_IFC4x3RC3_file.ifc")

Thanks :-)

Comments

  • blenderbim id designed to be "schema agnostic" so i guess it is nearly 0 on 10 scale.

  • 0 out of 10 is a bit optimistic :) There is some code which needs to change to support late binding. This includes class assignment and reassignment, and searching by class. I must admit I have not looked too closely at the late binding details, so hopefully @aothms can offer some insights on what happens to code like createIfcWall(...) / create_entity("IfcWall") and code like .is_a() which is probably the biggest thing we need to address.

    In terms of UI, most things are autoderived from the schema, so maybe we need to change some of the auto deriving for class assignment dropdowns which can no longer work by checking subclasses. However, this does not seem like a mammoth task.

  • I don't think it makes a difference for the BlenderBIM code base, because IfcOpenShell for Python is essentially entirely latebound (ifcopenshell.entity_instance.getattr does 90% of the work, there is no class hierarchy for the schema).

    The real difficulty is more on the C++ side if @smarie want to depend on the geometry interpretation mechanisms implemented in C++, because that is completely unsupported in the latebound mode (ifcopenshell.express.parse). The geometry interpretation functions are early bound, so it would require compilation of some sort.

    The quickest way forward is probably to simply compile the code base manually with RC3. See http://academy.ifcopenshell.org/using-ifcopenshell-and-c-to-generate-alignments-through-the-ifc-4x1-schema/ But keep in mind that there is nothing implemented in C++ for 4x1 onwards. So only the shared parts with IFC4 support geometry interpretation.

    Moult
  • @aothms said:
    But keep in mind that there is nothing implemented in C++ for 4x1 onwards. So only the shared parts with IFC4 support geometry interpretation.

    Thanks for your quick answers. Then my question should be rephrased: does IfcOpenShell plan to support alignments and swept area solids?
    Or BlenderBIM, rather? Actually I'm not sure if BlenderBIM relies on OCC to handle geometry and only gets the triangulated shapes, or if Blender can instantiate IFC Brep & solids on its own?

    One cool visual achievement could be such example .
    The missing C++ implementations for geometry generation include alignments (IfcOffsetCurveByDistances) and swept area solids (IfcSectionedSolidHorizontal).

    Does IfcOpenShell & BlenderBIM have sponsorship programs?

  • The BlenderBIM Add-on relies on OCC to handle geometry. It allows the user to manipulate parameters (currently with a rather clunky UI, which needs to be improved!) which then gets sent back to OCC to regenerate the mesh. There are also some mesh-to-parametric geometry converts which analyse the topology of the mesh to derive a parametric shape, but this is implemented on a case by case basis, mostly for simple primitives. This allows you to preserve and manipulate parametric geometry despite Blender being a mesh-based application.

    So when IfcOpenShell implements the new alignments (maybe it has already?), the BlenderBIM Add-on will naturally inherit it :)

    This is the closest we have to a sponsorship program: https://opencollective.com/opensourcebim :)

  • Somebody is working on the alignments and 4x3 geometry, but it seems he is not in a position to spend a lot of time on it, I haven't been in touch for a while, I'll reach out to him.

    smarietobenz
Sign In or Register to comment.