Quickie. Some additions to the IPolygon interface.
This commit is contained in:
parent
d4250f83a9
commit
2ca17a4a64
7
Nerd_STF/Mathematics/Abstract/IPolygon.cs
Normal file
7
Nerd_STF/Mathematics/Abstract/IPolygon.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace Nerd_STF.Mathematics.Abstract;
|
||||||
|
|
||||||
|
public interface IPolygon : ITriangulate
|
||||||
|
{
|
||||||
|
public Float3[] GetAllVerts();
|
||||||
|
public float[] ToFloatArray();
|
||||||
|
}
|
||||||
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
public interface ITriangulate
|
public interface ITriangulate
|
||||||
{
|
{
|
||||||
public static Triangle[] TriangulateAll(params ITriangulate[] triangulatables)
|
public static virtual Triangle[] TriangulateAll(params ITriangulate[] triangulatables)
|
||||||
{
|
{
|
||||||
List<Triangle> res = new();
|
List<Triangle> res = new();
|
||||||
foreach (ITriangulate triangulatable in triangulatables) res.AddRange(triangulatable.Triangulate());
|
foreach (ITriangulate triangulatable in triangulatables) res.AddRange(triangulatable.Triangulate());
|
||||||
return res.ToArray();
|
return res.ToArray();
|
||||||
}
|
}
|
||||||
public static Triangle[] TriangulateAll<T>(params T[] triangulatables) where T : ITriangulate
|
public static virtual Triangle[] TriangulateAll<T>(params T[] triangulatables) where T : ITriangulate
|
||||||
{
|
{
|
||||||
List<Triangle> res = new();
|
List<Triangle> res = new();
|
||||||
foreach (ITriangulate triangulatable in triangulatables) res.AddRange(triangulatable.Triangulate());
|
foreach (ITriangulate triangulatable in triangulatables) res.AddRange(triangulatable.Triangulate());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user