Skip to content

Commit

Permalink
inheritance boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkasirer committed Jan 19, 2024
1 parent 9e52c45 commit 650eebc
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/compas_timber/consumers/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,7 @@ def __init__(self, feature_geometry, message):


class FeatureApplicator(object):
"""Base class for feature applicators.
Parameters
----------
beam_geometry : :class:`compas.geometry.Geometry`
The geometry of the beam.
feature : :class:`compas_timber.parts.Feature`
The feature to apply.
"""

def __init__(self, beam_geometry, feature):
self.beam_geometry = beam_geometry
self.feature = feature
"""Base class for feature applicators."""

def apply(self):
"""Apply the feature to the beam geometry.
Expand All @@ -66,6 +53,7 @@ class DrillFeatureGeometry(FeatureApplicator):
"""

def __init__(self, beam_geometry, feature):
super(DrillFeatureGeometry, self).__init__()
self.line = feature.line
self.diameter = feature.diameter
self.length = feature.length
Expand Down Expand Up @@ -111,6 +99,7 @@ class CutFeatureGeometry(FeatureApplicator):
"""

def __init__(self, beam_geometry, feature):
super(CutFeatureGeometry, self).__init__()
self.cutting_plane = feature.cutting_plane
self.beam_geometry = beam_geometry

Expand Down Expand Up @@ -138,7 +127,7 @@ def apply(self):
)


class MillVolumeGeometry(object):
class MillVolumeGeometry(FeatureApplicator):
"""Applies MillVolume to beam geometry.
Parameters
Expand All @@ -151,6 +140,7 @@ class MillVolumeGeometry(object):
"""

def __init__(self, beam_geometry, feature):
super(MillVolumeGeometry, self).__init__()
self.volume = Brep.from_mesh(feature.volume)
self.beam_geometry = beam_geometry

Expand Down

0 comments on commit 650eebc

Please sign in to comment.