return new Rectangle2D.Float(r.x, r.y, r.width, r.height);
}
if (s instanceof Triangle2D) {
Triangle2D t = (Triangle2D) s;
Path2D path = new Path2D.Float();
path.moveTo(t.a.x, t.a.y);
path.lineTo(t.b.x, t.b.y);
path.lineTo(t.c.x, t.c.y);
path.closePath();
return path;
}