mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 10:33:20 +00:00
Additional fixes to https://github.com/IfcOpenShell/IfcOpenShell/commit/57bc709b6fef6381bbb2810da15e568290c4a77a
This commit is contained in:
@@ -1203,7 +1203,11 @@ class PlanLevelDecorator(BaseDecorator):
|
||||
def get_text():
|
||||
abs_z = verts[0].z
|
||||
z = helper.get_relative_z(obj, element, abs_z)
|
||||
|
||||
|
||||
# Z is in meters (Blender world space), convert to project units (feet)
|
||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||
z = z / unit_scale # Convert meters to feet
|
||||
|
||||
rl = self.format_value(context, z, in_unit_length=True)
|
||||
text = "{}{}".format("" if z < 0 else "+", rl)
|
||||
return text
|
||||
@@ -1277,6 +1281,10 @@ class SectionLevelDecorator(BaseDecorator):
|
||||
|
||||
def get_text():
|
||||
z = verts[0].z
|
||||
# Z is in meters (Blender world space), convert to project units (feet)
|
||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||
z = z / unit_scale # Convert meters to feet
|
||||
|
||||
rl = self.format_value(context, z, in_unit_length=True)
|
||||
text = "RL {}{}".format("" if z < 0 else "+", rl)
|
||||
return text
|
||||
|
||||
@@ -1625,7 +1625,12 @@ class Drawing(bonsai.core.tool.Drawing):
|
||||
|
||||
xmin, xmax, ymin, ymax = helper.ortho_view_frame(camera.data)[:4]
|
||||
rl = ifcopenshell.util.placement.get_local_placement(storey.ObjectPlacement)[2][3]
|
||||
y = (camera.matrix_world.inverted() @ Vector((0.0, 0.0, rl))).y
|
||||
|
||||
# Convert RL from project units (feet) to meters for Blender world space
|
||||
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
|
||||
rl_meters = rl * unit_scale
|
||||
|
||||
y = (camera.matrix_world.inverted() @ Vector((0.0, 0.0, rl_meters))).y
|
||||
if y < ymin or y > ymax:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user