feat: add pierce point visualization and rename shape dimensions to Length/Width
Add toggleable pierce point drawing to PlateView that shows small red filled circles at each rapid move endpoint (where cutting begins). Wire through View menu, EditNestForm toggle, and MainForm handler. Also rename RectangleShape/RoundedRectangleShape Width/Height to Length/Width for consistency with CNC conventions, update MCP tools and tests accordingly. Fix SplitDrawingForm designer layout ordering and EntityView bend line selection styling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -122,7 +122,7 @@ namespace OpenNest.Mcp.Tools
|
||||
[Description("Name for the drawing")] string name,
|
||||
[Description("Shape type: rectangle, circle, l_shape, t_shape, gcode")] string shape,
|
||||
[Description("Width of the shape (not used for circle or gcode)")] double width = 10,
|
||||
[Description("Height of the shape (not used for circle or gcode)")] double height = 10,
|
||||
[Description("Length of the shape (not used for circle or gcode)")] double length = 10,
|
||||
[Description("Radius for circle shape")] double radius = 5,
|
||||
[Description("G-code string (only used when shape is 'gcode')")] string gcode = null)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ namespace OpenNest.Mcp.Tools
|
||||
switch (shape.ToLower())
|
||||
{
|
||||
case "rectangle":
|
||||
shapeDef = new RectangleShape { Name = name, Width = width, Height = height };
|
||||
shapeDef = new RectangleShape { Name = name, Width = width, Length = length };
|
||||
break;
|
||||
|
||||
case "circle":
|
||||
@@ -139,11 +139,11 @@ namespace OpenNest.Mcp.Tools
|
||||
break;
|
||||
|
||||
case "l_shape":
|
||||
shapeDef = new LShape { Name = name, Width = width, Height = height };
|
||||
shapeDef = new LShape { Name = name, Width = width, Height = length };
|
||||
break;
|
||||
|
||||
case "t_shape":
|
||||
shapeDef = new TShape { Name = name, Width = width, Height = height };
|
||||
shapeDef = new TShape { Name = name, Width = width, Height = length };
|
||||
break;
|
||||
|
||||
case "gcode":
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace OpenNest.Mcp.Tools
|
||||
[Description("X origin of the area")] double x,
|
||||
[Description("Y origin of the area")] double y,
|
||||
[Description("Width of the area")] double width,
|
||||
[Description("Height of the area")] double height,
|
||||
[Description("Length of the area")] double length,
|
||||
[Description("Maximum quantity to place (0 = unlimited)")] int quantity = 0)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
@@ -73,14 +73,14 @@ namespace OpenNest.Mcp.Tools
|
||||
var countBefore = plate.Parts.Count;
|
||||
var engine = NestEngineRegistry.Create(plate);
|
||||
var item = new NestItem { Drawing = drawing, Quantity = quantity };
|
||||
var area = new Box(x, y, width, height);
|
||||
var area = new Box(x, y, width, length);
|
||||
var success = engine.Fill(item, area);
|
||||
|
||||
var countAfter = plate.Parts.Count;
|
||||
var added = countAfter - countBefore;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($"Fill area ({x:F1},{y:F1} {width:F1}x{height:F1}) on plate {plateIndex} with '{drawingName}': {(success ? "success" : "failed")}");
|
||||
sb.AppendLine($"Fill area ({x:F1},{y:F1} {width:F1}x{length:F1}) on plate {plateIndex} with '{drawingName}': {(success ? "success" : "failed")}");
|
||||
sb.AppendLine($" Parts added: {added}");
|
||||
sb.AppendLine($" Total parts: {countAfter}");
|
||||
sb.AppendLine($" Utilization: {plate.Utilization():P1}");
|
||||
|
||||
@@ -19,13 +19,13 @@ namespace OpenNest.Mcp.Tools
|
||||
[Description("Create a new plate with the given dimensions and spacing. Returns plate index and work area.")]
|
||||
public string CreatePlate(
|
||||
[Description("Plate width")] double width,
|
||||
[Description("Plate height")] double height,
|
||||
[Description("Plate length")] double length,
|
||||
[Description("Spacing between parts (default 0)")] double partSpacing = 0,
|
||||
[Description("Edge spacing on all sides (default 0)")] double edgeSpacing = 0,
|
||||
[Description("Quadrant 1-4 (default 1). 1=TopRight, 2=TopLeft, 3=BottomLeft, 4=BottomRight")] int quadrant = 1,
|
||||
[Description("Material name (optional)")] string material = null)
|
||||
{
|
||||
var plate = new Plate(width, height);
|
||||
var plate = new Plate(width, length);
|
||||
plate.PartSpacing = partSpacing;
|
||||
plate.EdgeSpacing = new Spacing(edgeSpacing, edgeSpacing);
|
||||
plate.Quadrant = quadrant;
|
||||
|
||||
Reference in New Issue
Block a user