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

key is back, back again #278

Merged
merged 2 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Added attribute `plates` to `TimberModel`.
* Added `SurfaceModelJointOverride` GH Component
* Added `ShowSurfaceModelBeamType` GH Component
* Re-introduced attribute `key` in `Beam`.
* Added attribute `key` to `Plate`.

### Changed

Expand Down
9 changes: 8 additions & 1 deletion src/compas_timber/elements/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class Beam(Element):
A list containing the 4 lines along the long axis of this beam.
midpoint : :class:`~compas.geometry.Point`
The point at the middle of the centerline of this beam.
key : int, optional
Once beam is added to a model, it will have this model-wide-unique integer key.

"""

Expand Down Expand Up @@ -236,9 +238,14 @@ def midpoint(self):

@property
def has_features(self):
# TODO: move to compas_future... Part
# TODO: consider removing, this is not used anywhere
return len(self.features) > 0

@property
def key(self):
# type: () -> int | None
return self.graph_node

def __str__(self):
return "Beam {:.3f} x {:.3f} x {:.3f} at {}".format(
self.width,
Expand Down
10 changes: 8 additions & 2 deletions src/compas_timber/elements/plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class Plate(Element):
Thickness of the plate material.
aabb : tuple(float, float, float, float, float, float)
An axis-aligned bounding box of this plate as a 6 valued tuple of (xmin, ymin, zmin, xmax, ymax, zmax).

key : int, optional
Once plate is added to a model, it will have this model-wide-unique integer key.

"""

Expand Down Expand Up @@ -91,9 +92,14 @@ def shape(self):

@property
def has_features(self):
# TODO: move to compas_future... Part
# TODO: consider removing, this is not used anywhere
return len(self.features) > 0

@property
def key(self):
# type: () -> int | None
return self.graph_node

# ==========================================================================
# Implementations of abstract methods
# ==========================================================================
Expand Down
Loading