Skip to content

Commit e88e606

Browse files
Merge pull request #68 from 8-prime/fix-normals-orientation
Fix incorrect normal orientation in stl file
2 parents bc4f9ad + a9797f8 commit e88e606

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

stl/geometry/shapes.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ func createBox(x, y, z, width, height, depth float64) ([]types.Triangle, error)
7171

7272
vertices := make([]types.Point3D, 8) // Pre-allocate vertices array
7373
quads := [6][4]int{
74-
{0, 1, 2, 3}, // front
75-
{5, 4, 7, 6}, // back
76-
{4, 0, 3, 7}, // left
77-
{1, 5, 6, 2}, // right
78-
{3, 2, 6, 7}, // top
79-
{4, 5, 1, 0}, // bottom
74+
{0, 3, 2, 1}, // front (viewed from front)
75+
{5, 6, 7, 4}, // back (viewed from back)
76+
{4, 7, 3, 0}, // left (viewed from left)
77+
{1, 2, 6, 5}, // right (viewed from right)
78+
{3, 7, 6, 2}, // top (viewed from top)
79+
{4, 0, 1, 5}, // bottom (viewed from bottom)
8080
}
8181

8282
// Fill vertices array

0 commit comments

Comments
 (0)