From 2e4dd16f50541e7e3bfe9b3e73e0894f1e8074bd Mon Sep 17 00:00:00 2001 From: saschabuehrle Date: Sun, 22 Mar 2026 13:13:56 +0100 Subject: [PATCH] fix: guard perimeter computation for MultiPolygon geometries (fixes #329) --- structuralcodes/sections/_generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/structuralcodes/sections/_generic.py b/structuralcodes/sections/_generic.py index 1e02035e..c5f3c09d 100644 --- a/structuralcodes/sections/_generic.py +++ b/structuralcodes/sections/_generic.py @@ -150,8 +150,8 @@ def _calculate_gross_section_properties(self) -> s_res.SectionProperties: warnings.warn( 'Perimiter computation for a multi polygon is not defined.' ) - - gp.perimeter = polygon.exterior.length + else: + gp.perimeter = polygon.exterior.length # Computation of area: this is taken directly from shapely gp.area = self.section.geometry.area