daily update on 20240610 by nitload youmu

This commit is contained in:
Nitload
2024-06-10 15:11:01 +08:00
parent c0093f7b5c
commit f6963b8e00
96 changed files with 2927 additions and 2290 deletions
@@ -40,48 +40,80 @@ namespace StgSharp.Geometries
{
protected static int[] Indices = [0, 1, 2, 0, 2, 3];
internal Polygon4()
internal Polygon4():base(PlainCoordinate.StandardPlainCoordination)
{
vertexMat = new vec4d[4];
}
public Polygon4(ICoord coordinate,
vec3d topLeft,
vec3d topRight,
vec3d bottomRight,
vec3d bottomLeft
)
internal Polygon4(vec4d[] rawCoord):
base(PlainCoordinate.StandardPlainCoordination)
{
this.coordinate = coordinate;
this[0] = new vec4d(topLeft.vec);
this[1] = new vec4d(topRight.vec);
this[2] = new vec4d(bottomRight.vec);
this[3] = new vec4d(bottomLeft.vec);
Vector4 maxCoord = this[0].vec;
Vector4 minCoord = this[0].vec;
maxCoord = Vector4.Max(maxCoord, this[1].vec);
maxCoord = Vector4.Max(maxCoord, this[2].vec);
maxCoord = Vector4.Max(maxCoord, this[3].vec);
minCoord = Vector4.Min(minCoord, this[1].vec);
minCoord = Vector4.Min(minCoord, this[2].vec);
minCoord = Vector4.Min(minCoord, this[3].vec);
if (rawCoord.Length != 4)
{
throw new ArgumentOutOfRangeException(nameof(rawCoord));
}
vertexMat = rawCoord;
}
public Polygon4(
float v0x, float v0y, float v0z,
float v1x, float v1y, float v1z,
float v2x, float v2y, float v2z,
float v3x, float v3y, float v3z
)
Point topLeft,
Point topRight,
Point bottomRight,
Point bottomLeft
):base(PlainCoordinate.StandardPlainCoordination)
{
this[0] = topLeft;
this[1] = topRight;
this[2] = bottomRight;
this[3] = bottomLeft;
}
public Polygon4(
float v0x, float v0y,
float v1x, float v1y,
float v2x, float v2y,
float v3x, float v3y
):base(PlainCoordinate.StandardPlainCoordination)
{
vertexMat = new vec4d[4];
this[0] = new vec4d(v0x, v0y, v0z, 0);
this[1] = new vec4d(v1x, v1y, v1z, 0);
this[2] = new vec4d(v2x, v2y, v2z, 0);
this[3] = new vec4d(v3x, v3y, v3z, 0);
this[0] = new Point(v0x, v0y, 0);
this[1] = new Point(v1x, v1y, 0);
this[2] = new Point(v2x, v2y, 0);
this[3] = new Point(v3x, v3y, 0);
}
public Polygon4(CoordinationBase coordinate,
PlainCoordinate coordination,
Point topLeft,
Point topRight,
Point bottomRight,
Point bottomLeft
) : base(coordinate)
{
this[0] = topLeft;
this[1] = topRight;
this[2] = bottomRight;
this[3] = bottomLeft;
}
public Polygon4(
PlainCoordinate coordination,
float v0x, float v0y,
float v1x, float v1y,
float v2x, float v2y,
float v3x, float v3y
) : base(coordination)
{
vertexMat = new vec4d[4];
this[0] = new Point(v0x, v0y, 0);
this[1] = new Point(v1x, v1y, 0);
this[2] = new Point(v2x, v2y, 0);
this[3] = new Point(v3x, v3y, 0);
}
public override ReadOnlySpan<int> VertexIndices => Indices;