Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Fixed `compas_ghpython.artists.VolMeshArtist.draw` and `compas_ghpython.artists.VolMeshArtist.draw_cells`.
* Fixed `compas_rhino.artists.VolMeshArtist.draw` and `compas_rhino.artists.VolMeshArtist.draw_cells`.
* Improved error messages when artist instance cannot be created.
* Fixed exception when calculating geometry of `compas.datastructures.Part` without features.

### Removed

Expand Down
16 changes: 9 additions & 7 deletions src/compas/datastructures/assembly/part.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,15 @@ def frame(self, frame):
def geometry(self):
# TODO: this is a temp solution
# TODO: add memoization or some other kind of caching
A = Mesh.from_shape(self.shape)
for shape, operation in self.features:
A.quads_to_triangles()
B = Mesh.from_shape(shape)
B.quads_to_triangles()
A = Part.operations[operation](A.to_vertices_and_faces(), B.to_vertices_and_faces())
geometry = Shape(*A)
if self.features:
A = self.shape.to_vertices_and_faces(triangulated=True)
for shape, operation in self.features:
B = shape.to_vertices_and_faces(triangulated=True)
A = Part.operations[operation](A, B)
geometry = Shape(*A)
else:
geometry = Shape(*self.shape.to_vertices_and_faces())

T = Transformation.from_frame_to_frame(Frame.worldXY(), self.frame)
geometry.transform(T)
return geometry
Expand Down