MeshFace
class MeshFace
namespace Autodesk.DesignScript.Geometry
{
internal class MeshFace
{
public int[] VertexArray { get; set; }
public int[] TextureArray { get; set; }
public int[] NormalArray { get; set; }
private MeshFace(int numberOfVertices)
{
VertexArray = new int[numberOfVertices];
TextureArray = new int[numberOfVertices];
NormalArray = new int[numberOfVertices];
}
public static MeshFace CreateFace(int numberOfVertices)
{
if (numberOfVertices < 3)
return null;
return new MeshFace(numberOfVertices);
}
public void AddFacePoint(int vertexIndex, int textureIndex, int normalIndex, int index)
{
VertexArray[index] = vertexIndex;
TextureArray[index] = textureIndex;
NormalArray[index] = normalIndex;
}
public void AddFacePoint(int vertexIndex, int index)
{
VertexArray[index] = vertexIndex;
TextureArray[index] = 0;
NormalArray[index] = 0;
}
}
}