From 4a9eeac0a9bd793909ca8efb1048fd79ccd5a68f Mon Sep 17 00:00:00 2001 From: talledodiego <38036285+talledodiego@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:38:32 +0200 Subject: [PATCH] Update GenericSection Update GenericSection to work also with SurfaceGeometry as input --- structuralcodes/sections/_generic.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/structuralcodes/sections/_generic.py b/structuralcodes/sections/_generic.py index 0d4ace47..ea05629e 100644 --- a/structuralcodes/sections/_generic.py +++ b/structuralcodes/sections/_generic.py @@ -53,6 +53,12 @@ def __init__( if name is None: name = 'GenericSection' super().__init__(name) + # Since only CompoundGeometry has the attribute geometries, + # if a SurfaceGeometry is input, we create a CompoundGeometry + # with only that geometry contained. After that all algorithms + # work as usal. + if isinstance(geometry, SurfaceGeometry): + geometry = CompoundGeometry([geometry]) self.geometry = geometry self.section_calculator = GenericSectionCalculator( sec=self, integrator=integrator, **kwargs