Skip to content

Commit

Permalink
topology.py -> add check for solids to volume calculation, else None
Browse files Browse the repository at this point in the history
  • Loading branch information
jdegenstein authored Jan 19, 2024
1 parent 4e66f03 commit 4758b3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/build123d/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4758b3b

Please sign in to comment.