2D and 3D support added.
Now it will consider polygons, not shapes