IndexedPolygon

data class IndexedPolygon(val positions: List<Int>, val textureCoords: List<Int>, val colors: List<Int>, val normals: List<Int>, val tangents: List<Int>, val bitangents: List<Int>) : IIndexedPolygon(source)

Represents a polygon defined by indices corresponding to vertex data such as positions, texture coordinates, colors, normals, tangents, and bitangents. It can be used to describe a geometric shape for rendering or processing in 3D graphics or geometry applications.

Constructors

Link copied to clipboard
constructor(positions: List<Int>, textureCoords: List<Int>, colors: List<Int>, normals: List<Int>, tangents: List<Int>, bitangents: List<Int>)

Properties

Link copied to clipboard
open override val bitangents: List<Int>

List of indices referencing vertex bitangents.

Link copied to clipboard
open override val colors: List<Int>

List of indices referencing vertex colors.

Link copied to clipboard
open override val normals: List<Int>

List of indices referencing vertex normals.

Link copied to clipboard
open override val positions: List<Int>

List of indices referencing the vertex positions.

Link copied to clipboard
open override val tangents: List<Int>

List of indices referencing vertex tangents.

Link copied to clipboard
open override val textureCoords: List<Int>

List of indices referencing the texture coordinates.

Functions

Link copied to clipboard
open fun base(vertexData: IVertexData): Matrix44
Link copied to clipboard
open fun isConvex(vertexData: IVertexData): Boolean

Determines if the polygon defined by the given vertex data is convex.

Link copied to clipboard
open fun isPlanar(vertexData: IVertexData, eps: Double = 0.01): Boolean

Checks if the polygon defined by the given vertex data is planar.

Link copied to clipboard
open fun normal(vertexData: IVertexData): Vector3

Computes the normal vector of the polygon based on the given vertex data.

Link copied to clipboard
fun IIndexedPolygon.point(vertexData: IVertexData, barycentric: Vector3): Point

Computes a Point by interpolating vertex attributes from a 3D polygon using barycentric coordinates.

Link copied to clipboard
fun IIndexedPolygon.position(vertexData: IVertexData, barycentric: Vector3): Vector3

Computes the 3D position of a point in a polygon using barycentric coordinates.

Link copied to clipboard
fun shiftIndices(positions: Int = 0, textureCoords: Int = 0, colors: Int = 0, normals: Int = 0, tangents: Int = 0, bitangents: Int = 0): IndexedPolygon

Shifts the indices for position, texture coordinates, colors, normals, tangents, and bitangents by the specified amounts and returns a new IndexedPolygon with the updated indices.

Link copied to clipboard
open override fun toPolygon(vertexData: IVertexData): Polygon

Converts the provided vertex data into a polygon representation.

Link copied to clipboard

Triangulates the polygon represented by the provided vertex data.