Re: polygon intersection
- From: "Dave Eberly" <dNOSPAMeberly@xxxxxxxxxxxxxxx>
- Date: Wed, 26 Oct 2005 14:00:16 GMT
"mike" <kostal.michal@xxxxxxxxx> wrote in message
news:1130321135.712885.254470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> It is possible to do the operations so they return the no-hole polygons?
If a polygon has a hole, you can make it appear topologically as a
simple polygon by locating a vertex A on the outer polygon and a
vertex B on the inner polygon, where the line segment connecting
A and B is not intersected by the original polygon edges (except
at the end points A and B). Then you modify the original polygon
to have two new edges, one from A to B and one from B to A.
To illustrate, consider the polygon with hole. The outer polygon
is a square with vertices (0,0), (3,0), (3,3), and (0,3), in that
order--counterclockwise so polygon interior is to your left as
you follow the vertices. The inner polygon is a square with
vertices (1,1), (1,2), (2,2), (2,1), in that order--clockwise so
polygon interior is to your left as you follow the vertices. The
line segment from (0,0) to (1,1) is not intersected by the original
polygon edges (except at the end points). The "simple" polygon
you create has ordered vertices: (0,0), (3,0), (3,3), (0,3), (0,0),
(1,1), (1,2), (2,2), (2,1), (1,1), (0,0) [last point mentioned to
make it clear you have "closed" the polygon, but probably not
duplicated in the actual application].
For such polygons, the question is whether the polygon Boolean
package you are using will support these in further queries.
--
Dave Eberly
http://www.geometrictools.com
.
- References:
- polygon intersection
- From: mike
- Re: polygon intersection
- From: mike
- polygon intersection
- Prev by Date: Re: Source code or algorithm for these effects??
- Next by Date: Re: nurbs surface
- Previous by thread: Re: polygon intersection
- Next by thread: Noise-resistant image fingerprint?
- Index(es):
Relevant Pages
|