Re: looking for code

From: John Gordon (gordon_at_panix.com)
Date: 05/18/05


Date: Wed, 18 May 2005 16:33:33 +0000 (UTC)

In <Pine.LNX.4.61.0505180907520.8339@holster07.dal.design.ti.com> Billy Patton <bpatton@ti.com> writes:

> I seek some code that will fracture a closed polygon into rectangles
> The polygons contain no slanted lines.
> Here's a sample of the concept I need to do:
> THe one on the left is the original. The one on the right with the xx's show
> possible locations to fracture the polygon. Not necessarily on the x axis.
> ________ ________
> | | | |
> | | | |
> | ____| |xx____|
> | | | |
> | | | |
> __________| | __________|xx|
> | | | |
> | ______| |xxxxxx______|
> | | | |
> |______| |______|

> I'm open to suggestions, algorithms, plagerism ...

It appears that there is always at least one rectangle that has three
complete sides and a partial side (the upper-right and lower-left
rectangles in this example).

Find one of these rectangles and complete it by extending the partial
side until it meets at a corner. Repeat.

I'm wondering, though, if there are some hidden requirements here. Does
your solution need to find the fewest possible number of rectangles?

-- 
John Gordon            "It's certainly uncontaminated by cheese."
gordon@panix.com


Relevant Pages

  • Re: heap or stack?
    ... Speaking of Points, Lines, Rectangles and Polygons. ... Don't forged that when value type objects are kept in array ... > Is there some middle ground - perhaps an array of structs containing ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: PtInRegion
    ... I was thinking rectangles although you clearly said "polygons". ... The problem is that Windows CE does not ... regions used by SetWindowRegion from a bitmap containing a mask. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: polygon objects are clipped to the plot area if specified with graph coordinates
    ... You are correct that the clipping rules for rectangles and for ... Maybe it would be best if all objects (rectangles, polygons, etc.) had ... If "clip" is given, the object would clip to the plot area. ...
    (comp.graphics.apps.gnuplot)
  • Re: Intersecting Polygons
    ... >just rectangles. ... The polygons can have 3 or more points/sides, up to infinite. ...
    (microsoft.public.vb.general.discussion)
  • Re: Intersecting Polygons
    ... I should have asked about the intersection of 2 POLYGONS, ... > just rectangles. ... The polygons can have 3 or more points/sides, ...
    (microsoft.public.vb.general.discussion)

Loading