OSArch Community

Creating Roof Geometry using ifcopenshell/blenderbim

  1. V

    Hello everyone!!

    I am trying to create a simple hipped roof geometry to an ifc project. I am trying to use the blenderbim function "blenderbim.bim.module.model.roof.GenerateHippedRoof()" and unfortunately i can not figure out what is passed to "obj" argument.

    Thank you in advance!

  2. T

    select the plane beforehand, i believe.

  3. T

    you can do it this way too:

  4. N

    @theoryshaw are you may be able to help me too please :)

    using Blender 3.4.1 BBim 0.0.230304 Win10

    all I create is the following...

    Python: Traceback (most recent call last):

    File "C:\Users***\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\blenderbim\tool\ifc.py", line 126, in execute

    IfcStore.execute_ifc_operator(self, context)

    File "C:\Users***\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\blenderbim\bim\ifc.py", line 427, in execute_ifc_operator

    result = getattr(operator, "_execute")(context)

    File "C:\Users\nigel\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\blenderbim\bim\module\model\roof.py", line 46, in _execute

    shapely.LineString([obj.data.vertices[edge.vertices[0]].co, obj.data.vertices[edge.vertices[1]].co])

    AttributeError: module 'shapely' has no attribute 'LineString'

  5. M

    @Nigel i think that problem is caused by non updated version of shapely module.

    You could update manually to the shapely last version (2.something) or you could try with a fresh bbim installation, that, in theory, is shipped with the last version of shapely

  6. V

    @theoryshaw that can be a solution, but I am trying to create a roof geometry with the code.

    I have this IFC file with four walls and I want to create a hipped roof from the wall boundary. With the new version of blenderbim, there is the GenerateHippedRoof(obj, mode, height, angle) function. I am struggling to create mesh plane out of the wall boundaries to feed into the obj argument.

    The point where I got stuck is:

    import ifcopenshell
    
    import blenderbim
    
    import bpy
    
    objs = bpy.context.visible_objects[:-3]
    
    boundary_lines = []
    
    for obj in objs:
    
            boundary_lines.append[obj.data.edges]

    Another method I am trying to get to the final result is through: wall.Representation.Representations.Items - which outputs the IfcPolyline. And I am stuck again at the point where all these polylines have to be connected into a polygon -> plane -> mesh plane and at the end the roof.

    Can you hint the next steps I have to take, or some required methods/functions to use in the code?

    Thank you in advance!!!

  7. T

    I'm a novice too, but does this help you get started?

    Would imagine you could get the 'verts' from decomposing the Plan/Axis/GRAPH VIEW/Curve2D line representation of a wall type instance.

    then use the verts to create the plane mesh, then feed that into obj attribute of GenerateHippedRoof method.

  8. T

    we're screwed! ;)

Login or Register to reply.