Move all projects from Source/ to repository root for simpler navigation. - Remove External/ dependency DLLs (will use NuGet packages) - Remove Installer/ NSIS script - Replace PartCollection/PlateCollection with ObservableList - Add packages.config for NuGet dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using System;
|
|
|
|
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 > Math.PI || diff.IsEqualTo(Math.PI)) && Allow180Equivalent)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|