home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.graphics
- Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!leland.Stanford.EDU!ledwards
- From: ledwards@leland.Stanford.EDU (Laurence James Edwards)
- Subject: Re: Converting polygon with concave boundary to convex one anybody?
- Message-ID: <1992Jul28.221518.27272@leland.Stanford.EDU>
- Sender: news@leland.Stanford.EDU (Mr News)
- Organization: DSG, Stanford University, CA 94305, USA
- References: <9207281143.AA27417@ucbvax.Berkeley.EDU>
- Date: Tue, 28 Jul 92 22:15:18 GMT
- Lines: 37
-
- In article <9207281143.AA27417@ucbvax.Berkeley.EDU>, S.Marshall@sequent.cc.hull.ac.uk (Simon Marshall) writes:
- |> Hi all. I mailed this question a while back, but shortly after the machine I
- |> read news on hiccuped for a couple of days, and now I find out that our mailer
- |> fails, with a loss of incoming mail, on a regular basis. If you've responded
- |> once, please do again, sorry!
- |>
- |> I have a group of planar polygons with concave boundaries. I wish to replace
- |> each of these polygons with a number of triangular ones. For a polygon with a
- |> convex boundary, it's quiet easy. All I do is pick a single polygon vertex and
- |> form triangular facets, using this vertex, with successive pairs of vertices
- |> around the polygon boundary. The single polygon vertex is therefore common to
- |> all triangular facets.
- |>
- |> This, of course, will not work for polygons whose boundaries are concave, since
- |> a triangular facet may lie outside the boundary of the polygon. So either I
- |> must use a different method of generating triangular facets, or firstly
- |> generate polygons with convex boundaries from the polygons with concave
- |> boundaries.
- |>
- |> The $64M question is, how do I convert a concave polygon to a convex one? I
- |> thought there was a solution to this in Graphics GEMS, but nope...
-
- Just Delauney triangulate the thing, throwing out edges that lie outside the
- polygon ... i.e. connect each vertex to its nearest neighbor, but only if the
- edge does not leave the polygon. This will leave you with a bunch of triangles
- and possibly some convex regions. Split up the convex regions using your
- old method.
-
- The most straight forward way to do this is recursion ... go through the
- list of vertices for a polygon, when you find a vertex that you
- can connect to its nearest neighbor split the polygon and apply the
- same procedure to the 2 new polygons. If there are no vertices in the
- polygon that can be connected to their nearest neighbor, then the polygon
- is convex and you can split it up with your old method and return.
-
- Larry Edwards
- edwards@sunrise.stanford.edu
-