Skip to content

Commit

Permalink
mesh and polyhedron are not the same after all
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkasirer committed May 13, 2024
1 parent da15c3e commit 088097b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/compas_timber/elements/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from compas.geometry import Cylinder
from compas.geometry import Frame
from compas.geometry import Plane
from compas.geometry import Polyhedron


class FeatureApplicationError(Exception):
Expand Down Expand Up @@ -186,7 +187,11 @@ def apply(self, beam_geometry):
The resulting geometry after processing.
"""
volume = Brep.from_mesh(self.mesh_volume)
# NOTE: while very similar, Polyhedron and Mesh have slightly different interface where this below is concerned
mesh = self.mesh_volume
if isinstance(self.mesh_volume, Polyhedron):
mesh = self.mesh_volume.to_mesh()
volume = Brep.from_mesh(mesh)
try:
return beam_geometry - volume
except IndexError:
Expand Down

0 comments on commit 088097b

Please sign in to comment.