fix: Circle.ToPoints ignores Rotation, breaking reverse direction for circular perimeters

Circle.ToPoints() always generated CCW points regardless of the Rotation
property, so reversing a circle contour in the CAD converter had no effect.
Now negates the step angle when Rotation is CW, matching Arc.ToPoints behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 08:29:42 -04:00
parent 250fdefaea
commit ba88ac253a
2 changed files with 17 additions and 1 deletions

View File

@@ -154,4 +154,18 @@ public class ContourClassificationTests
Assert.NotEqual(originalDirection, newDirection);
}
[Fact]
public void Reverse_changes_direction_label_for_circle()
{
var shape = MakeCircleShape(0, 0, 10);
var contours = ContourInfo.Classify(new List<Shape> { shape });
var contour = contours[0];
var originalDirection = contour.DirectionLabel;
contour.Reverse();
var newDirection = contour.DirectionLabel;
Assert.NotEqual(originalDirection, newDirection);
}
}