refactor: use 'length' instead of 'height' in nest JSON format
Rename SizeDto.Height to SizeDto.Length so the serialized JSON uses "width"/"length" which is more natural for plate materials. The core Size struct still uses Height internally. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -72,7 +72,7 @@ namespace OpenNest.IO
|
||||
public record SizeDto
|
||||
{
|
||||
public double Width { get; init; }
|
||||
public double Height { get; init; }
|
||||
public double Length { get; init; }
|
||||
}
|
||||
|
||||
public record MaterialDto
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace OpenNest.IO
|
||||
|
||||
// Plate defaults
|
||||
var pd = dto.PlateDefaults;
|
||||
nest.PlateDefaults.Size = new OpenNest.Geometry.Size(pd.Size.Width, pd.Size.Height);
|
||||
nest.PlateDefaults.Size = new OpenNest.Geometry.Size(pd.Size.Width, pd.Size.Length);
|
||||
nest.PlateDefaults.Thickness = pd.Thickness;
|
||||
nest.PlateDefaults.Quadrant = pd.Quadrant;
|
||||
nest.PlateDefaults.PartSpacing = pd.PartSpacing;
|
||||
@@ -128,7 +128,7 @@ namespace OpenNest.IO
|
||||
foreach (var p in dto.Plates.OrderBy(p => p.Id))
|
||||
{
|
||||
var plate = new Plate();
|
||||
plate.Size = new OpenNest.Geometry.Size(p.Size.Width, p.Size.Height);
|
||||
plate.Size = new OpenNest.Geometry.Size(p.Size.Width, p.Size.Length);
|
||||
plate.Thickness = p.Thickness;
|
||||
plate.Quadrant = p.Quadrant;
|
||||
plate.Quantity = p.Quantity;
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace OpenNest.IO
|
||||
var pd = nest.PlateDefaults;
|
||||
return new PlateDefaultsDto
|
||||
{
|
||||
Size = new SizeDto { Width = pd.Size.Width, Height = pd.Size.Height },
|
||||
Size = new SizeDto { Width = pd.Size.Width, Length = pd.Size.Height },
|
||||
Thickness = pd.Thickness,
|
||||
Quadrant = pd.Quadrant,
|
||||
PartSpacing = pd.PartSpacing,
|
||||
@@ -161,7 +161,7 @@ namespace OpenNest.IO
|
||||
list.Add(new PlateDto
|
||||
{
|
||||
Id = i + 1,
|
||||
Size = new SizeDto { Width = plate.Size.Width, Height = plate.Size.Height },
|
||||
Size = new SizeDto { Width = plate.Size.Width, Length = plate.Size.Height },
|
||||
Thickness = plate.Thickness,
|
||||
Quadrant = plate.Quadrant,
|
||||
Quantity = plate.Quantity,
|
||||
|
||||
Reference in New Issue
Block a user