mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-02 17:11:35 -05:00
Share the nest server client setup and page validation, entity endpoints, post marker checks and the repeated desktop list, cut-time and busy-warning code. Persistence tests use NestArchiveJson. No behavior change intended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
746 B
C#
27 lines
746 B
C#
namespace OpenNest.Geometry
|
|
{
|
|
internal static class EntityEndpoints
|
|
{
|
|
/// <summary>The start and end of a line or arc; false for any other entity.</summary>
|
|
public static bool TryGet(Entity entity, out Vector start, out Vector end)
|
|
{
|
|
switch (entity)
|
|
{
|
|
case Line line:
|
|
start = line.StartPoint;
|
|
end = line.EndPoint;
|
|
return true;
|
|
|
|
case Arc arc:
|
|
start = arc.StartPoint();
|
|
end = arc.EndPoint();
|
|
return true;
|
|
|
|
default:
|
|
start = end = default;
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|