Skip to content

Commit

Permalink
de-linting
Browse files Browse the repository at this point in the history
  • Loading branch information
papachap committed Aug 6, 2024
1 parent 1ee8919 commit 9f73d9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
21 changes: 9 additions & 12 deletions src/compas_timber/_fabrication/step_joint_notch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import math

from compas.geometry import Brep
from compas.geometry import Frame
from compas.geometry import Line
from compas.geometry import Plane
from compas.geometry import Rotation
from compas.geometry import Vector
from compas.geometry import Polyhedron
from compas.geometry import Brep
from compas.geometry import Polyline
from compas.geometry import Rotation
from compas.geometry import Vector
from compas.geometry import angle_vectors_signed
from compas.geometry import distance_point_point
from compas.geometry import intersection_line_plane
Expand Down Expand Up @@ -224,7 +224,7 @@ def strut_height(self, strut_height):
def step_shape(self):
return self._step_shape

@step_shape.setter # TODO: should this be defined automatically depending on the other parameters? (ie. if heel_depth > 0 and step_depth > 0, then step_shape = "double")
@step_shape.setter
def step_shape(self, step_shape):
if step_shape not in [StepShape.DOUBLE, StepShape.STEP, StepShape.HEEL, StepShape.TAPERED_HEEL]:
raise ValueError(
Expand Down Expand Up @@ -304,7 +304,7 @@ def from_surface_and_beam(
"""
# type: (PlanarSurface|Surface, Beam, bool, float, float, float, bool, int) -> StepJointNotch
# TODO: the stepjointnotch is always orthogonal, this means that the surface should be perpendicular to the beam's ref_side | should there be a check for that?
# TODO: I am using a PlanarSurface instead of a Plane because otherwise there is no way to define the start_y of the Notch. This makes a case for the default ref_side to be a PlanarSurface
# TODO: I am using a PlanarSurface instead of a Plane because otherwise there is no way to define the start_y of the Notch.
# TODO: The alternative solution in order to use a Plane instead would be to have start_y and notch_width as parameters of the class
# define ref_side & ref_edge
ref_side = beam.ref_sides[ref_side_index] # TODO: is this arbitrary?
Expand Down Expand Up @@ -454,9 +454,8 @@ def apply(self, geometry, beam):
)
# create notch polyedron from planes
# add ref_side plane to create a polyhedron
cutting_planes.append(
Plane.from_frame(beam.ref_sides[self.ref_side_index])
) # !: the beam's ref_side Plane might need to be offsetted to create a valid polyhedron when step_type is "double"
# !: the beam's ref_side Plane might need to be offsetted to create a valid polyhedron when step_type is "double"
cutting_planes.append(Plane.from_frame(beam.ref_sides[self.ref_side_index]))
try:
notch_polyhedron = Polyhedron.from_planes(cutting_planes)
except Exception as e:
Expand Down Expand Up @@ -503,9 +502,7 @@ def add_mortise(self, mortise_width, mortise_height, beam):
self.mortise = True
# self.mortise_width = beam.width / 4 # TODO: should this relate to the beam? typically 1/3 or 1/4 of beam.width
self.mortise_width = mortise_width
self.mortise_height = (
beam.height if mortise_height > beam.height else mortise_height
) # TODO: should this be constrained?
self.mortise_height = beam.height if mortise_height > beam.height else mortise_height

def planes_from_params_and_beam(self, beam):
"""Calculates the cutting planes from the machining parameters in this instance and the given beam
Expand Down Expand Up @@ -761,7 +758,7 @@ def mortise_volume_from_params_and_beam(self, beam):
assert self.step_shape is not None
assert self.strut_height is not None
assert self.notch_width is not None
assert self.mortise == True
assert self.mortise
assert self.mortise_width is not None
assert self.mortise_height is not None

Expand Down
1 change: 0 additions & 1 deletion tests/compas_timber/test_btlx.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def test_beam_ref_faces_attribute(mock_beam):


def test_beam_ref_edges(mock_beam):

ref_edges_expected = (
Line(
Point(x=-48.67193560518159, y=20.35704602012424, z=0.0005429194857271558),
Expand Down

0 comments on commit 9f73d9e

Please sign in to comment.