Skip to content
Permalink
Browse files

Fix segmentation of full circles

  • Loading branch information
mhugent committed Jul 29, 2015
1 parent e980e76 commit c42b8c17d6e1a0b1aae9906014ba7459c3c7e0e0
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/geometry/qgscircularstringv2.cpp
@@ -454,7 +454,7 @@ void QgsCircularStringV2::segmentize( const QgsPointV2& p1, const QgsPointV2& p2
QgsGeometryUtils::circleCenterRadius( p1, p2, p3, radius, centerX, centerY );
int segSide = segmentSide( p1, p3, p2 );

if ( radius < 0 || qgsDoubleNear( segSide, 0.0 ) ) //points are colinear
if ( p1 != p3 && ( radius < 0 || qgsDoubleNear( segSide, 0.0 ) ) ) //points are colinear
{
points.append( p1 );
points.append( p2 );
@@ -479,15 +479,15 @@ void QgsCircularStringV2::segmentize( const QgsPointV2& p1, const QgsPointV2& p2
{
increment *= -1;
/* Adjust a3 down so we can decrement from a1 to a3 cleanly */
if ( a3 > a1 )
if ( a3 >= a1 )
a3 -= 2.0 * M_PI;
if ( a2 > a1 )
a2 -= 2.0 * M_PI;
}
else
{
/* Adjust a3 up so we can increment from a1 to a3 cleanly */
if ( a3 < a1 )
if ( a3 <= a1 )
a3 += 2.0 * M_PI;
if ( a2 < a1 )
a2 += 2.0 * M_PI;

0 comments on commit c42b8c1

Please sign in to comment.
You can’t perform that action at this time.