Skip to content

Commit

Permalink
Evaluate mid point with angle
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhankoral committed Sep 12, 2024
1 parent 3d64a3c commit 55e8ad8
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@ public SOG.Arc Convert(AG.CircularArc3d target)
SOG.Point end = _pointConverter.Convert(target.EndPoint);
double startParam = target.GetParameterOf(target.StartPoint);
double endParam = target.GetParameterOf(target.EndPoint);
AG.Point3d midPoint = target.EvaluatePoint(endParam - startParam / 2.0);

// some circular arcs will **not** return a correct value from `EvaluatePoint` using the indicated parameter at the midpoint.
// so far, this has happened with some arc segments in the polyline method. They will have an end param > 1, and evaluatePoint returns the endpoint
// this is why we are checking for midpoint == endpoint, and using a [0,1] parameterization if this is the case.
if (midPoint.IsEqualTo(target.EndPoint))
{
midPoint = target.EvaluatePoint(0.5);
}

AG.Point3d midPoint = target.EvaluatePoint(target.StartAngle + (target.EndAngle - target.StartAngle) / 2);
SOG.Point mid = _pointConverter.Convert(midPoint);

SOG.Arc arc =
Expand Down

0 comments on commit 55e8ad8

Please sign in to comment.