Boost logo

Boost :

Subject: Re: [boost] [geometry] area, length, centroid, behavior
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-02-25 08:54:50

Simonson, Lucanus J wrote:

> It places an unreasonable restriction on the definition of polygon to insist that it can't be default constructable and empty.

Construction is not part of the concept, no. Only Copy-construction.

> I'd also like to point out that roughly half the legacy polygon types floating around are invalid if you insist that they are "closed" because the last edge may be implied and it is more memory efficient to omit the redundant point. In such cases it is better to assume the implied edge that closes the polygon and produce the correct result rather than throw exceptions. It is also unreasonable to assume a winding direction convention. If your polygon concept requires these three conditions (not empty, closed and CC winding) you are excluding 7/8 legacy data types if we assume each decision is made arbitrarily.

If it's not closed, and doesn't contain at least one vertex, it's not a
Whether the last edge is inferred or not is irrelevant. That's only a
mean of definition. The retroactive modeling should adapt whatever mean
the legacy type uses to define a polygon to the mean the library expects.

Boost list run by bdawes at, gregod at, cpdaniel at, john at