mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-27 09:21:05 -04:00
Some jobs cut only cutouts into a supplied blank, such as instrument holes in a purchased door that is the whole sheet. Its outline has to be known to the planner (the blank is material that leads, rapids and cut-offs must respect) but must never be pierced, led or cut. A new DisplayPerimeter layer marks that outline. It is material, so nesting, containment, lead clearance and automatic cut-offs all see the blank; a door that fills its sheet leaves cut-offs nothing to cut. Cutting preparation keeps it out of the contours entirely: with no cut perimeter every contour is a hole with internal leads, and the search, best-effort and safest-route paths stop offering a perimeter. Replay refuses any run along the display perimeter and completes once every other ring is cut. A display perimeter must be one whole closed contour enclosing every other contour; a mixed ring, one inside another contour, or a second one is refused with that reason. Saving, drawing and posting it are still to do.
41 lines
1.9 KiB
C#
41 lines
1.9 KiB
C#
using System.Drawing;
|
|
using OpenNest.Geometry;
|
|
|
|
namespace OpenNest
|
|
{
|
|
public static class SpecialLayers
|
|
{
|
|
public static readonly Layer Default = new Layer("0") { Color = Color.White };
|
|
|
|
public static readonly Layer Cut = new Layer("CUT") { Color = Color.White };
|
|
|
|
public static readonly Layer Rapid = new Layer("RAPID") { Color = Color.Gray };
|
|
|
|
public static readonly Layer Display = new Layer("DISPLAY") { Color = Color.Cyan };
|
|
|
|
public static readonly Layer Leadin = new Layer("LEADIN") { Color = Color.Brown };
|
|
|
|
public static readonly Layer Leadout = new Layer("LEADOUT") { Color = Color.Brown };
|
|
|
|
public static readonly Layer Scribe = new Layer("SCRIBE") { Color = Color.Magenta };
|
|
|
|
public static readonly Layer Break = new Layer("BREAK") { Color = Color.Orange };
|
|
|
|
/// <summary>A tabbed cutout's uncut tabs: material boundary that is never cut.</summary>
|
|
public static readonly Layer Tab = new Layer("TAB") { Color = Color.Orange };
|
|
|
|
/// <summary>A supplied blank's shown-only outside edge: material boundary that is never cut.</summary>
|
|
public static readonly Layer DisplayPerimeter = new Layer("DISPLAY PERIMETER") { Color = Color.DarkCyan };
|
|
|
|
/// <summary>
|
|
/// True when an entity converted from a part program describes part material. Rapids
|
|
/// and scribe/etch marks are excluded: marks are only on the surface, so they never
|
|
/// bound material and must not affect nesting, collision, area, or validation. Break
|
|
/// cuts are excluded too: they run through material that stays attached at tabs. Tabs are
|
|
/// material: they close a tabbed cutout's boundary. A display perimeter is material: it is the
|
|
/// supplied blank's edge.
|
|
/// </summary>
|
|
public static bool IsMaterial(Layer layer) => layer != Rapid && layer != Scribe && layer != Break;
|
|
}
|
|
}
|