diff --git a/src/Lib/Geometry/poly_support.cxx b/src/Lib/Geometry/poly_support.cxx
index d41d7b7..3482241 100644
--- a/src/Lib/Geometry/poly_support.cxx
+++ b/src/Lib/Geometry/poly_support.cxx
@@ -357,6 +357,20 @@ TGPolygon polygon_tesselate_alt( TGPolygon &p ) {
}
/*
+ * Helper class for sorting points along a given axis.
+ */
+class Point3DOrdering {
+public:
+ Point3DOrdering(int axis):axis(axis) {}
+ bool operator()(const Point3D& a, const Point3D& b) {
+ return a[axis]<b[axis];
+ }
+
+protected:
+ int axis;
+};
+
+/*
* Find all intersections of the given contour with the x-parallel line at
* y=yline. Assume that no points are on the line (callers take care of this!).
*/
diff --git a/src/Lib/Polygon/polygon.hxx b/src/Lib/Polygon/polygon.hxx
index a2c56cf..d0d45eb 100644
--- a/src/Lib/Polygon/polygon.hxx
+++ b/src/Lib/Polygon/polygon.hxx
@@ -32,6 +32,7 @@
#include <simgear/compiler.h>
#include <simgear/math/sg_types.hxx>
+#include <simgear/math/point3d.hxx>
#include <iostream>
#include <string>