Skip to content

Commit b8237d9

Browse files
fix: move the text position for 5 mm to make the text readable on colored faces
1 parent a00d685 commit b8237d9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

honeybee_display/colorobj.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,12 @@ def color_face_to_vis_set(
153153
# use text labels if requested
154154
if text_labels:
155155
# set up default variables
156-
max_txt_h, p_tol = float('inf'), 0.01
156+
max_txt_h, p_tol, offset_from_base = float('inf'), 0.01, 0.005
157157
if units is not None:
158158
fac_to_m = conversion_factor_to_meters(units)
159159
max_txt_h = 0.25 / fac_to_m
160160
p_tol = parse_distance_string('0.01m', units)
161+
offset_from_base = parse_distance_string('0.005m', units)
161162
label_text = []
162163
txt_height = None if color_face.legend_parameters.is_text_height_default \
163164
else color_face.legend_parameters.text_height
@@ -167,6 +168,7 @@ def color_face_to_vis_set(
167168
if face_prop != 'N/A':
168169
cent_pt = f_geo.center if f_geo.is_convex else \
169170
f_geo.pole_of_inaccessibility(p_tol)
171+
cent_pt = cent_pt.move(f_geo.normal * offset_from_base)
170172
base_plane = Plane(f_geo.normal, cent_pt)
171173
if base_plane.y.z < 0: # base plane pointing downwards; rotate it
172174
base_plane = base_plane.rotate(base_plane.n, math.pi, base_plane.o)

0 commit comments

Comments
 (0)