feat: Shape.CreateCopy
This commit is contained in:
parent
ceebe21041
commit
238bf2d574
|
@ -11,6 +11,8 @@ public record Shape(IList<Vector2D> Vertices) : IEnumerable<Vector2D>
|
||||||
{
|
{
|
||||||
public Vector2D this[Index index] => Vertices[index];
|
public Vector2D this[Index index] => Vertices[index];
|
||||||
|
|
||||||
|
public static Shape CreateCopy(Shape shape) => new(new List<Vector2D>(shape.Vertices));
|
||||||
|
|
||||||
public static Triangle GetSuperTriangle(Shape shape)
|
public static Triangle GetSuperTriangle(Shape shape)
|
||||||
{
|
{
|
||||||
float minX = float.MaxValue, minY = float.MaxValue;
|
float minX = float.MaxValue, minY = float.MaxValue;
|
||||||
|
@ -90,6 +92,7 @@ public record Shape(IList<Vector2D> Vertices) : IEnumerable<Vector2D>
|
||||||
|
|
||||||
public static class ShapeExtensions
|
public static class ShapeExtensions
|
||||||
{
|
{
|
||||||
|
public static Shape CreateCopy(Shape shape) => Shape.CreateCopy(shape);
|
||||||
public static Triangle ToSuperTriangle(this Shape shape) => Shape.GetSuperTriangle(shape);
|
public static Triangle ToSuperTriangle(this Shape shape) => Shape.GetSuperTriangle(shape);
|
||||||
public static void ToLines(this Shape shape, IList<Line> lines) => Shape.GetLines(shape, lines);
|
public static void ToLines(this Shape shape, IList<Line> lines) => Shape.GetLines(shape, lines);
|
||||||
public static List<Line> ToLines(this Shape shape) => Shape.GetLines(shape);
|
public static List<Line> ToLines(this Shape shape) => Shape.GetLines(shape);
|
||||||
|
|
Loading…
Reference in New Issue