fix: address review findings — input validation, exception handling, cleanup
Add argument validation to EllipseConverter.Convert for tolerance and semi-axis parameters. Narrow bare catch in Extensions.cs spline method to log via Debug.WriteLine. Remove unused lineCount variable from SolidWorksBendDetectorTests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -67,6 +67,11 @@ namespace OpenNest.Geometry
|
||||
public static List<Entity> Convert(Vector center, double semiMajor, double semiMinor,
|
||||
double rotation, double startParam, double endParam, double tolerance = 0.001)
|
||||
{
|
||||
if (tolerance <= 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(tolerance), "Tolerance must be positive.");
|
||||
if (semiMajor <= 0 || semiMinor <= 0)
|
||||
throw new ArgumentOutOfRangeException("Semi-axis lengths must be positive.");
|
||||
|
||||
if (endParam <= startParam)
|
||||
endParam += Angle.TwoPI;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user