mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
fixed #1159 zero projection
This commit is contained in:
@@ -169,10 +169,14 @@ class DimensionDecorator(ViewDecorator):
|
|||||||
region3d = self.context.region_data
|
region3d = self.context.region_data
|
||||||
p0 = location_3d_to_region_2d(region, region3d, p0)
|
p0 = location_3d_to_region_2d(region, region3d, p0)
|
||||||
p1 = location_3d_to_region_2d(region, region3d, p1)
|
p1 = location_3d_to_region_2d(region, region3d, p1)
|
||||||
|
proj = p1 - p0
|
||||||
|
|
||||||
|
if proj.length < 0.001:
|
||||||
|
return
|
||||||
|
|
||||||
text = f"{length:.2f}"
|
text = f"{length:.2f}"
|
||||||
|
|
||||||
ang = -Vector((1, 0)).angle_signed(p1 - p0)
|
ang = -Vector((1, 0)).angle_signed(proj)
|
||||||
cos = math.cos(ang)
|
cos = math.cos(ang)
|
||||||
sin = math.sin(ang)
|
sin = math.sin(ang)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user