From 010ae601ed22d5d0443346ec2588861b319ae18e Mon Sep 17 00:00:00 2001 From: oliver bucklin Date: Mon, 29 Apr 2024 12:56:41 +0200 Subject: [PATCH] reverted beam.py --- src/compas_timber/parts/beam.py | 36 ++++++++++++--------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/src/compas_timber/parts/beam.py b/src/compas_timber/parts/beam.py index 3c9045125..1a3a8f410 100644 --- a/src/compas_timber/parts/beam.py +++ b/src/compas_timber/parts/beam.py @@ -127,44 +127,34 @@ def blank_frame(self): frame.point += -frame.xaxis * start # "extension" to the start edge return frame - @property - def part_ref(self): - frame = self.blank_frame - return Frame( - Point(*(frame.point + (frame.yaxis * self.width * 0.5) - (frame.zaxis * self.height * 0.5))), - frame.xaxis, - frame.zaxis, - ) - @property def faces(self): - frame = self.part_ref return [ Frame( - frame.point, + Point(*add_vectors(self.midpoint, self.frame.yaxis * self.width * 0.5)), self.frame.xaxis, - -self.frame.yaxis, + -self.frame.zaxis, ), Frame( - Point(*add_vectors(frame.point, self.frame.zaxis * self.height)), + Point(*add_vectors(self.midpoint, -self.frame.zaxis * self.height * 0.5)), self.frame.xaxis, - -self.frame.zaxis, + -self.frame.yaxis, ), Frame( - Point(*(frame.point - self.frame.yaxis * self.width + self.frame.zaxis * self.height)), + Point(*add_vectors(self.midpoint, -self.frame.yaxis * self.width * 0.5)), self.frame.xaxis, - self.frame.yaxis, + self.frame.zaxis, ), Frame( - Point(*add_vectors(frame.point, -self.frame.yaxis * self.width)), + Point(*add_vectors(self.midpoint, self.frame.zaxis * self.height * 0.5)), self.frame.xaxis, - self.frame.zaxis, + self.frame.yaxis, ), - Frame(frame.point, -self.frame.yaxis, self.frame.zaxis), # small face at start point + Frame(self.frame.point, -self.frame.yaxis, self.frame.zaxis), # small face at start point Frame( - Point(*(frame.point + self.frame.xaxis * self.blank_length + self.frame.zaxis * self.height)), - -self.frame.yaxis, - -self.frame.zaxis, + Point(*add_vectors(self.frame.point, self.frame.xaxis * self.length)), + self.frame.yaxis, + self.frame.zaxis, ), # small face at end point ] @@ -420,4 +410,4 @@ def endpoint_closest_to_point(self, point): if ds <= de: return ["start", ps] else: - return ["end", pe] + return ["end", pe] \ No newline at end of file