Much better system in the IPolygon interface now.
This commit is contained in:
parent
2ca17a4a64
commit
2278d16292
36
Changelog.md
36
Changelog.md
@ -10,38 +10,46 @@ Here's the full changelog:
|
||||
* UnsafeHelper
|
||||
+ Q_rsqrt
|
||||
* Mathematics
|
||||
* Abstract
|
||||
+ IPolygon<T>h
|
||||
* ITriangulate
|
||||
- TriangulateAll(ITriangulate[])
|
||||
= Marked the method `TriangulateAll<T>(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`
|
||||
|
||||
8
Nerd_STF/Mathematics/Abstract/IFloatArray.cs
Normal file
8
Nerd_STF/Mathematics/Abstract/IFloatArray.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Nerd_STF.Mathematics.Abstract;
|
||||
|
||||
public interface IFloatArray<T> where T : IFloatArray<T>
|
||||
{
|
||||
public static abstract float[] ToFloatArrayAll(params T[] vals);
|
||||
|
||||
public float[] ToFloatArray();
|
||||
}
|
||||
@ -1,7 +1,27 @@
|
||||
namespace Nerd_STF.Mathematics.Abstract;
|
||||
|
||||
public interface IPolygon : ITriangulate
|
||||
public interface IPolygon<T> : IAverage<T>, IEquatable<T>,
|
||||
IFloatArray<T>, IGroup<Float3>, IIndexAll<Float3>, IIndexRangeAll<Float3>,
|
||||
ILerp<T, float>, IMedian<T>, ISplittable<T, (float[] Xs, float[] Ys, float[] Zs)>,
|
||||
ITriangulate
|
||||
where T : IPolygon<T>
|
||||
{
|
||||
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<Float3> fill);
|
||||
public static abstract implicit operator T(Fill<Int3> fill);
|
||||
public static abstract implicit operator T(Fill<Line> fill);
|
||||
public static abstract implicit operator T(Fill<float> fill);
|
||||
public static abstract implicit operator T(Fill<int> fill);
|
||||
}
|
||||
|
||||
@ -2,12 +2,6 @@
|
||||
|
||||
public interface ITriangulate
|
||||
{
|
||||
public static virtual Triangle[] TriangulateAll(params ITriangulate[] triangulatables)
|
||||
{
|
||||
List<Triangle> res = new();
|
||||
foreach (ITriangulate triangulatable in triangulatables) res.AddRange(triangulatable.Triangulate());
|
||||
return res.ToArray();
|
||||
}
|
||||
public static virtual Triangle[] TriangulateAll<T>(params T[] triangulatables) where T : ITriangulate
|
||||
{
|
||||
List<Triangle> res = new();
|
||||
|
||||
@ -66,4 +66,8 @@ Anyway, that's everything in this update. Again, pretty small, but meaningful no
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Mathematics\Geometry\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user