Skip to content

Commit 14e7673

Browse files
authored
be lazy + let promotion do the rest
1 parent 063ba2f commit 14e7673

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/rectangles.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -551,14 +551,14 @@ function coordinates(rect::Rect3D, nvertices=nothing)
551551
# TODO use n
552552
w = widths(rect)
553553
o = origin(rect)
554-
return map(x -> Point3f0(x .* w .+ o), [
555-
[0, 0, 0], [0, 0, 1], [0, 1, 1], [0, 1, 0],
556-
[0, 0, 0], [1, 0, 0], [1, 0, 1], [0, 0, 1],
557-
[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0],
558-
559-
[1, 1, 1], [0, 1, 1], [0, 0, 1], [1, 0, 1],
560-
[1, 1, 1], [1, 0, 1], [1, 0, 0], [1, 1, 0],
561-
[1, 1, 1], [1, 1, 0], [0, 1, 0], [0, 1, 1]
554+
return ((x .* w .+ o) for x in Point{3, Int}[
555+
(0, 0, 0), (0, 0, 1), (0, 1, 1), (0, 1, 0),
556+
(0, 0, 0), (1, 0, 0), (1, 0, 1), (0, 0, 1),
557+
(0, 0, 0), (0, 1, 0), (1, 1, 0), (1, 0, 0),
558+
559+
(1, 1, 1), (0, 1, 1), (0, 0, 1), (1, 0, 1),
560+
(1, 1, 1), (1, 0, 1), (1, 0, 0), (1, 1, 0),
561+
(1, 1, 1), (1, 1, 0), (0, 1, 0), (0, 1, 1)
562562
])
563563
end
564564

0 commit comments

Comments
 (0)