Skip to content

Commit

Permalink
add form mesh constructor for form diagram
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Apr 22, 2024
1 parent 9f380f5 commit c60bfdb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* Added `compas_tna.diagrams.FormDiagram.from_mesh`.

### Changed

### Removed


## [0.4.0] 2024-03-01

### Added
Expand All @@ -22,7 +23,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed


## [0.3.0] 2024-02-09

### Added
Expand All @@ -31,7 +31,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed


## [0.2.0] 2022-12-02

### Added
Expand Down
16 changes: 16 additions & 0 deletions src/compas_tna/diagrams/formdiagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,22 @@ def from_lines(cls, lines, delete_boundary_face=True, precision=None, **kwargs):
form.name = kwargs["name"]
return form

@classmethod
def from_mesh(cls, mesh):
"""Construct a Form Diagram from another mesh.
Parameters
----------
mesh : :class:`compas.datastructures.Mesh`
The other mesh.
Returns
-------
:class:`compas_tna.diagrams.FormDiagram`
"""
return mesh.copy(cls=cls)

def uv_index(self):
"""Returns a dictionary that maps edge keys (i.e. pairs of vertex keys)
to the corresponding edge index in a list or array of edges.
Expand Down

0 comments on commit c60bfdb

Please sign in to comment.