Skip to content

Commit

Permalink
Fix vertex ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
8-prime authored Jan 14, 2025
1 parent bc4f9ad commit a9797f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stl/geometry/shapes.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ func createBox(x, y, z, width, height, depth float64) ([]types.Triangle, error)

vertices := make([]types.Point3D, 8) // Pre-allocate vertices array
quads := [6][4]int{
{0, 1, 2, 3}, // front
{5, 4, 7, 6}, // back
{4, 0, 3, 7}, // left
{1, 5, 6, 2}, // right
{3, 2, 6, 7}, // top
{4, 5, 1, 0}, // bottom
{0, 3, 2, 1}, // front (viewed from front)
{5, 6, 7, 4}, // back (viewed from back)
{4, 7, 3, 0}, // left (viewed from left)
{1, 2, 6, 5}, // right (viewed from right)
{3, 7, 6, 2}, // top (viewed from top)
{4, 0, 1, 5}, // bottom (viewed from bottom)
}

// Fill vertices array
Expand Down

0 comments on commit a9797f8

Please sign in to comment.