Update src/ifcopenshell-python/ifcopenshell/util/shape.py

Co-authored-by: Vyacheslav Dobranov <112861900+VDobranov@users.noreply.github.com>
This commit is contained in:
Thomas Krijnen
2024-07-22 03:51:07 +02:00
parent e27980f746
commit e95e92356f
@@ -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()