Commits

Jérôme Vuarand committed bad48ea

Added a failing test for surface tesselation. This exposes a bug in the GLU library.

Comments (0)

Files changed (1)

 
 expect(triangles, triangulate(contour(surface)))
 
+------------------------------------------------------------------------------
+
+local surface = assert(tesselation.surface())
+assert(surface:extend({
+	{x=0, y=0},
+	{x=2, y=0},
+	{x=2, y=2},
+	{x=0, y=2},
+	{x=0, y=0},
+}))
+assert(surface:extend({
+	{x=8, y=0},
+	{x=10, y=0},
+	{x=10, y=2},
+	{x=8, y=2},
+	{x=8, y=0},
+}))
+assert(surface:extend({
+	{x=0, y=8},
+	{x=2, y=8},
+	{x=2, y=10},
+	{x=0, y=10},
+	{x=0, y=8},
+}))
+assert(surface:extend({
+	{x=8, y=8},
+	{x=10, y=8},
+	{x=10, y=10},
+	{x=8, y=10},
+	{x=8, y=8},
+}))
+
+assert(surface:extend({
+	{x=1, y=1},
+	{x=1, y=9},
+	{x=9, y=9},
+	{x=9, y=1},
+	{x=1, y=1},
+}))
+
+local c = contour(surface)
+expect(4, #c)
+
+------------------------------------------------------------------------------
 
 print("all tests passed successfully")