Skip to content

Commit

Permalink
Fix segmentation of full circles
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 29, 2015
1 parent e980e76 commit c42b8c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/geometry/qgscircularstringv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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;
Expand Down

0 comments on commit c42b8c1

Please sign in to comment.