Files
OpenNest/OpenNest.Core/NestConstraints.cs
AJ Isaacs 1d9bcc63d2 chore: sort using directives
Auto-formatter reordering of using statements across the solution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:47:42 -04:00

47 lines
1.1 KiB
C#

using OpenNest.Math;
namespace OpenNest
{
public class NestConstraints
{
/// <summary>
/// The rotation step in radians.
/// </summary>
public double StepAngle { get; set; }
/// <summary>
/// The rotation start angle in radians.
/// </summary>
public double StartAngle { get; set; }
/// <summary>
/// The rotation end angle in radians.
/// </summary>
public double EndAngle { get; set; }
public bool Allow180Equivalent { get; set; }
/// <summary>
/// Sets the StartAngle and EndAngle to allow 360 degree rotation.
/// </summary>
public void AllowAnyRotation()
{
StartAngle = 0;
EndAngle = Angle.TwoPI;
}
public bool HasLimitedRotation()
{
var diff = EndAngle - StartAngle;
if (diff.IsEqualTo(Angle.TwoPI))
return false;
if ((diff > System.Math.PI || diff.IsEqualTo(System.Math.PI)) && Allow180Equivalent)
return false;
return true;
}
}
}