py3dtiles.tileset.content package

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

Bases: TileContent

static from_array(array: ndarray[Any, dtype[uint8]]) B3dm[source]
static from_gltf(gltf: GlTF, batch_table: BatchTable | None = None) B3dm[source]
print_info() None[source]
sync() None[source]

Allow to synchronize headers with contents.

class py3dtiles.tileset.content.B3dmBody[source]

Bases: TileContentBody

static from_array(b3dm_header: B3dmHeader, array: ndarray[Any, dtype[uint8]]) B3dmBody[source]
static from_gltf(gltf: GlTF) B3dmBody[source]
to_array() ndarray[Any, dtype[uint8]][source]
class py3dtiles.tileset.content.B3dmHeader[source]

Bases: TileContentHeader

BYTE_LENGTH = 28
static from_array(array: ndarray[Any, dtype[uint8]]) B3dmHeader[source]
to_array() ndarray[Any, dtype[uint8]][source]
class py3dtiles.tileset.content.GlTF[source]

Bases: object

CHUNK_HEADER_LENGTH = 8
HEADER_LENGTH = 12
static from_array(array: ndarray[Any, dtype[uint8]]) GlTF[source]
static from_binary_arrays(arrays: list[dict[str, Sequence[Any]]], transform: ndarray[Any, dtype[float64]], batched: bool = True, uri: str | None = None, texture_uri: str | None = None) GlTF[source]

Parameters

arraysarray of dictionaries

Each dictionary has the data for one geometry arrays[‘position’]: binary array of vertex positions arrays[‘normal’]: binary array of vertex normals arrays[‘uv’]: binary array of vertex texture coordinates

(Not implemented yet)

arrays[‘bbox’]: geometry bounding box (numpy.array)

transformnumpy.array

World coordinates transformation flattend matrix

Returns

gltf : GlTF

to_array() ndarray[Any, dtype[uint8]][source]
class py3dtiles.tileset.content.Pnts(header: PntsHeader, body: PntsBody)[source]

Bases: TileContent

static from_array(array: ndarray[Any, dtype[uint8]]) Pnts[source]

Creates a Pnts from an array

static from_features(feature_table_header: FeatureTableHeader, position_array: ndarray[Any, dtype[float32 | uint8]], color_array: ndarray[Any, dtype[uint8 | uint16]] | None = None, normal_position: ndarray[Any, dtype[float32 | uint8]] | None = None) Pnts[source]

Creates a Pnts from features defined by pd_type and cd_type.

static from_points(points: ndarray[Any, dtype[uint8]], include_rgb: bool, include_classification: bool) Pnts[source]
Create a pnts from an uint8 data array containing:
  • points as SemanticPoint.POSITION

  • if include_rgb, rgb as SemanticPoint.RGB

  • if include_classification, classification as a single np.uint8 value that will put in the batch table

print_info() None[source]
sync() None[source]

Synchronizes headers with the Pnts body.

class py3dtiles.tileset.content.PntsBody[source]

Bases: TileContentBody

static from_array(header: PntsHeader, array: ndarray[Any, dtype[uint8]]) PntsBody[source]

Creates a PntsBody from an array and the header

get_points(transform: ndarray[Any, dtype[float64]] | None) tuple[ndarray[Any, dtype[float32]], ndarray[Any, dtype[uint8 | uint16]] | None][source]
to_array() ndarray[Any, dtype[uint8]][source]

Returns the body as a numpy array.

class py3dtiles.tileset.content.PntsHeader[source]

Bases: TileContentHeader

BYTE_LENGTH = 28
static from_array(array: ndarray[Any, dtype[uint8]]) PntsHeader[source]

Create a PntsHeader from an array

to_array() ndarray[Any, dtype[uint8]][source]

Returns the header as a numpy array.

class py3dtiles.tileset.content.TileContent[source]

Bases: ABC

body: TileContentBody
abstract static from_array(array: ndarray[Any, dtype[uint8]]) TileContent[source]
header: TileContentHeader
abstract print_info() None[source]
save_as(path: Path) None[source]
abstract sync() None[source]

Allow to synchronize headers with contents.

to_array() ndarray[Any, dtype[uint8]][source]
to_hex_str() str[source]
class py3dtiles.tileset.content.TileContentBody[source]

Bases: ABC

batch_table: BatchTable
feature_table: FeatureTable
abstract to_array() ndarray[Any, dtype[uint8]][source]
class py3dtiles.tileset.content.TileContentHeader[source]

Bases: ABC

abstract static from_array(array: ndarray[Any, dtype[uint8]]) TileContentHeader[source]
magic_value: Literal[b'b3dm', b'pnts']
abstract to_array() ndarray[Any, dtype[uint8]][source]
version: int
py3dtiles.tileset.content.read_binary_tile_content(tile_path: Path) TileContent[source]

Submodules