SixLabors/Shapes

merge the IPath and IShape interfaces into a single structure

tocsoft opened this issue · 0 comments

IPath should have

  • Rectangle Bounds { get; } bounds enclosing the path
  • PointInfo Distance(Vector2 point) distance from and along the path
  • IPath Transform(Matrix3x2 matrix) applies the matrix transform to the path.
  • int MaxIntersections { get; } Gets the maximum number intersections that a shape can have when testing a line.
  • IsClosed details weather the path is closed or open
  • bool Contains(Vector2 point); returns true if the point is contained within the closed version of this path
  • int FindIntersections(Vector2 start, Vector2 end, Vector2[] buffer, int count, int offset); populates the buffer with all the point that intersect the line
  • IPath AsClosedPath() if this is an open path closes it and returns that, otherwise it returns itself
  • ImmutableArray<SimplePath> Flatten() a collection of simple paths making up this potentially complex one

Add new SimplePath struct

  • ImmutableArray<Vector2> Points { get; }
  • bool IsClosed { get; }

drop IShape as IPath will cover the requirements