Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8393 closed Bugs (fixed)

polygon model doesn't adhere to stated Polygon concept rules.

Reported by: bmccart@… Owned by: Barend Gehrels
Milestone: To Be Determined Component: geometry
Version: Boost 1.53.0 Severity: Problem
Keywords: polygon concept rule outer inner ring Cc:

Description

In the rules section for the Polygon concept it states that:

"If the polygons underlying ring_type is defined as clockwise, the exterior ring must have the clockwise orientation, and any interior ring must be counter clockwise. If the ring_type is defined counter clockwise, it is vice versa."

However, it would appear that the supplied polygon model does not adhere to this rule, since the same type is used for inner and outer rings. From the source: (http://svn.boost.org/svn/boost/trunk/boost/geometry/geometries/polygon.hpp)

    bool ClockWise = true,
    ...
    template<typename, typename> class RingList = std::vector,
    ...
    typedef ring<Point, ClockWise, Closed, PointList, PointAlloc> ring_type;
    typedef RingList<ring_type , RingAlloc<ring_type > > inner_container_type;

    inline ring_type const& outer() const { return m_outer; }
    inline inner_container_type const& inners() const { return m_inners; }

Change History (2)

comment:1 by Barend Gehrels, 10 years ago

Resolution: fixed
Status: newclosed

We will rephrase the docs. It should be intepreted as following:

"If the polygons underlying ring_type is defined as clockwise, the exterior ring must have the clockwise orientation, and any interior ring must be reversed w.r.t. the defined orientation"

So both are compile-time defined as clockwise, the outer polygon follows the defined orientation, the inner is contrary to the defined orientation.

comment:2 by bmccart@…, 10 years ago

That is a rewording, but that doesn't change the meaning, so unless you plan to make a code change to the polygon model class template it still won't match the part in quotes above. Yes, both are compile-time defined as clockwise, which doesn't match the meaning of the the inner rings having reversed orientation to the outer ring (whatever that orientation happens to be.)

Note: See TracTickets for help on using tickets.