Skip to content

Commit 4043c77

Browse files
committed
add points to geometry objects
1 parent 8fc776f commit 4043c77

File tree

1 file changed

+22
-0
lines changed
  • src/compas/geometry/shapes

1 file changed

+22
-0
lines changed

src/compas/geometry/shapes/box.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,28 @@ def left(self):
269269
def top(self):
270270
return [4, 5, 6, 7]
271271

272+
@property
273+
def points(self):
274+
point = self.frame.point
275+
xaxis = self.frame.xaxis
276+
yaxis = self.frame.yaxis
277+
zaxis = self.frame.zaxis
278+
279+
dx = 0.5 * self.xsize
280+
dy = 0.5 * self.ysize
281+
dz = 0.5 * self.zsize
282+
283+
a = point + xaxis * -dx + yaxis * -dy + zaxis * -dz
284+
b = point + xaxis * -dx + yaxis * +dy + zaxis * -dz
285+
c = point + xaxis * +dx + yaxis * +dy + zaxis * -dz
286+
d = point + xaxis * +dx + yaxis * -dy + zaxis * -dz
287+
e = a + zaxis * self.zsize
288+
f = d + zaxis * self.zsize
289+
g = c + zaxis * self.zsize
290+
h = b + zaxis * self.zsize
291+
292+
return [a, b, c, d, e, f, g, h]
293+
272294
# ==========================================================================
273295
# Constructors
274296
# ==========================================================================

0 commit comments

Comments
 (0)