File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,8 @@ def color_face_to_vis_set(
163
163
# loop through the faces and create the text labels
164
164
for face_prop , f_geo in zip (color_face .attributes , color_face .flat_geometry ):
165
165
if face_prop != 'N/A' :
166
- cent_pt = f_geo .center # base point for the text
166
+ cent_pt = f_geo .center if f_geo .is_convex else \
167
+ f_geo .pole_of_inaccessibility (tolerance )
167
168
base_plane = Plane (f_geo .normal , cent_pt )
168
169
if base_plane .y .z < 0 : # base plane pointing downwards; rotate it
169
170
base_plane = base_plane .rotate (base_plane .n , math .pi , base_plane .o )
@@ -174,7 +175,7 @@ def color_face_to_vis_set(
174
175
(f_geo .max .y - f_geo .min .y ),
175
176
(f_geo .max .z - f_geo .min .z )]
176
177
dims .sort ()
177
- txt_h = dims [1 ] / ( txt_len * 1.5 )
178
+ txt_h = dims [1 ] / txt_len
178
179
else :
179
180
txt_h = txt_height
180
181
if txt_h < tolerance :
Original file line number Diff line number Diff line change @@ -150,7 +150,8 @@ def color_face_to_vis_set(
150
150
label_text = []
151
151
face_zip_obj = zip (color_face .matched_values , color_face .matched_flat_geometry )
152
152
for face_val , f_geo in face_zip_obj :
153
- cent_pt = f_geo .center # base point for the text
153
+ cent_pt = f_geo .center if f_geo .is_convex else \
154
+ f_geo .pole_of_inaccessibility (tolerance )
154
155
base_plane = Plane (f_geo .normal , cent_pt )
155
156
face_prop = f_str % face_val
156
157
if base_plane .y .z < 0 : # base plane pointing downwards; rotate it
@@ -162,7 +163,7 @@ def color_face_to_vis_set(
162
163
(f_geo .max .y - f_geo .min .y ),
163
164
(f_geo .max .z - f_geo .min .z )]
164
165
dims .sort ()
165
- txt_h = dims [1 ] / ( txt_len * 1.5 )
166
+ txt_h = dims [1 ] / txt_len
166
167
else :
167
168
txt_h = txt_height
168
169
if txt_h < tolerance :
You can’t perform that action at this time.
0 commit comments