After merging #96, InternalPath will become unnecessarily heavy both code and memory-wise.
Ideally it should only contain a PointF[] to be fed to TessellatedMultipolygon, the following stuff seems to be heavy and unnecessary:
|
private struct PointData |
|
{ |
|
public PointF Point; |
|
public Orientation Orientation; |
|
|
|
public float Length; |
|
public float TotalLength; |
|
public Segment Segment; |
|
} |
|
|
|
private struct PassPointData |
|
{ |
|
public bool RemoveLastIntersectionAndSkip; |
|
public Orientation RelativeOrientation; |
|
public bool DoIntersect; |
|
} |
|
|
|
private readonly struct Segment |
|
{ |
|
public readonly PointF Start; |
|
public readonly PointF End; |
|
public readonly PointF Min; |
|
public readonly PointF Max; |
|
|
|
public Segment(PointF start, PointF end) |
|
{ |
|
this.Start = start; |
|
this.End = end; |
|
|
|
this.Min = Vector2.Min(start, end); |
|
this.Max = Vector2.Max(start, end); |
|
} |
|
} |
The following features seem to rely on this data, I suggest to remove them from the public API, since they do not really serve drawing concerns:
IPath.FindIntersections, IPath.MaxIntersections
IPath.Distance
IPath.PointAlongPath
IPath.Length
Some of the above could be replaced with slow variants if we really want/need them.
After merging #96,
InternalPathwill become unnecessarily heavy both code and memory-wise.Ideally it should only contain a
PointF[]to be fed toTessellatedMultipolygon, the following stuff seems to be heavy and unnecessary:ImageSharp.Drawing/src/ImageSharp.Drawing/Shapes/InternalPath.cs
Lines 933 to 965 in acf438b
The following features seem to rely on this data, I suggest to remove them from the public API, since they do not really serve drawing concerns:
IPath.FindIntersections,IPath.MaxIntersectionsIPath.DistanceIPath.PointAlongPathIPath.LengthSome of the above could be replaced with slow variants if we really want/need them.