6
6
from ladybug_display .geometry3d import DisplayText3D
7
7
from ladybug_display .visualization import VisualizationSet , ContextGeometry , \
8
8
AnalysisGeometry , VisualizationData
9
- from honeybee .units import conversion_factor_to_meters
9
+ from honeybee .units import conversion_factor_to_meters , parse_distance_string
10
10
from honeybee .facetype import Floor
11
11
12
12
from ..colorobj import _room_wireframe , _process_wireframe
@@ -45,11 +45,12 @@ def energy_color_room_to_vis_set(
45
45
if text_labels :
46
46
txt_height , font , f_str = _process_leg_par_for_text (color_room )
47
47
# loop through the rooms and create the text labels
48
- max_txt_h = float ('inf' )
48
+ max_txt_h , p_tol = float ('inf' ), 0.01
49
49
if units is not None :
50
50
fac_to_m = conversion_factor_to_meters (units )
51
51
max_txt_h = 0.25 / fac_to_m
52
52
max_txt_v = 1.0 / fac_to_m
53
+ p_tol = parse_distance_string ('0.01m' , units )
53
54
label_text = []
54
55
for room_val , room in zip (color_room .matched_values , color_room .matched_rooms ):
55
56
room_prop = f_str % room_val
@@ -63,7 +64,7 @@ def energy_color_room_to_vis_set(
63
64
if len (floor_faces ) == 1 :
64
65
flr_geo = floor_faces [0 ]
65
66
base_pt = flr_geo .center if flr_geo .is_convex else \
66
- flr_geo .pole_of_inaccessibility (tolerance )
67
+ flr_geo .pole_of_inaccessibility (p_tol )
67
68
elif len (floor_faces ) == 0 :
68
69
c_pt = room .geometry .center
69
70
base_pt = Point3D (c_pt .x , c_pt .y , room .geometry .min .z )
@@ -73,7 +74,7 @@ def energy_color_room_to_vis_set(
73
74
floor_outline = Polyline3D .join_segments (ne , tolerance )[0 ]
74
75
flr_geo = Face3D (floor_outline .vertices [:- 1 ])
75
76
base_pt = flr_geo .center if flr_geo .is_convex else \
76
- flr_geo .pole_of_inaccessibility (tolerance )
77
+ flr_geo .pole_of_inaccessibility (p_tol )
77
78
base_pt = base_pt .move (m_vec )
78
79
base_plane = Plane (Vector3D (0 , 0 , 1 ), base_pt )
79
80
else :
@@ -141,17 +142,18 @@ def color_face_to_vis_set(
141
142
# use text labels if requested
142
143
if text_labels :
143
144
# set up default variables
144
- max_txt_h = float ('inf' )
145
+ max_txt_h , p_tol = float ('inf' ), 0.01
145
146
if units is not None :
146
147
fac_to_m = conversion_factor_to_meters (units )
147
148
max_txt_h = 0.25 / fac_to_m
149
+ p_tol = parse_distance_string ('0.01m' , units )
148
150
txt_height , font , f_str = _process_leg_par_for_text (color_face )
149
151
# loop through the faces and create the text labels
150
152
label_text = []
151
153
face_zip_obj = zip (color_face .matched_values , color_face .matched_flat_geometry )
152
154
for face_val , f_geo in face_zip_obj :
153
155
cent_pt = f_geo .center if f_geo .is_convex else \
154
- f_geo .pole_of_inaccessibility (tolerance )
156
+ f_geo .pole_of_inaccessibility (p_tol )
155
157
base_plane = Plane (f_geo .normal , cent_pt )
156
158
face_prop = f_str % face_val
157
159
if base_plane .y .z < 0 : # base plane pointing downwards; rotate it
0 commit comments