VertexElement — Aspose.3D TypeScript API Reference
Paquete: @aspose/3d (v24.12.0)
VertexElement es la clase base abstracta para canales de atributos por vértice adjuntos a un Geometry. Cada canal contiene una matriz de datos tipada y mappingMode / referenceMode metadatos que controlan cómo los datos se relacionan con los primitivas geométricas. Las subclases son: VertexElementNormal, VertexElementUV, y VertexElementVertexColor.
import { VertexElement, VertexElementNormal, VertexElementUV, VertexElementVertexColor } from '@aspose/3d';Properties
export abstract class VertexElement implements IIndexedVertexElementProperties
constructor(
elementType: VertexElementType,
name: string = '',
mappingMode: MappingMode | null = null,
referenceMode: ReferenceMode | null = null,
)Properties mappingMode es MappingMode.CONTROL_POINT; predeterminado referenceMode es ReferenceMode.DIRECT.
Properties
| Properties | Properties | Properties | Properties |
|---|---|---|---|
vertexElementType | VertexElementType | lectura | Tipo semántico de esta capa. |
name | string | lectura/escritura | Etiqueta opcional para esta capa. |
mappingMode | MappingMode | lectura/escritura | Controla con qué primitiva geométrica se asocia cada valor. |
referenceMode | ReferenceMode | lectura/escritura | Controla si los valores se direccionan directamente o mediante una matriz de índices. |
indices | number[] | leer | Matriz de índices para IndexToDirect modo de referencia. |
Properties
setIndices(data)
NOT IMPLEMENTED. En la base VertexElement clase, este método lanza Error('set_indices is not implemented') en tiempo de ejecución. Las subclases VertexElementFVector y VertexElementIntsTemplate proporcionan implementaciones funcionales.
ChartSeries representa una única serie de datos dentro de un gráfico. Se obtiene a través de chart.n_series[index].
setIndices(data: number[]): voidclear()
NOT IMPLEMENTED. En la base VertexElement clase, este método lanza Error('clear is not implemented') en tiempo de ejecución. Las subclases VertexElementFVector y VertexElementIntsTemplate proporcionan implementaciones funcionales.
aspose-cells-foss admite la inserción de gráficos en hojas de cálculo. Los gráficos se gestionan a través de ws.charts, una ChartCollection adjunta a cada Worksheet. Los datos de la serie se añaden mediante chart.n_series, una colección NSeries.
clear(): voidVertexElementNormal
ChartType es un IntEnum que identifica el tipo de gráfico.
export class VertexElementNormal extends VertexElementFVectorProperties
VertexElement → VertexElementFVector → VertexElementNormal
Properties
new VertexElementNormal(
name: string = '',
mappingMode: MappingMode | null = null,
referenceMode: ReferenceMode | null = null,
)vertexElementType está fijado a VertexElementType.NORMAL.
Returns: VertexElementUV
Almacena coordenadas de textura 2D. Una malla puede contener múltiples capas UV para diferentes canales de textura. El textureMapping propiedad identifica el propósito del canal.
export class VertexElementUV extends VertexElementFVectorProperties
VertexElement → VertexElementFVector → VertexElementUV
Properties
new VertexElementUV(
textureMapping: TextureMapping | null = null,
name: string = '',
mappingMode: MappingMode | null = null,
referenceMode: ReferenceMode | null = null,
)Predeterminado a TextureMapping.DIFFUSE cuando textureMapping es null.
Material PBR (Renderizado Basado en la Física). Utilizado por glTF 2.0 y otros formatos compatibles con PBR. Asignado a un Node mediante node.material.
| Properties | Properties | Properties | Properties |
|---|---|---|---|
textureMapping | TextureMapping | leer | El canal de textura con el que está asociada esta capa UV. |
data | FVector4[] | leer | Valores UV expuestos como FVector4 entradas (z y w son 0). |
uvData | FVector2[] | leer | Valores UV como FVector2 entradas (solo x, y). |
addData(data)
Agregar valores UV. Acepta FVector2[], FVector3[], o FVector4[].
addData(data: FVector2[] | FVector3[] | FVector4[]): voidVertexElementVertexColor
Atajo para add(ChartType.PIE, ...).
export class VertexElementVertexColor extends VertexElementFVectorProperties
VertexElement → VertexElementFVector → VertexElementVertexColor
Properties
new VertexElementVertexColor(
name: string = '',
mappingMode: MappingMode | null = null,
referenceMode: ReferenceMode | null = null,
)vertexElementType está fijado a VertexElementType.VERTEX_COLOR.
Properties
Propiedades e iteración:
import { Scene, Mesh, Vector4, VertexElementType, MappingMode, ReferenceMode, FVector4 } from '@aspose/3d';
const mesh = new Mesh();
mesh.controlPoints.push(new Vector4(0, 0, 0, 1));
mesh.controlPoints.push(new Vector4(1, 0, 0, 1));
mesh.controlPoints.push(new Vector4(0.5, 1, 0, 1));
mesh.createPolygon(0, 1, 2);
const normals = mesh.createElement(
VertexElementType.NORMAL,
MappingMode.CONTROL_POINT,
ReferenceMode.DIRECT,
);
normals.setData([
new FVector4(0, 0, 1, 0),
new FVector4(0, 0, 1, 0),
new FVector4(0, 0, 1, 0),
]);
const scene = new Scene();
scene.rootNode.createChildNode('tri', mesh);
scene.save('triangle_normals.glb');NSeries:
import { Scene, Mesh, Vector4, TextureMapping, MappingMode, ReferenceMode, FVector2 } from '@aspose/3d';
const mesh = new Mesh();
for (const [x, z] of [[0,0],[1,0],[1,1],[0,1]]) {
mesh.controlPoints.push(new Vector4(x, 0, z, 1));
}
mesh.createPolygon(0, 1, 2, 3);
const uv = mesh.createElementUV(TextureMapping.DIFFUSE, MappingMode.CONTROL_POINT, ReferenceMode.DIRECT);
uv.addData([
new FVector2(0, 0),
new FVector2(1, 0),
new FVector2(1, 1),
new FVector2(0, 1),
]);
const scene = new Scene();
scene.rootNode.createChildNode('quad', mesh);
scene.save('quad_uv.glb');