using OpenNest.Math; namespace OpenNest { public class NestConstraints { /// /// The rotation step in radians. /// public double StepAngle { get; set; } /// /// The rotation start angle in radians. /// public double StartAngle { get; set; } /// /// The rotation end angle in radians. /// public double EndAngle { get; set; } public bool Allow180Equivalent { get; set; } /// /// Sets the StartAngle and EndAngle to allow 360 degree rotation. /// 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; } } }