style: apply CSharpier formatting to all C# sources
Repo-wide sweep with the pinned CSharpier 1.3.0 tool. Whitespace and line-wrapping only; OpenNest.Engine.Tests (109) and OpenNest.IO.Tests pass after reformat, full solution builds 0 errors. Added .csharpierignore so csproj/config XML keeps its existing layout (CSharpier's XML wrapping churns attributes with zero benefit). Formatting is now enforceable: dotnet csharpier check . passes.
This commit is contained in:
@@ -5,8 +5,8 @@ using OpenNest.Mcp;
|
||||
var builder = Host.CreateApplicationBuilder(args);
|
||||
|
||||
builder.Services.AddSingleton<NestSession>();
|
||||
builder.Services
|
||||
.AddMcpServer()
|
||||
builder
|
||||
.Services.AddMcpServer()
|
||||
.WithStdioServerTransport()
|
||||
.WithToolsFromAssembly(typeof(Program).Assembly);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using ModelContextProtocol.Server;
|
||||
using OpenNest.IO;
|
||||
using OpenNest.Shapes;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using ModelContextProtocol.Server;
|
||||
using OpenNest.IO;
|
||||
using OpenNest.Shapes;
|
||||
using CncProgram = OpenNest.CNC.Program;
|
||||
|
||||
namespace OpenNest.Mcp.Tools
|
||||
@@ -19,7 +19,9 @@ namespace OpenNest.Mcp.Tools
|
||||
}
|
||||
|
||||
[McpServerTool(Name = "load_nest")]
|
||||
[Description("Load a .nest file into the session. Returns a summary of plates, parts, and drawings.")]
|
||||
[Description(
|
||||
"Load a .nest file into the session. Returns a summary of plates, parts, and drawings."
|
||||
)]
|
||||
public string LoadNest([Description("Absolute path to the .nest file")] string path)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
@@ -38,10 +40,12 @@ namespace OpenNest.Mcp.Tools
|
||||
{
|
||||
var plate = nest.Plates[i];
|
||||
var work = plate.WorkArea();
|
||||
sb.AppendLine($" Plate {i}: {plate.Size.Width:F1} x {plate.Size.Length:F1}, " +
|
||||
$"parts={plate.Parts.Count}, " +
|
||||
$"utilization={plate.Utilization():P1}, " +
|
||||
$"work area={work.Width:F1} x {work.Length:F1}");
|
||||
sb.AppendLine(
|
||||
$" Plate {i}: {plate.Size.Width:F1} x {plate.Size.Length:F1}, "
|
||||
+ $"parts={plate.Parts.Count}, "
|
||||
+ $"utilization={plate.Utilization():P1}, "
|
||||
+ $"work area={work.Width:F1} x {work.Length:F1}"
|
||||
);
|
||||
}
|
||||
|
||||
sb.AppendLine($"Drawings: {nest.Drawings.Count}");
|
||||
@@ -49,8 +53,10 @@ namespace OpenNest.Mcp.Tools
|
||||
foreach (var dwg in nest.Drawings)
|
||||
{
|
||||
var bbox = dwg.Program.BoundingBox();
|
||||
sb.AppendLine($" {dwg.Name}: bbox={bbox.Width:F2} x {bbox.Length:F2}, " +
|
||||
$"required={dwg.Quantity.Required}, nested={dwg.Quantity.Nested}");
|
||||
sb.AppendLine(
|
||||
$" {dwg.Name}: bbox={bbox.Width:F2} x {bbox.Length:F2}, "
|
||||
+ $"required={dwg.Quantity.Required}, nested={dwg.Quantity.Nested}"
|
||||
);
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
@@ -60,7 +66,8 @@ namespace OpenNest.Mcp.Tools
|
||||
[Description("Save the current session (all drawings and plates) to a .nest file.")]
|
||||
public string SaveNest(
|
||||
[Description("Absolute path for the output .nest file")] string path,
|
||||
[Description("Name for the nest (optional)")] string name = null)
|
||||
[Description("Name for the nest (optional)")] string name = null
|
||||
)
|
||||
{
|
||||
var nest = new Nest();
|
||||
nest.Name = name ?? Path.GetFileNameWithoutExtension(path);
|
||||
@@ -89,7 +96,9 @@ namespace OpenNest.Mcp.Tools
|
||||
[Description("Import a DXF file as a new drawing. Returns drawing name and bounding box.")]
|
||||
public string ImportDxf(
|
||||
[Description("Absolute path to the DXF file")] string path,
|
||||
[Description("Name for the drawing (defaults to filename without extension)")] string name = null)
|
||||
[Description("Name for the drawing (defaults to filename without extension)")]
|
||||
string name = null
|
||||
)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
return $"Error: file not found: {path}";
|
||||
@@ -109,21 +118,29 @@ namespace OpenNest.Mcp.Tools
|
||||
}
|
||||
|
||||
[McpServerTool(Name = "create_drawing")]
|
||||
[Description("Create a drawing from a built-in shape or G-code string. Shape can be: rectangle, circle, l_shape, t_shape, gcode.")]
|
||||
[Description(
|
||||
"Create a drawing from a built-in shape or G-code string. Shape can be: rectangle, circle, l_shape, t_shape, gcode."
|
||||
)]
|
||||
public string CreateDrawing(
|
||||
[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("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)
|
||||
[Description("G-code string (only used when shape is 'gcode')")] string gcode = null
|
||||
)
|
||||
{
|
||||
ShapeDefinition shapeDef;
|
||||
|
||||
switch (shape.ToLower())
|
||||
{
|
||||
case "rectangle":
|
||||
shapeDef = new RectangleShape { Name = name, Width = width, Length = length };
|
||||
shapeDef = new RectangleShape
|
||||
{
|
||||
Name = name,
|
||||
Width = width,
|
||||
Length = length,
|
||||
};
|
||||
break;
|
||||
|
||||
case "circle":
|
||||
@@ -131,11 +148,21 @@ namespace OpenNest.Mcp.Tools
|
||||
break;
|
||||
|
||||
case "l_shape":
|
||||
shapeDef = new LShape { Name = name, Width = width, Height = length };
|
||||
shapeDef = new LShape
|
||||
{
|
||||
Name = name,
|
||||
Width = width,
|
||||
Height = length,
|
||||
};
|
||||
break;
|
||||
|
||||
case "t_shape":
|
||||
shapeDef = new TShape { Name = name, Width = width, Height = length };
|
||||
shapeDef = new TShape
|
||||
{
|
||||
Name = name,
|
||||
Width = width,
|
||||
Height = length,
|
||||
};
|
||||
break;
|
||||
|
||||
case "gcode":
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using ModelContextProtocol.Server;
|
||||
using OpenNest.Engine.Fill;
|
||||
using OpenNest.Math;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using ModelContextProtocol.Server;
|
||||
using OpenNest.Engine.Fill;
|
||||
using OpenNest.Math;
|
||||
|
||||
namespace OpenNest.Mcp.Tools
|
||||
{
|
||||
@@ -18,9 +18,10 @@ namespace OpenNest.Mcp.Tools
|
||||
}
|
||||
|
||||
[McpServerTool(Name = "get_plate_info")]
|
||||
[Description("Get detailed information about a plate including dimensions, part count, utilization, remnants, and drawing breakdown.")]
|
||||
public string GetPlateInfo(
|
||||
[Description("Index of the plate")] int plateIndex)
|
||||
[Description(
|
||||
"Get detailed information about a plate including dimensions, part count, utilization, remnants, and drawing breakdown."
|
||||
)]
|
||||
public string GetPlateInfo([Description("Index of the plate")] int plateIndex)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
if (plate == null)
|
||||
@@ -36,7 +37,9 @@ namespace OpenNest.Mcp.Tools
|
||||
sb.AppendLine($" Thickness: {_session.Nest?.Thickness:F2}");
|
||||
sb.AppendLine($" Material: {_session.Nest?.Material?.Name}");
|
||||
sb.AppendLine($" Part spacing: {plate.PartSpacing:F2}");
|
||||
sb.AppendLine($" Edge spacing: L={plate.EdgeSpacing.Left:F2} B={plate.EdgeSpacing.Bottom:F2} R={plate.EdgeSpacing.Right:F2} T={plate.EdgeSpacing.Top:F2}");
|
||||
sb.AppendLine(
|
||||
$" Edge spacing: L={plate.EdgeSpacing.Left:F2} B={plate.EdgeSpacing.Bottom:F2} R={plate.EdgeSpacing.Right:F2} T={plate.EdgeSpacing.Top:F2}"
|
||||
);
|
||||
sb.AppendLine($" Work area: {work.X:F1},{work.Y:F1} {work.Width:F1}x{work.Length:F1}");
|
||||
sb.AppendLine($" Parts: {plate.Parts.Count}");
|
||||
sb.AppendLine($" Utilization: {plate.Utilization():P1}");
|
||||
@@ -56,17 +59,22 @@ namespace OpenNest.Mcp.Tools
|
||||
for (var i = 0; i < remnants.Count; i++)
|
||||
{
|
||||
var r = remnants[i];
|
||||
sb.AppendLine($" Remnant {i}: ({r.X:F1},{r.Y:F1}) {r.Width:F1}x{r.Length:F1}, area={r.Area():F1}");
|
||||
sb.AppendLine(
|
||||
$" Remnant {i}: ({r.X:F1},{r.Y:F1}) {r.Width:F1}x{r.Length:F1}, area={r.Area():F1}"
|
||||
);
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
[McpServerTool(Name = "get_parts")]
|
||||
[Description("List placed parts on a plate with index, drawing name, location, rotation, and bounding box.")]
|
||||
[Description(
|
||||
"List placed parts on a plate with index, drawing name, location, rotation, and bounding box."
|
||||
)]
|
||||
public string GetParts(
|
||||
[Description("Index of the plate")] int plateIndex,
|
||||
[Description("Maximum number of parts to list (default 50)")] int limit = 50)
|
||||
[Description("Maximum number of parts to list (default 50)")] int limit = 50
|
||||
)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
if (plate == null)
|
||||
@@ -86,10 +94,12 @@ namespace OpenNest.Mcp.Tools
|
||||
var bbox = part.BoundingBox;
|
||||
var rotDeg = Angle.ToDegrees(part.Rotation);
|
||||
|
||||
sb.AppendLine($" [{i}] {part.BaseDrawing.Name}: " +
|
||||
$"loc=({part.Location.X:F2},{part.Location.Y:F2}), " +
|
||||
$"rot={rotDeg:F1} deg, " +
|
||||
$"bbox=({bbox.X:F2},{bbox.Y:F2} {bbox.Width:F2}x{bbox.Length:F2})");
|
||||
sb.AppendLine(
|
||||
$" [{i}] {part.BaseDrawing.Name}: "
|
||||
+ $"loc=({part.Location.X:F2},{part.Location.Y:F2}), "
|
||||
+ $"rot={rotDeg:F1} deg, "
|
||||
+ $"bbox=({bbox.X:F2},{bbox.Y:F2} {bbox.Width:F2}x{bbox.Length:F2})"
|
||||
);
|
||||
}
|
||||
|
||||
if (plate.Parts.Count > limit)
|
||||
@@ -100,8 +110,7 @@ namespace OpenNest.Mcp.Tools
|
||||
|
||||
[McpServerTool(Name = "check_overlaps")]
|
||||
[Description("Check a plate for overlapping parts. Reports collision points if any.")]
|
||||
public string CheckOverlaps(
|
||||
[Description("Index of the plate")] int plateIndex)
|
||||
public string CheckOverlaps([Description("Index of the plate")] int plateIndex)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
if (plate == null)
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using ModelContextProtocol.Server;
|
||||
using OpenNest.Engine.Fill;
|
||||
using OpenNest.Geometry;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using ModelContextProtocol.Server;
|
||||
using OpenNest.Engine.Fill;
|
||||
using OpenNest.Geometry;
|
||||
|
||||
namespace OpenNest.Mcp.Tools
|
||||
{
|
||||
@@ -20,11 +20,14 @@ namespace OpenNest.Mcp.Tools
|
||||
}
|
||||
|
||||
[McpServerTool(Name = "fill_plate")]
|
||||
[Description("Fill an entire plate with a single drawing. Returns parts added and utilization.")]
|
||||
[Description(
|
||||
"Fill an entire plate with a single drawing. Returns parts added and utilization."
|
||||
)]
|
||||
public string FillPlate(
|
||||
[Description("Index of the plate to fill")] int plateIndex,
|
||||
[Description("Name of the drawing to fill with")] string drawingName,
|
||||
[Description("Maximum quantity to place (0 = unlimited)")] int quantity = 0)
|
||||
[Description("Maximum quantity to place (0 = unlimited)")] int quantity = 0
|
||||
)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
if (plate == null)
|
||||
@@ -43,7 +46,9 @@ namespace OpenNest.Mcp.Tools
|
||||
var added = countAfter - countBefore;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($"Fill plate {plateIndex} with '{drawingName}': {(success ? "success" : "failed")}");
|
||||
sb.AppendLine(
|
||||
$"Fill plate {plateIndex} with '{drawingName}': {(success ? "success" : "failed")}"
|
||||
);
|
||||
sb.AppendLine($" Parts added: {added}");
|
||||
sb.AppendLine($" Total parts: {countAfter}");
|
||||
sb.AppendLine($" Utilization: {plate.Utilization():P1}");
|
||||
@@ -60,7 +65,8 @@ namespace OpenNest.Mcp.Tools
|
||||
[Description("Y origin of the area")] double y,
|
||||
[Description("Width of the area")] double width,
|
||||
[Description("Length of the area")] double length,
|
||||
[Description("Maximum quantity to place (0 = unlimited)")] int quantity = 0)
|
||||
[Description("Maximum quantity to place (0 = unlimited)")] int quantity = 0
|
||||
)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
if (plate == null)
|
||||
@@ -80,7 +86,9 @@ namespace OpenNest.Mcp.Tools
|
||||
var added = countAfter - countBefore;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($"Fill area ({x:F1},{y:F1} {width:F1}x{length: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}");
|
||||
@@ -93,7 +101,8 @@ namespace OpenNest.Mcp.Tools
|
||||
public string FillRemnants(
|
||||
[Description("Index of the plate")] int plateIndex,
|
||||
[Description("Name of the drawing to fill with")] string drawingName,
|
||||
[Description("Maximum quantity per remnant (0 = unlimited)")] int quantity = 0)
|
||||
[Description("Maximum quantity per remnant (0 = unlimited)")] int quantity = 0
|
||||
)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
if (plate == null)
|
||||
@@ -124,7 +133,9 @@ namespace OpenNest.Mcp.Tools
|
||||
var added = plate.Parts.Count - countBefore;
|
||||
totalAdded += added;
|
||||
|
||||
sb.AppendLine($" Remnant {i}: ({remnant.X:F1},{remnant.Y:F1} {remnant.Width:F1}x{remnant.Length:F1}) -> {added} parts {(success ? "" : "(no fit)")}");
|
||||
sb.AppendLine(
|
||||
$" Remnant {i}: ({remnant.X:F1},{remnant.Y:F1} {remnant.Width:F1}x{remnant.Length:F1}) -> {added} parts {(success ? "" : "(no fit)")}"
|
||||
);
|
||||
}
|
||||
|
||||
sb.AppendLine($"Total parts added: {totalAdded}");
|
||||
@@ -134,11 +145,14 @@ namespace OpenNest.Mcp.Tools
|
||||
}
|
||||
|
||||
[McpServerTool(Name = "pack_plate")]
|
||||
[Description("Pack multiple drawings onto a plate using bin-packing. Specify drawings and quantities as comma-separated lists.")]
|
||||
[Description(
|
||||
"Pack multiple drawings onto a plate using bin-packing. Specify drawings and quantities as comma-separated lists."
|
||||
)]
|
||||
public string PackPlate(
|
||||
[Description("Index of the plate")] int plateIndex,
|
||||
[Description("Comma-separated drawing names")] string drawingNames,
|
||||
[Description("Comma-separated quantities for each drawing")] string quantities)
|
||||
[Description("Comma-separated quantities for each drawing")] string quantities
|
||||
)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
if (plate == null)
|
||||
@@ -195,11 +209,14 @@ namespace OpenNest.Mcp.Tools
|
||||
}
|
||||
|
||||
[McpServerTool(Name = "autonest_plate")]
|
||||
[Description("Mixed-part autonesting. Fills the plate with multiple different drawings using iterative per-drawing fills with remainder-strip packing.")]
|
||||
[Description(
|
||||
"Mixed-part autonesting. Fills the plate with multiple different drawings using iterative per-drawing fills with remainder-strip packing."
|
||||
)]
|
||||
public string AutoNestPlate(
|
||||
[Description("Index of the plate")] int plateIndex,
|
||||
[Description("Comma-separated drawing names")] string drawingNames,
|
||||
[Description("Comma-separated quantities for each drawing")] string quantities)
|
||||
[Description("Comma-separated quantities for each drawing")] string quantities
|
||||
)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
if (plate == null)
|
||||
@@ -241,7 +258,9 @@ namespace OpenNest.Mcp.Tools
|
||||
var totalPlaced = nestParts.Count;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine($"AutoNest plate {plateIndex} ({engine.Name} engine): {(totalPlaced > 0 ? "success" : "no parts placed")}");
|
||||
sb.AppendLine(
|
||||
$"AutoNest plate {plateIndex} ({engine.Name} engine): {(totalPlaced > 0 ? "success" : "no parts placed")}"
|
||||
);
|
||||
sb.AppendLine($" Parts placed: {totalPlaced}");
|
||||
sb.AppendLine($" Total parts: {plate.Parts.Count}");
|
||||
sb.AppendLine($" Utilization: {plate.Utilization():P1}");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using ModelContextProtocol.Server;
|
||||
using OpenNest.Geometry;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using ModelContextProtocol.Server;
|
||||
using OpenNest.Geometry;
|
||||
|
||||
namespace OpenNest.Mcp.Tools
|
||||
{
|
||||
@@ -16,14 +16,20 @@ namespace OpenNest.Mcp.Tools
|
||||
}
|
||||
|
||||
[McpServerTool(Name = "create_plate")]
|
||||
[Description("Create a new plate with the given dimensions and spacing. Returns plate index and work area.")]
|
||||
[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 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)
|
||||
[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, length);
|
||||
plate.PartSpacing = partSpacing;
|
||||
@@ -44,7 +50,9 @@ namespace OpenNest.Mcp.Tools
|
||||
sb.AppendLine($"Created plate {index}: {plate.Size.Width:F1} x {plate.Size.Length:F1}");
|
||||
sb.AppendLine($" Quadrant: {plate.Quadrant}");
|
||||
sb.AppendLine($" Part spacing: {plate.PartSpacing:F2}");
|
||||
sb.AppendLine($" Edge spacing: L={plate.EdgeSpacing.Left:F2} B={plate.EdgeSpacing.Bottom:F2} R={plate.EdgeSpacing.Right:F2} T={plate.EdgeSpacing.Top:F2}");
|
||||
sb.AppendLine(
|
||||
$" Edge spacing: L={plate.EdgeSpacing.Left:F2} B={plate.EdgeSpacing.Bottom:F2} R={plate.EdgeSpacing.Right:F2} T={plate.EdgeSpacing.Top:F2}"
|
||||
);
|
||||
sb.AppendLine($" Work area: {work.Width:F1} x {work.Length:F1}");
|
||||
|
||||
return sb.ToString();
|
||||
@@ -52,8 +60,7 @@ namespace OpenNest.Mcp.Tools
|
||||
|
||||
[McpServerTool(Name = "clear_plate")]
|
||||
[Description("Remove all parts from a plate. Returns how many parts were removed.")]
|
||||
public string ClearPlate(
|
||||
[Description("Index of the plate to clear")] int plateIndex)
|
||||
public string ClearPlate([Description("Index of the plate to clear")] int plateIndex)
|
||||
{
|
||||
var plate = _session.GetPlate(plateIndex);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using ModelContextProtocol.Server;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using ModelContextProtocol.Server;
|
||||
|
||||
namespace OpenNest.Mcp.Tools
|
||||
{
|
||||
@@ -12,15 +12,24 @@ namespace OpenNest.Mcp.Tools
|
||||
private const string SolutionRoot = @"C:\Users\AJ\Desktop\Projects\OpenNest";
|
||||
|
||||
private static readonly string HarnessProject = Path.Combine(
|
||||
SolutionRoot, "OpenNest.Console", "OpenNest.Console.csproj");
|
||||
SolutionRoot,
|
||||
"OpenNest.Console",
|
||||
"OpenNest.Console.csproj"
|
||||
);
|
||||
|
||||
[McpServerTool(Name = "test_engine")]
|
||||
[Description("Build and run the nesting engine against a nest file. Returns fill results and a debug log file path for grepping. Use this to test engine changes without restarting the MCP server.")]
|
||||
[Description(
|
||||
"Build and run the nesting engine against a nest file. Returns fill results and a debug log file path for grepping. Use this to test engine changes without restarting the MCP server."
|
||||
)]
|
||||
public string TestEngine(
|
||||
[Description("Path to the nest .nest file")] string nestFile = @"C:\Users\AJ\Desktop\4980 A24 PT02 60x120 45pcs v2.nest",
|
||||
[Description("Drawing name to fill with (default: first drawing)")] string drawingName = null,
|
||||
[Description("Path to the nest .nest file")]
|
||||
string nestFile = @"C:\Users\AJ\Desktop\4980 A24 PT02 60x120 45pcs v2.nest",
|
||||
[Description("Drawing name to fill with (default: first drawing)")]
|
||||
string drawingName = null,
|
||||
[Description("Plate index to fill (default: 0)")] int plateIndex = 0,
|
||||
[Description("Output nest file path (default: <input>-result.nest)")] string outputFile = null)
|
||||
[Description("Output nest file path (default: <input>-result.nest)")]
|
||||
string outputFile = null
|
||||
)
|
||||
{
|
||||
if (!File.Exists(nestFile))
|
||||
return $"Error: nest file not found: {nestFile}";
|
||||
@@ -44,7 +53,7 @@ namespace OpenNest.Mcp.Tools
|
||||
RedirectStandardError = true,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true,
|
||||
WorkingDirectory = SolutionRoot
|
||||
WorkingDirectory = SolutionRoot,
|
||||
};
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user