Geometry

external class Geometry(options: Geometry.ConstructorOptions)(source)

A geometry representation with attributes forming vertices and optional index data defining primitives. Geometries and an Appearance, which describes the shading, can be assigned to a Primitive for visualization. A Primitive can be created from many heterogeneous - in many cases - geometries for performance.

Geometries can be transformed and optimized using functions in GeometryPipeline.

// Create geometry with a position attribute and indexed lines.
const positions = new Float64Array([
0.0, 0.0, 0.0,
7500000.0, 0.0, 0.0,
0.0, 7500000.0, 0.0
]);

const geometry = new Geometry({
attributes : {
position : new GeometryAttribute({
componentDatatype : ComponentDatatype.DOUBLE,
componentsPerAttribute : 3,
values : positions
})
},
indices : new Uint16Array([0, 1, 1, 2, 2, 0]),
primitiveType : PrimitiveType.LINES,
boundingSphere : BoundingSphere.fromVertices(positions)
});

See also

Constructors

Link copied to clipboard
constructor(options: Geometry.ConstructorOptions)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface ConstructorOptions

Properties

Link copied to clipboard

Attributes, which make up the geometry's vertices. Each property in this object corresponds to a GeometryAttribute containing the attribute's data.

Link copied to clipboard

An optional bounding sphere that fully encloses the geometry. This is commonly used for culling.

Link copied to clipboard

Optional index data that - along with Geometry.primitiveType - determines the primitives in the geometry.

Link copied to clipboard

The type of primitives in the geometry. This is most often PrimitiveType.TRIANGLES, but can varying based on the specific geometry.