Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix volmesh #1366

Merged
merged 13 commits into from
Jun 11, 2024
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Added `compas.geometry.vector.__rsub__`.
* Added `compas.geometry.vector.__rmul__`.
* Added `compas.geometry.vector.__rtruediv__`.
* Added `VolMesh.cell_lines`, `VolMesh.cell_polygons`.
* Added `VolMesh.vertex_edges`.
* Added `VolMesh.from_meshes`.
* Added `VolMesh.from_polyhedrons`.

### Changed

* Changed `compas_ghpython/utilities/drawing.py` to remove `System` dependency.
* Fixed bug in `compas.geometry.ic_numpy`, which was caused by returning only the last transformation of the iteration process.
* Changed `VolMesh._plane` back to point to a cell for every triplet of vertices.
* Fixed `VolMesh.add_halfface`, `VolMesh.add_cell`, `VolMesh.vertex_halffaces`, `VolMesh.vertex_cells`, `VolMesh.edge_halffaces`, `VolMesh.halfface_cell`, `VolMesh.halfface_opposite_cell`, `VolMesh.halfface_opposite_halfface`, `VolMesh.cell_neighbors`.
* Changed ordering of `Volmesh.edges()` to be deterministic.
* Changed ordering and direction of `Volmesh.vertex_edges()` to be deterministic.
* Changed check for empty vertices and faces to use `is None` to add support for `numpy` arrays.
* Changed order of `u` and `v` of `compas.geometry.SphericalSurface` to the match the excpected parametrisation.
* Changed `compas.geometry.Shape.to_vertices_and_faces` to use `Shape.vertices` and `Shape.faces` or `Shape.triangles`.
Expand Down
11 changes: 0 additions & 11 deletions docs/userguide/basics.datastructures.assemblies.rst

This file was deleted.

12 changes: 8 additions & 4 deletions docs/userguide/basics.datastructures.cellnetworks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,30 @@
import compas
from compas.colors import Color
from compas.datastructures import CellNetwork
from compas.geometry import Line, Polygon

cell_network = CellNetwork.from_json(compas.get("cellnetwork_example.json"))
from compas.geometry import Line
from compas.geometry import Polygon

cell_network: CellNetwork = CellNetwork.from_json(compas.get("cellnetwork_example.json")) # type: ignore

viewer = Viewer(show_grid=False)

no_cell = cell_network.faces_without_cell()

for face in cell_network.faces():
if cell_network.is_face_on_boundary(face) is True:
color, opacity = Color.silver(), 0.5
elif face in no_cell:
color, opacity = Color.azure(), 0.3
else:
color, opacity = Color.yellow(), 0.8

viewer.scene.add(Polygon(cell_network.face_coordinates(face)), facecolor=color, opacity=opacity)

for edge in cell_network.edges_without_face():
line = Line(*cell_network.edge_coordinates(edge))
viewer.scene.add(line, linewidth=3)

graph = cell_network.cells_to_graph()
viewer.scene.add(graph)

viewer.show()
viewer.show()
2 changes: 1 addition & 1 deletion docs/userguide/basics.datastructures.meshes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Halfedge Data Structure
The topology of a mesh is stored in a halfedge data structure.
In this data structure, vertices are connected to other vertices, and faces to other faces, via edges.
An edge has two connected vertices, and at most two connected faces.
Each each is split into two halfedges, one for each of the connected faces.
Each edge is split into two halfedges, one for each of the connected faces.
If an edge has only one connected face, the edge is on the boundary.

Note that in a mesh constructed using :meth:`compas.datastructures.Mesh.from_meshgrid`, the vertices are organised in a specific way.
Expand Down
1 change: 0 additions & 1 deletion docs/userguide/basics.datastructures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ Datastructures
basics.datastructures.cells
basics.datastructures.cellnetwork
basics.datastructures.trees
basics.datastructures.assemblies
Loading
Loading