Skip to content

Commit

Permalink
reverted beam.py
Browse files Browse the repository at this point in the history
  • Loading branch information
obucklin committed Apr 29, 2024
1 parent d270cad commit 010ae60
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions src/compas_timber/parts/beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand Down Expand Up @@ -420,4 +410,4 @@ def endpoint_closest_to_point(self, point):
if ds <= de:
return ["start", ps]
else:
return ["end", pe]
return ["end", pe]

0 comments on commit 010ae60

Please sign in to comment.