py3dtiles.tileset.content.pnts module#

class py3dtiles.tileset.content.pnts.Pnts(header: PntsHeader, body: PntsBody)[source]#

Bases: LegacyTileContent

classmethod from_array(array: ndarray[tuple[int, ...], dtype[uint8]]) Pnts[source]#

Creates a Pnts from an array

static from_features(feature_table_header: PntsFeatureTableHeader, position_array: ndarray[tuple[int, ...], dtype[float32 | uint16]], color_array: ndarray[tuple[int, ...], dtype[uint8 | uint16]] | None = None, normal_position: ndarray[tuple[int, ...], dtype[float32 | uint8]] | None = None) Pnts[source]#

Creates a Pnts from features defined by pd_type and cd_type.

static from_points(points: Points) Pnts[source]#

Create a pnts from data array:

  • positions will be included as SemanticPoint.POSITION

  • if rgb is not None, it will be included as SemanticPoint.RGB

  • all the extra_fields are included in the batch table

Parameters:
  • positions – the positions 1D array

  • colors – the colors 1D array

  • extra_fields – a dict of extra arrays to include in the batch_table. The dict keys are the name of the fields, the values are 1D np arrays containing values for each field.

get_colors() ndarray[tuple[int, ...], dtype[uint8 | uint16]] | None[source]#
get_extra_field(fieldname: str) ndarray[tuple[int, ...], dtype[Any]][source]#
get_extra_fields() dict[str, ndarray[tuple[int, ...], dtype[Any]]][source]#
get_points(transform: ndarray[tuple[int, ...], dtype[float64]] | None) Points[source]#

Get the points optionally transformed by transform.

Internally forward to self.body.get_points

get_vertex_count() int[source]#
get_vertices() ndarray[tuple[int, ...], dtype[float32 | uint16]] | None[source]#
merge_with(other: Pnts) None[source]#
sync() None[source]#

Synchronizes headers with the Pnts body.

to_points(transform: ndarray[tuple[int, ...], dtype[float64]] | None) Points[source]#
class py3dtiles.tileset.content.pnts.PntsBody[source]#

Bases: TileContentBody

static from_array(header: PntsHeader, array: ndarray[tuple[int, ...], dtype[uint8]]) PntsBody[source]#

Creates a PntsBody from an array and the header

get_points(transform: ndarray[tuple[int, ...], dtype[float64]] | None) Points[source]#

Get the points inside this instance, optionally transformed by transform.

to_array() ndarray[tuple[int, ...], dtype[uint8]][source]#

Returns the body as a numpy array.

class py3dtiles.tileset.content.pnts.PntsHeader[source]#

Bases: TileContentHeader

BYTE_LENGTH = 28#
static from_array(array: ndarray[tuple[int, ...], dtype[uint8]]) PntsHeader[source]#

Create a PntsHeader from an array

magic_value: Literal[b'b3dm', b'pnts']#
to_array() ndarray[tuple[int, ...], dtype[uint8]][source]#

Returns the header as a numpy array.

version: int#
py3dtiles.tileset.content.pnts.get_color_semantic(colors: ndarray[tuple[int, ...], dtype[Any]] | None) Literal[SemanticPoint.RGB, SemanticPoint.RGB565] | None[source]#