Support IfcIndexedPolyCurve for more robust 2D representations

This commit is contained in:
Dion Moult
2020-08-12 12:39:39 +10:00
parent d56dd25245
commit 71e59922ec
4 changed files with 16 additions and 17 deletions
@@ -31,7 +31,7 @@ def add_object(self, context):
]
edges = [[0, 1], [1, 2], [2, 3]]
faces = []
mesh = bpy.data.meshes.new(name="IfcDoor/Dumb Door")
mesh = bpy.data.meshes.new(name="Dumb Door")
mesh.from_pydata(verts, edges, faces)
obj2 = object_data_add(context, mesh, operator=self)
bpy.ops.object.convert(target='CURVE')
@@ -85,11 +85,13 @@ def add_object(self, context):
obj4.display_type = 'WIRE'
obj4.parent = obj2
obj4.matrix_parent_inverse = obj2.matrix_world.inverted()
obj4.hide_render = True
obj4.name = 'IfcOpeningElement/Dumb Door Opening'
attribute = obj4.BIMObjectProperties.attributes.add()
attribute.name = 'PredefinedType'
attribute.string_value = 'OPENING'
obj2.name = 'IfcDoor/Dumb Door'
attribute = obj2.BIMObjectProperties.attributes.add()
attribute.name = 'PredefinedType'
attribute.string_value = 'DOOR'
@@ -29,7 +29,7 @@ def add_object(self, context):
]
edges = [[0, 1], [1, 2], [2, 3]]
faces = []
mesh = bpy.data.meshes.new(name="IfcWindow/Dumb Window")
mesh = bpy.data.meshes.new(name="Dumb Window")
mesh.from_pydata(verts, edges, faces)
obj2 = object_data_add(context, mesh, operator=self)
bpy.ops.object.convert(target='CURVE')
@@ -84,11 +84,13 @@ def add_object(self, context):
obj4.display_type = 'WIRE'
obj4.parent = obj2
obj4.matrix_parent_inverse = obj2.matrix_world.inverted()
obj4.hide_render = True
obj4.name = 'IfcOpeningElement/Dumb Window Opening'
attribute = obj4.BIMObjectProperties.attributes.add()
attribute.name = 'PredefinedType'
attribute.string_value = 'OPENING'
obj2.name = 'IfcWindow/Dumb Window'
attribute = obj2.BIMObjectProperties.attributes.add()
attribute.name = 'PredefinedType'
attribute.string_value = 'WINDOW'