Skip to content

Commit

Permalink
Merge pull request #1366 from compas-dev/fix-volmesh
Browse files Browse the repository at this point in the history
Fix volmesh
  • Loading branch information
tomvanmele committed Jun 11, 2024
2 parents 67c43a7 + 3b06fb3 commit fc53790
Show file tree
Hide file tree
Showing 9 changed files with 759 additions and 103 deletions.
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

0 comments on commit fc53790

Please sign in to comment.