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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user