py3dtiles.tileset.content.b3dm module

class py3dtiles.tileset.content.b3dm.B3dm(header: B3dmHeader, body: B3dmBody)[source]

Bases: TileContent

static from_array(array: ndarray[Any, dtype[uint8]]) B3dm[source]
static from_gltf(gltf: GLTF2, batch_table: BatchTable | None = None, feature_table: B3dmFeatureTable | None = None) B3dm[source]
static from_numpy_arrays(points: ndarray[Any, dtype[float32]], triangles: ndarray[Any, dtype[uint8]] | None = None, batch_table: BatchTable | None = None, feature_table: B3dmFeatureTable | None = None, normal: ndarray[Any, dtype[float32]] | None = None, uvs: ndarray[Any, dtype[float32]] | None = None, batchids: ndarray[Any, dtype[uint32]] | None = None, transform: ndarray[Any, dtype[float32]] | None = None, texture_uri: str | None = None, material: Material | None = None) B3dm[source]

Creates a B3DM body from numpy arrays.

Parameters:
  • points – array of vertex positions, must have a (n, 3) shape.

  • triangles – array of triangle indices, must have a (n, 3) shape.

  • batch_table – a batch table.

  • feature_table – a feature table.

  • normals – array of vertex normals, must have a (n, 3) shape.

  • uvs – array of texture coordinates, must have a (n, 2) shape.

  • batchids – array of batch table IDs, must have a (n) shape.

  • texture_uri – the URI of the texture image if the primitive is textured.

  • material – a glTF material. If not set, a default material is created.

static from_primitives(primitives: list[GltfPrimitive], batch_table: BatchTable | None = None, feature_table: B3dmFeatureTable | None = None, transform: ndarray[Any, dtype[float32]] | None = None) B3dm[source]
sync() None[source]

Allow to synchronize headers with contents.

class py3dtiles.tileset.content.b3dm.B3dmBody[source]

Bases: TileContentBody

static from_array(b3dm_header: B3dmHeader, array: ndarray[Any, dtype[uint8]]) B3dmBody[source]
static from_gltf(gltf: GLTF2) B3dmBody[source]
static from_primitives(primitives: list[GltfPrimitive], transform: ndarray[Any, dtype[float32]] | None = None) B3dmBody[source]
to_array() ndarray[Any, dtype[uint8]][source]
class py3dtiles.tileset.content.b3dm.B3dmHeader[source]

Bases: TileContentHeader

BYTE_LENGTH = 28
static from_array(array: ndarray[Any, dtype[uint8]]) B3dmHeader[source]
magic_value: Literal[b'b3dm', b'pnts']
to_array() ndarray[Any, dtype[uint8]][source]
version: int