mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 23:36:20 +00:00
New feature to export point lights (IfcLightSourcePositional) into IFC
This commit is contained in:
@@ -125,6 +125,7 @@ if bpy is not None:
|
|||||||
bpy.types.Mesh.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
bpy.types.Mesh.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
||||||
bpy.types.Curve.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
bpy.types.Curve.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
||||||
bpy.types.Camera.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
bpy.types.Camera.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
||||||
|
bpy.types.PointLight.BIMMeshProperties = bpy.props.PointerProperty(type=prop.BIMMeshProperties)
|
||||||
bpy.types.SCENE_PT_unit.append(ui.ifc_units)
|
bpy.types.SCENE_PT_unit.append(ui.ifc_units)
|
||||||
|
|
||||||
for module in modules.values():
|
for module in modules.values():
|
||||||
@@ -146,6 +147,7 @@ if bpy is not None:
|
|||||||
del bpy.types.Mesh.BIMMeshProperties
|
del bpy.types.Mesh.BIMMeshProperties
|
||||||
del bpy.types.Curve.BIMMeshProperties
|
del bpy.types.Curve.BIMMeshProperties
|
||||||
del bpy.types.Camera.BIMMeshProperties
|
del bpy.types.Camera.BIMMeshProperties
|
||||||
|
del bpy.types.PointLight.BIMMeshProperties
|
||||||
bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
|
bpy.types.SCENE_PT_unit.remove(ui.ifc_units)
|
||||||
|
|
||||||
for module in reversed(list(modules.values())):
|
for module in reversed(list(modules.values())):
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ def getSubcontexts(self, context):
|
|||||||
"CoG",
|
"CoG",
|
||||||
"Profile",
|
"Profile",
|
||||||
"SurveyPoints",
|
"SurveyPoints",
|
||||||
|
"Lighting",
|
||||||
]
|
]
|
||||||
for subcontext in subcontexts:
|
for subcontext in subcontexts:
|
||||||
subcontexts_enum.append((subcontext, subcontext, ""))
|
subcontexts_enum.append((subcontext, subcontext, ""))
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ class Usecase:
|
|||||||
return self.create_curve3d_representation()
|
return self.create_curve3d_representation()
|
||||||
elif self.settings["context"].ContextIdentifier == "SurveyPoints":
|
elif self.settings["context"].ContextIdentifier == "SurveyPoints":
|
||||||
return self.create_geometric_curve_set_representation()
|
return self.create_geometric_curve_set_representation()
|
||||||
|
elif self.settings["context"].ContextIdentifier == "Lighting":
|
||||||
|
return self.create_lighting_representation()
|
||||||
|
|
||||||
def create_plan_representation(self):
|
def create_plan_representation(self):
|
||||||
if self.settings["context"].ContextIdentifier == "Annotation":
|
if self.settings["context"].ContextIdentifier == "Annotation":
|
||||||
@@ -127,6 +129,28 @@ class Usecase:
|
|||||||
elif self.settings["context"].ContextIdentifier == "SurveyPoints":
|
elif self.settings["context"].ContextIdentifier == "SurveyPoints":
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def create_lighting_representation(self):
|
||||||
|
return self.file.createIfcShapeRepresentation(
|
||||||
|
self.settings["context"],
|
||||||
|
self.settings["context"].ContextIdentifier,
|
||||||
|
"LightSource",
|
||||||
|
[self.create_light_source()],
|
||||||
|
)
|
||||||
|
|
||||||
|
def create_light_source(self):
|
||||||
|
if self.settings["geometry"].type == "POINT":
|
||||||
|
return self.create_light_source_positional()
|
||||||
|
|
||||||
|
def create_light_source_positional(self):
|
||||||
|
return self.file.create_entity(
|
||||||
|
"IfcLightSourcePositional",
|
||||||
|
**{
|
||||||
|
"LightColour": self.file.createIfcColourRgb(None, *self.settings["geometry"].color),
|
||||||
|
"Position": self.file.createIfcCartesianPoint((0.0, 0.0, 0.0)),
|
||||||
|
"Radius": self.convert_si_to_unit(self.settings["geometry"].shadow_soft_size),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
def create_text_representation(self):
|
def create_text_representation(self):
|
||||||
return self.file.createIfcShapeRepresentation(
|
return self.file.createIfcShapeRepresentation(
|
||||||
self.settings["context"],
|
self.settings["context"],
|
||||||
|
|||||||
Reference in New Issue
Block a user