mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 14:33:28 +00:00
Z-coordinate in PlanLevelDecorator relative to spatial container if exists. Absolute otherwise (#6845)
* Z-coordinate in PlanLevelDecorator relative to spatial container if exists. Absolute otherwise
This commit is contained in:
@@ -1204,7 +1204,19 @@ class PlanLevelDecorator(BaseDecorator):
|
|||||||
text_dir *= -1
|
text_dir *= -1
|
||||||
|
|
||||||
def get_text():
|
def get_text():
|
||||||
z = verts[0].z
|
abs_z = verts[0].z
|
||||||
|
z = abs_z
|
||||||
|
|
||||||
|
if element:
|
||||||
|
spatial_container = ifcopenshell.util.element.get_container(element)
|
||||||
|
|
||||||
|
if spatial_container:
|
||||||
|
container_obj = tool.Ifc.get_object(spatial_container)
|
||||||
|
|
||||||
|
if container_obj:
|
||||||
|
spatial_container_z = container_obj.matrix_world.translation.z
|
||||||
|
z = abs_z - spatial_container_z
|
||||||
|
|
||||||
rl = self.format_value(context, z)
|
rl = self.format_value(context, z)
|
||||||
text = "{}{}".format("" if z < 0 else "+", rl)
|
text = "{}{}".format("" if z < 0 else "+", rl)
|
||||||
return text
|
return text
|
||||||
|
|||||||
Reference in New Issue
Block a user