Is there any well-defined algorithm to check if given nonconvex area completely overlaps given rectangle? Both shapes defined by polylines, so we’re doing vector geometry. I do not want collision detection, only complete overlapping.
Story is as follows: we have an SVG canvas on which user can put rectangles, possibly rotated. On canvas exists rudimentary layer system (each rectangle is on it’s own layer). The request is as this: to delete a rectangle which is completely blocked from sight by other rectangles overlapping it. So, the rectangles other than given rectangle forms non-convex area, possibly also non-continuous.
The target programming language is PHP, but the solution in any language is welcome.
You might want to check out some spatial topology suites (like JTS http://www.vividsolutions.com/jts/jtshome.htm with various ports)
You can do operations such as union/intersection etc on multiple geometries, in your case, if you union your complex polygon with the rectangle, the result should be the original polygon, otherwise the rectangle is ‘peeking’ out somewhere.