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.
34 lines
817 B
C#
34 lines
817 B
C#
using System.Collections.Generic;
|
|
using OpenNest.Geometry;
|
|
|
|
namespace OpenNest.Shapes
|
|
{
|
|
public class IsoscelesTriangleShape : ShapeDefinition
|
|
{
|
|
public double Base { get; set; }
|
|
public double Height { get; set; }
|
|
|
|
public override string GenerateName() => $"Isosceles Triangle {Dim(Base)}x{Dim(Height)}";
|
|
|
|
public override void SetPreviewDefaults()
|
|
{
|
|
Base = 8;
|
|
Height = 10;
|
|
}
|
|
|
|
public override Drawing GetDrawing()
|
|
{
|
|
var midX = Base / 2.0;
|
|
|
|
var entities = new List<Entity>
|
|
{
|
|
new Line(0, 0, Base, 0),
|
|
new Line(Base, 0, midX, Height),
|
|
new Line(midX, Height, 0, 0),
|
|
};
|
|
|
|
return CreateDrawing(entities);
|
|
}
|
|
}
|
|
}
|