public static Polygon multiplyLines(Polygon p, int times) {
		if (times < 2) return p;
		
		Polygon ret = new Polygon();
		ret.setClosed(p.closed());
		
		for (int i = 0; i < p.getPointCount(); i++) {
			float[] point = p.getPoint(i);
			float[] pointNext = i < p.getPointCount()-1 ? p.getPoint(i+1) : (p.closed() ? p.getPoint(0) : null);
			
			ret.addPoint(point[0],point[1]);
			if (pointNext != null) {
				float aX = (pointNext[0]-point[0])/times, aY = (pointNext[1]-point[1])/times;
				for (int i2 = 1; i2 <= times; i2++) ret.addPoint(point[0]+aX*i2,point[1]+aY*i2);
			}
		}
		
		return ret;
	}