Skip to content

Commit

Permalink
add_beam/plate/wall replaced by add_element
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkasirer committed Sep 9, 2024
1 parent 8dc8c59 commit 0a9fe7a
Showing 1 changed file with 2 additions and 39 deletions.
41 changes: 2 additions & 39 deletions src/compas_timber/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def beam_by_guid(self, guid):
return self._guid_element[guid]

def add_element(self, element, **kwargs):
# TODO: make the distincion in the properties rather than here
# then get rid of this overrloading altogether.
node = super(TimberModel, self).add_element(element, **kwargs)

if isinstance(element, Beam):
Expand All @@ -132,45 +134,6 @@ def add_element(self, element, **kwargs):
raise NotImplementedError("Element type not supported: {}".format(type(element)))
return node

def add_beam(self, beam):
# type: (Beam) -> None
"""Adds a Beam to this model.
Parameters
----------
beam : :class:`~compas_timber.elements.Beam`
The beam to add to the model.
"""
_ = self.add_element(beam)
self._beams.append(beam)

def add_plate(self, plate):
# type: (Beam) -> None
"""Adds a Beam to this model.
Parameters
----------
beam : :class:`~compas_timber.elements.Beam`
The beam to add to the model.
"""
_ = self.add_element(plate)
self._plates.append(plate)

def add_wall(self, wall):
# type: (Wall) -> None
"""Adds a Wall to this model.
Parameters
----------
wall : :class:`~compas_timber.elements.Wall`
The wall to add to the model.
"""
_ = self.add_element(wall)
self._walls.append(wall)

def add_joint(self, joint, beams):
# type: (Joint, tuple[Beam]) -> None
"""Add a joint object to the model.
Expand Down

0 comments on commit 0a9fe7a

Please sign in to comment.