You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: triangle.go
+17-7Lines changed: 17 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -57,16 +57,26 @@ func (triangle Triangle) boundingTriangle(canvas *Canvas, color color.NRGBA, per
57
57
return0, 0, 0, 0, fmt.Errorf("Triangle has 0 height")
58
58
}
59
59
60
-
total_area:=triangle.signed_triangle_area()
60
+
total_area:=math.Abs(triangle.signed_triangle_area()) // absolute to disable backface culling
61
61
iftotal_area<1 {
62
-
return0, 0, 0, 0, fmt.Errorf("Triangle area is less than 1 pixel") // backface culling + discarding triangles that cover less than a pixel // TODO: test / improve
62
+
return0, 0, 0, 0, fmt.Errorf("Triangle area is less than 1 pixel") // discarding triangles that cover less than a pixel
0 commit comments