public Polygon hull() {
		Point[] points = getPoints();
		Model model = getModel();
		if (points == null || model == null || !model.isValid()) return null;

		/*
		 * Generate a convex hull from the model vertices
		 */
		Point[] hull = ConvexHull.getConvexHull(points);
		if (hull == null || hull.length == 0) {
			return null;
		}

		/*
		 * Convert the hull into a polygon
		 */
		int[] x = new int[hull.length];
		int[] y = new int[hull.length];
		for (int i = 0; i < hull.length; i++) {
			Point p = hull[i];
			x[i] = p.x;
			y[i] = p.y;
		}

		//create the polygon
		Polygon poly = new Polygon(x, y, x.length);
		return poly;
	}