Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit dbafcc2

Browse files
committed
fixed IfcOpenShell#1159 zero projection
1 parent a869e88 commit dbafcc2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/ifcblenderexport/blenderbim/bim/decoration.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,14 @@ def draw_label(self, segm):
169169
region3d = self.context.region_data
170170
p0 = location_3d_to_region_2d(region, region3d, p0)
171171
p1 = location_3d_to_region_2d(region, region3d, p1)
172+
proj = p1 - p0
173+
174+
if proj.length < 0.001:
175+
return
172176

173177
text = f"{length:.2f}"
174178

175-
ang = -Vector((1, 0)).angle_signed(p1 - p0)
179+
ang = -Vector((1, 0)).angle_signed(proj)
176180
cos = math.cos(ang)
177181
sin = math.sin(ang)
178182

0 commit comments

Comments
 (0)