diff --git a/CHANGELOG.md b/CHANGELOG.md index f66c6a80dc9..ffc5efa5e2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/docs/userguide/basics.datastructures.cellnetwork.rst b/docs/userguide/basics.datastructures.cellnetwork.rst index 95c09903b01..3ed0c35922c 100644 --- a/docs/userguide/basics.datastructures.cellnetwork.rst +++ b/docs/userguide/basics.datastructures.cellnetwork.rst @@ -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) @@ -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)] @@ -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. diff --git a/src/compas/datastructures/cell_network/cell_network.py b/src/compas/datastructures/cell_network/cell_network.py index ef03d218fe7..0ea76969ca1 100644 --- a/src/compas/datastructures/cell_network/cell_network.py +++ b/src/compas/datastructures/cell_network/cell_network.py @@ -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: