Skip to content

Commit

Permalink
do_faces_form_a_closed_cell to is_faces_closed
Browse files Browse the repository at this point in the history
  • Loading branch information
romanavyzn committed May 27, 2024
1 parent 37f08c0 commit 656cd48
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Added `compas.geometry.Brep.from_plane`.
* Added `compas.tolerance.Tolerance.angulardeflection`.
* Added `compas.scene.SceneObject.scene` attribute.
* Added `compas.datastructures.CellNetwork.do_faces_form_a_closed_cell`
* Added `compas.datastructures.CellNetwork.is_faces_closed`
* Added `compas.datastructures.CellNetwork.delete_edge`
* Added `compas.datastructures.CellNetwork.delete_cell`
* Added `compas.datastructures.CellNetwork.delete_face`
Expand Down
10 changes: 6 additions & 4 deletions docs/userguide/basics.datastructures.cellnetwork.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ From Scratch
>>> vertices = [(0, 0, 0), (0, 1, 0), (1, 1, 0), (1, 0, 0), (0, 0, 1), (1, 0, 1), (1, 1, 1), (0, 1, 1)]
>>> faces = [[0, 1, 2, 3], [0, 3, 5, 4],[3, 2, 6, 5], [2, 1, 7, 6],[1, 0, 4, 7],[4, 5, 6, 7]]
>>> cells = [[0, 1, 2, 3, 4, 5]]
>>> [cell_network.add_vertex(x=x, y=y, z=z) for x, y, z in vertices]
>>> [cell_network.add_face(fverts) for fverts in faces]
>>> [cell_network.add_cell(fkeys) for fkeys in cells]
>>> vertices = [cell_network.add_vertex(x=x, y=y, z=z) for x, y, z in vertices]
>>> faces = [cell_network.add_face(fverts) for fverts in faces]
>>> cells = [cell_network.add_cell(fkeys) for fkeys in cells]
>>> print(cell_network)
<CellNetwork with 8 vertices, 6 faces, 1 cells, 12 edges>

Expand Down Expand Up @@ -96,6 +96,8 @@ An edge can be assigned to any number of faces, or to none.
[2, 3, 39]
>>> cell_network.edge_faces((1, 10))
[8]
>>> cell_network.edge_faces((43, 34))
[]
>>> cell_network.edges_without_face()
[(43, 34)]

Expand All @@ -113,7 +115,7 @@ A face can be at maximum assigned to two cells, to one or None. A face is on the

If all cells are connected, those faces form a closed cell as well:

>>> cell_network.do_faces_form_a_closed_cell(boundary)
>>> cell_network.is_faces_closed(boundary)
True

This shows only the faces on the boundary displayed.
Expand Down
2 changes: 1 addition & 1 deletion src/compas/datastructures/cell_network/cell_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def _faces_to_unified_mesh(self, faces):
return None
return mesh

def do_faces_form_a_closed_cell(self, faces):
def is_faces_closed(self, faces):
"""Checks if the faces form a closed cell."""
mesh = self._faces_to_unified_mesh(faces)
if mesh:
Expand Down

0 comments on commit 656cd48

Please sign in to comment.