diff --git a/konova/models/geometry.py b/konova/models/geometry.py index 254ace44..09d81af4 100644 --- a/konova/models/geometry.py +++ b/konova/models/geometry.py @@ -364,7 +364,13 @@ class Geometry(BaseResource): geom_envelope = self.geom.envelope diff = geom_envelope - self.geom - complexity_factor = 1 - self.geom.area / diff.area + + if diff.area == 0: + ratio = 1 + else: + ratio = self.geom.area / diff.area + + complexity_factor = 1 - ratio return complexity_factor