public static List<Point> PolyCorners (ABObject ob)
    {
    	int[] x = {};
    	int[] y = {};
    	List<Point> poly = new ArrayList<Point>();
    	
    	// Fix the error in render regular rectangle
    	if (ob.getType() != ABType.Hill && !ob.IsAngular() && ob.shape == ABShape.Poly)
    	{
    		x = new int[]{(int)ob.getMinX(), (int)ob.getMaxX(), (int)ob.getMaxX(), (int)ob.getMinX()};
    		y = new int[]{(int)ob.getMinY(), (int)ob.getMinY(), (int)ob.getMaxY(), (int)ob.getMaxY()};
    	}
    	
    	// Rectangle
    	else if (ob.shape == ABShape.Rect)
    	{
    		x = new int[]{(int)ob.getMinX(), (int)ob.getMaxX(), (int)ob.getMaxX(), (int)ob.getMinX()};
			y = new int[]{(int)ob.getMinY(), (int)ob.getMinY(), (int)ob.getMaxY(), (int)ob.getMaxY()};
    	}
    	
    	// Triangle or Polygon
    	else if (ob.shape == ABShape.Triangle || ob.shape == ABShape.Poly)
    	{
    		Poly triangle = (Poly)ob;
    		x = triangle.polygon.xpoints;
    		y = triangle.polygon.ypoints;
    	}
    	
    	for (int i = 0; i < x.length; i++)
    	{
    		Point p = new Point(x[i], y[i]);
    		poly.add(p);
    	}
    	
    	return poly;
    }