0
$\begingroup$

Interesection of rectangles

  1. Green Boxes = rectangles
  2. red dots = edge points
  3. red lines = to be generated from convex hull algorithm

I have a problem with creating the convex hull algorithm. I want to select or collect all the edges from these rectangles and draw convex hull around through these edges (See red dots from the Image). To make my algorithm more efficient, I don't know how to deselect or eliminate the points (X black points) inside all rectangles.

Could someone give me a solution for this?

Thanks in advance

$\endgroup$
0
$\begingroup$

If you have $n$ rectangles, take the convex hull of the $4n$ points given by the corners of those rectangles. This gives you exactly what you want, and you can use any standard algorithm for computing the convex hull. There is no need to explicitly deselect individual corners -- let the algorithm for computing a convex hull take care of that.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.