From e95e92356f0a0e359467148a7f1803c0910f683e Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 22 Jul 2024 03:51:07 +0200 Subject: [PATCH] Update src/ifcopenshell-python/ifcopenshell/util/shape.py Co-authored-by: Vyacheslav Dobranov <112861900+VDobranov@users.noreply.github.com> --- src/ifcopenshell-python/ifcopenshell/util/shape.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/shape.py b/src/ifcopenshell-python/ifcopenshell/util/shape.py index 65caa09151..a9e6c609b5 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/shape.py +++ b/src/ifcopenshell-python/ifcopenshell/util/shape.py @@ -741,5 +741,5 @@ def get_total_edge_length(geometry: ShapeType) -> float: :rtype: float """ vertices = get_vertices(geometry) - edges = get_edges(geometry) - return sum([np.linalg.norm(vertices[e[0]] - vertices[e[1]]) for e in edges]) + vertices = vertices[get_edges(geometry)] + return np.linalg.norm(vertices[:, 1] - vertices[:, 0], axis=1).sum()