I am searching for an algorithm that will determine if a new rectangle is completely covered by a set of existing rectangles. Another way of putting the question, is does the ne
If rectangles are aligned that's easy:
Let's say you have rectangle A0 and want to know if it is fully covered by (B1, B2, B3...) = B
A := (A0)
while P := pop B
for R in A
if P fully covers R:
remove R from A
else if P and R does overlap:
remove R from A
break R in subrentangles S := (S1, S2, S3,...) following the intersections \
with P edges
push S into A
if A is empty:
say B covers A0
else:
say B does not fully cover A0