From 4758b3b98c7dee84391a8a40c00b7ca55779604f Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Thu, 18 Jan 2024 23:03:04 -0600 Subject: [PATCH] topology.py -> add check for solids to volume calculation, else None --- src/build123d/topology.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/build123d/topology.py b/src/build123d/topology.py index 00446886..7110db16 100644 --- a/src/build123d/topology.py +++ b/src/build123d/topology.py @@ -2242,7 +2242,10 @@ def area(self) -> float: def volume(self) -> float: """volume - the volume of this Shape""" # when density == 1, mass == volume - return Shape.compute_mass(self) + if self.solids(): + return Shape.compute_mass(self) + else: + return None def _apply_transform(self, transformation: gp_Trsf) -> Self: """Private Apply Transform