Mesh

网格构造函数 - 创建新的网格几何图形实例

构造函数

Mesh

网格构造函数 - 创建新的网格几何图形实例

new Mesh(properties?)

参数

  • properties?: MeshProperties 网格的初始属性,包括顶点数据、原点、空间参考等

返回:Mesh Mesh对象

属性

extent

网格几何图形的三维范围

extent: Extent

类型: Extent

loadError

加载错误对象 - 加载过程中发生错误时返回的错误对象

loadError: Error

类型: Error

loadStatus

加载状态 - 表示加载操作的当前状态

loadStatus: "not-loaded" | "loading" | "failed" | "loaded"

类型: "not-loaded" | "loading" | "failed" | "loaded"

loadWarnings

加载警告列表 - 加载过程中发生的警告信息

loadWarnings: any[]

类型: any[]

origin

网格原点 - 网格的参考原点位置

origin: Point

类型: Point

type

几何图形类型标识符

type: "mesh"

类型: "mesh"

vertexAttributes

顶点属性 - 描述网格每个顶点属性的对象

vertexAttributes: MeshVertexAttributes

访问器

components

An array of mesh components that can be used to apply materials

get components(): MeshComponent[]

返回: MeshComponent An array of mesh components that can be used to apply materials

set components(value: MeshComponentProperties[]): void

返回: void

transform

Additional local transformation of the mesh vertices.

get transform(): MeshTransform

返回: MeshTransform Additional local transformation of the mesh vertices.

set transform(value: MeshTransformProperties): void

返回: void

vertexSpace

The vertex space of the mesh.

get vertexSpace(): MeshGeoreferencedVertexSpace | MeshLocalVertexSpace

返回: MeshGeoreferencedVertexSpace | MeshLocalVertexSpace The vertex space of the mesh.

set vertexSpace(value: MeshGeoreferencedVertexSpaceProperties & object | MeshLocalVertexSpaceProperties & object): void

返回: void

方法

addComponent

Adds a component to the mesh.

addComponent(component): void

参数

返回:void

cancelLoad

Returns

cancelLoad(): void

返回:void

centerAt

Centers the mesh at the specified location without changing its scale.

centerAt(location, parameters?): Mesh

参数

返回:Mesh

clone

创建网格的深度克隆 - 复制网格及其所有属性

clone(): Mesh

返回:Mesh

isFulfilled

isFulfilled() may be used to verify if creating an instance of the class is fulfilled (either resolved or rejected).

isFulfilled(): boolean

返回:boolean

isRejected

isRejected() may be used to verify if creating an instance of the class is rejected.

isRejected(): boolean

返回:boolean

isResolved

isResolved() may be used to verify if creating an instance of the class is resolved.

isResolved(): boolean

返回:boolean

load

加载网格数据 - 异步加载网格的几何数据和属性

load(options?): Promise

参数

返回:Promise

offset

Offsets the mesh geometry by the specified distance in x, y, and z.

offset(dx, dy, dz): Mesh

参数

  • dx: number The amount to offset the geometry in the x direction.
  • dy: number The amount to offset the geometry in the y direction.
  • dz: number The amount to offset the geometry in the z direction.

返回:Mesh

removeComponent

Removes a component from the mesh.

removeComponent(component): void

参数

返回:void

rotate

Rotates the mesh geometry around its x, y and z axis (in that order).

rotate(angleX, angleY, angleZ, parameters?): Mesh

参数

  • angleX: number The angle by which to rotate around the x-axis (in degrees).
  • angleY: number The angle by which to rotate around the y-axis (in degrees).
  • angleZ: number The angle by which to rotate around the z-axis (in degrees).
  • parameters?: MeshRotateParameters Additional parameters.

返回:Mesh

scale

Scales the mesh geometry by the specified factor.

scale(factor, parameters?): Mesh

参数

  • factor: number The amount to scale the geometry.
  • parameters?: MeshScaleParameters Additional parameters.

返回:Mesh

toBinaryGLTF

Export a mesh to a binary glTF (glb) representation.

toBinaryGLTF(options?): Promise

参数

返回:Promise

vertexAttributesChanged

Notifies that any cached values that depend on vertex attributes need to be recalculated.

vertexAttributesChanged(): void

返回:void

when

when() may be leveraged once an instance of the class is created.

when(callback?, errback?): Promise

参数

  • callback?: Function The function to call when the promise resolves.
  • errback?: Function The function to execute when the promise fails.

返回:Promise

BIMFlux AI