Skip to content

Offset with square option vs Clipper 1 #242

Discussion options

You must be logged in to vote

In Clipper.Offset.cs and inside ClipperOffset.OffsetPoint() change to the following ...

else //convex
{
  if (_joinType == JoinType.Round)
    DoRound(group, path, j, k, Math.Atan2(sinA, cosA));
  // else miter when the angle isn't too acute (and hence exceed ML)
  else if (_joinType == JoinType.Miter && cosA > _tmpLimit - 1)
    DoMiter(group, path, j, k, cosA);
  // don't square angles that deviate < ~15 degrees
  else if (_joinType == JoinType.Square && Math.Abs(sinA) > 0.25)
    DoSquare(group, path, j, k);
  else
    // don't square shallow angles that are safe to miter
    DoMiter(group, path, j, k, cosA);
}

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@Jonathan-Granier
Comment options

Comment options

You must be logged in to vote
4 replies
@Jonathan-Granier
Comment options

@AngusJohnson
Comment options

@Jonathan-Granier
Comment options

@Jonathan-Granier
Comment options

Answer selected by Jonathan-Granier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants