diff --git a/Changelog.md b/Changelog.md index d67f474..ee2fd92 100644 --- a/Changelog.md +++ b/Changelog.md @@ -10,38 +10,46 @@ Here's the full changelog: * UnsafeHelper + Q_rsqrt * Mathematics + * Abstract + + IPolygonh + * ITriangulate + - TriangulateAll(ITriangulate[]) + = Marked the method `TriangulateAll(T[])` as virtual * Geometry - * Line - = Replaced all references to `Vert` with references to `Float3` - * Polygon - = Replaced all references to `Vert` with references to `Float3` - * Quadrilateral - = Replaced all references to `Vert` with references to `Float3` - * Sphere - = Replaced all references to `Vert` with references to `Float3` - * Triangle - = Replaced all references to `Vert` with references to `Float3` - = Renamed `Box2D` to `Box2d` - = Replaced all references to `Vert` with references to `Float3` - = Renamed `Box3D` to `Box3d` - = Replaced all references to `Vert` with references to `Float3` + - Box2d (REMEMBER: name change) + - Box3d (REMEMBER: name change) + - Line + - Polygon + - Quadrilateral + - Sphere + - Triangle - Vert * NumberSystems * Complex = Replaced all references to `Vert` with references to `Float3` * Quaternion = Replaced all references to `Vert` with references to `Float3` + * Angle + + FromVerts(Float3, Float3, Float3) + + GetCoterminalAngles() + + GetCoterminalAngles(Angle, Angle) * Float2 + + InverseMagnitude = Replaced all references to `Vert` with references to `Float3` * Float3 + + InverseMagnitude = Replaced all references to `Vert` with references to `Float3` * Float4 + + InverseMagnitude = Replaced all references to `Vert` with references to `Float3` * Int2 + + InverseMagnitude = Replaced all references to `Vert` with references to `Float3` * Int3 + + InverseMagnitude = Replaced all references to `Vert` with references to `Float3` * Int4 + + InverseMagnitude = Replaced all references to `Vert` with references to `Float3` * Vector2d = Replaced all references to `Vert` with references to `Float3` diff --git a/Nerd_STF/Mathematics/Abstract/IFloatArray.cs b/Nerd_STF/Mathematics/Abstract/IFloatArray.cs new file mode 100644 index 0000000..ec18ef6 --- /dev/null +++ b/Nerd_STF/Mathematics/Abstract/IFloatArray.cs @@ -0,0 +1,8 @@ +namespace Nerd_STF.Mathematics.Abstract; + +public interface IFloatArray where T : IFloatArray +{ + public static abstract float[] ToFloatArrayAll(params T[] vals); + + public float[] ToFloatArray(); +} diff --git a/Nerd_STF/Mathematics/Abstract/IPolygon.cs b/Nerd_STF/Mathematics/Abstract/IPolygon.cs index 5d3c323..a665294 100644 --- a/Nerd_STF/Mathematics/Abstract/IPolygon.cs +++ b/Nerd_STF/Mathematics/Abstract/IPolygon.cs @@ -1,7 +1,27 @@ namespace Nerd_STF.Mathematics.Abstract; -public interface IPolygon : ITriangulate +public interface IPolygon : IAverage, IEquatable, + IFloatArray, IGroup, IIndexAll, IIndexRangeAll, + ILerp, IMedian, ISplittable, + ITriangulate + where T : IPolygon { + public float Area { get; } + public Float3 Midpoint { get; } + public float Perimeter { get; } + public Float3[] GetAllVerts(); - public float[] ToFloatArray(); + + public static abstract T operator +(T poly, Float3 offset); + public static abstract T operator -(T poly, Float3 offset); + public static abstract T operator *(T poly, float scale); + public static abstract T operator *(T poly, Float3 scale3); + public static abstract T operator /(T poly, float scale); + public static abstract T operator /(T poly, Float3 scale3); + + public static abstract implicit operator T(Fill fill); + public static abstract implicit operator T(Fill fill); + public static abstract implicit operator T(Fill fill); + public static abstract implicit operator T(Fill fill); + public static abstract implicit operator T(Fill fill); } diff --git a/Nerd_STF/Mathematics/Abstract/ITriangulate.cs b/Nerd_STF/Mathematics/Abstract/ITriangulate.cs index ffa5c2f..faac70b 100644 --- a/Nerd_STF/Mathematics/Abstract/ITriangulate.cs +++ b/Nerd_STF/Mathematics/Abstract/ITriangulate.cs @@ -2,12 +2,6 @@ public interface ITriangulate { - public static virtual Triangle[] TriangulateAll(params ITriangulate[] triangulatables) - { - List res = new(); - foreach (ITriangulate triangulatable in triangulatables) res.AddRange(triangulatable.Triangulate()); - return res.ToArray(); - } public static virtual Triangle[] TriangulateAll(params T[] triangulatables) where T : ITriangulate { List res = new(); diff --git a/Nerd_STF/Nerd_STF.csproj b/Nerd_STF/Nerd_STF.csproj index 5bb893b..c805cf8 100644 --- a/Nerd_STF/Nerd_STF.csproj +++ b/Nerd_STF/Nerd_STF.csproj @@ -66,4 +66,8 @@ Anyway, that's everything in this update. Again, pretty small, but meaningful no + + + +