Skip to content

Commit

Permalink
Add comments for cube triangulation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Sep 20, 2024
1 parent ba0321c commit adf4db8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions glue_ar/common/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ def rectangular_prism_points(center: Iterable[float], sides: Iterable[float]) ->

def rectangular_prism_triangulation(start_index: int = 0) -> List[Tuple[int, int, int]]:
triangles = [
# side
# x = low
(start_index + 5, start_index + 1, start_index + 7),
(start_index + 7, start_index + 1, start_index + 3),

# x = high
(start_index + 6, start_index + 2, start_index + 4),
(start_index + 0, start_index + 4, start_index + 2),

# y = high
(start_index + 0, start_index + 2, start_index + 1),
(start_index + 1, start_index + 2, start_index + 3),

# side
# y = low
(start_index + 4, start_index + 7, start_index + 6),
(start_index + 7, start_index + 4, start_index + 5),

# bottom
# z = low
(start_index + 7, start_index + 3, start_index + 2),
(start_index + 7, start_index + 2, start_index + 6),

# top
# z = high
(start_index + 5, start_index + 4, start_index + 1),
(start_index + 4, start_index + 0, start_index + 1),

# side
(start_index + 6, start_index + 2, start_index + 4),
(start_index + 0, start_index + 4, start_index + 2),

# side
(start_index + 5, start_index + 1, start_index + 7),
(start_index + 7, start_index + 1, start_index + 3),
]

return triangles
Expand Down

0 comments on commit adf4db8

Please sign in to comment.