Skip to content

Commit

Permalink
precision points
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Jul 1, 2024
1 parent 7666608 commit bcb7e99
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ public ACG.Polyline Convert(SOG.Polycurve target)
ACG.Polyline converted = (ACG.Polyline)_converter.Convert((Base)segment); //CurveConverter.NotNull().Convert(segment);
List<ACG.MapPoint> segmentPts = converted.Points.ToList();

if (lastConvertedPt != null && segmentPts.Count > 0 && lastConvertedPt != segmentPts[0])
if (
lastConvertedPt != null
&& segmentPts.Count > 0
&& (
Math.Round(lastConvertedPt.X, 6) != Math.Round(segmentPts[0].X, 6)
|| Math.Round(lastConvertedPt.Y, 6) != Math.Round(segmentPts[0].Y, 6)
|| Math.Round(lastConvertedPt.Z, 6) != Math.Round(segmentPts[0].Z, 6)
)
)
{
throw new SpeckleConversionException("Polycurve segments are not in a correct sequence/orientation");
}
Expand Down

0 comments on commit bcb7e99

Please sign in to comment.