Creating Roof Geometry using ifcopenshell/blenderbim

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!

Comments

  • @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'

  • @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

    Nigel
  • @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!!!

    brunopostle
  • edited March 2023

    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.

  • we're screwed! ;)

    Ace
Sign In or Register to comment.