py3dtiles package
- class py3dtiles.B3dm[source]
Bases:
TileContent
- class py3dtiles.BatchTable[source]
Bases:
object
Only the JSON header has been implemented for now. According to the batch table documentation, the binary body is useful for storing long arrays of data (better performances)
- class py3dtiles.BoundingVolumeBox[source]
Bases:
BoundingVolume
A box bounding volume as defined in the 3DTiles specifications i.e. an array of 12 numbers that define an oriented bounding box: - The first three elements define the x, y, and z values for the
center of the box.
The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length.
The next three elements (with indices 6, 7, and 8) define the y axis direction and half-length.
The last three elements (indices 9, 10, and 11) define the z axis direction and half-length.”
Note that, by default, a box bounding volume doesn’t need to be aligned with the coordinate axis. Still in general, computing the box bounding volume of two box bounding volumes won’t necessarily yield a box that is aligned with the coordinate axis (although this computation might require some fitting algorithm e.g. the principal component analysis method. Yet in sake of simplification (and numerical efficiency), when asked to “add” (i.e. to find the enclosing box of) two (or more) box bounding volumes this class resolves to compute the “canonical” fitting/enclosing box i.e. a box that is parallel to the coordinate axis.
- add(other: BoundingVolumeBox) None [source]
Compute the ‘canonical’ bounding volume fitting this bounding volume together with the added bounding volume. Again (refer above to the class definition) the computed fitting bounding volume is generically not the smallest one (due to its alignment with the coordinate axis). :param other: another box bounding volume to be added with this one
- static get_box_array_from_mins_maxs(mins_maxs: list | ndarray) ndarray [source]
- Parameters:
mins_maxs – the list [x_min, y_min, z_min, x_max, y_max, z_max] that is the boundaries of the box along each coordinate axis
- Returns:
the smallest box (as an array, as opposed to a BoundingVolumeBox instance) that encloses the given list of (3D) points and that is parallel to the coordinate axis.
- static get_box_array_from_point(points: List[List[float]]) ndarray [source]
- Parameters:
points – a list of 3D points
- Returns:
the smallest box (as an array, as opposed to a BoundingVolumeBox instance) that encloses the given list of (3D) points and that is parallel to the coordinate axis.
- get_canonical_as_array() ndarray [source]
- Returns:
the smallest enclosing box (as an array) that is parallel to the coordinate axis
- set_from_mins_maxs(mins_maxs: list | ndarray) None [source]
- Parameters:
mins_maxs – the list [x_min, y_min, z_min, x_max, y_max, z_max] that is the boundaries of the box along each coordinate axis
- class py3dtiles.Extendable[source]
Bases:
object
One the 3DTiles notions defined as an abstract data model through a schema of the 3DTiles specifications (either core of extensions).
- class py3dtiles.Feature[source]
Bases:
object
- class py3dtiles.GlTF[source]
Bases:
object
- CHUNK_HEADER_LENGTH = 8
- HEADER_LENGTH = 12
- static from_binary_arrays(arrays, transform, batched=True, uri=None, texture_uri=None)[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
- class py3dtiles.Pnts[source]
Bases:
TileContent
- class py3dtiles.Tile(geometric_error=500, bounding_volume=None, refine_mode='ADD')[source]
Bases:
Extendable
- get_children() List[Tile] [source]
- Returns:
the recursive (across the children tree) list of the children tiles
- get_content() TileContent [source]
- set_content(content: TileContent, force=True) None [source]
- set_transform(transform: List[float]) None [source]
- Parameters:
transform – a flattened transformation matrix
- Returns:
- write_content(directory: Path) None [source]
Write (or overwrite) the tile _content_ to the directory specified as parameter and withing the relative filename designated by the tile’s content uri. Note that it is the responsibility of the owning TileSet to
set those uris
to explicitly invoke write_content() (this is to be opposed with the Tile attributes which get serialized when recursing on the TileSet attributes) :param directory: the target directory
- class py3dtiles.TileContentReader[source]
Bases:
object
- static read_array(array: np.ndarray) TileContent | None [source]
- static read_file(tile_path: Path) TileContent [source]
- class py3dtiles.TileSet(geometric_error=500)[source]
Bases:
Extendable
- add_asset_extras(comment: str) None [source]
- Parameters:
comment – the comment on original data, pre-processing, possible ownership to be added as asset extra.
- set_transform(transform: List[float]) None [source]
- Parameters:
transform – a flattened transformation matrix
- Returns:
- class py3dtiles.TriangleSoup[source]
Bases:
object
- static from_wkb_multipolygon(wkb, associated_data=None)[source]
Parameters
- wkbstring
Well-Known Binary binary string describing a multipolygon
- associated_dataarray
array of multipolygons containing data attached to the wkb parameter multipolygon. Must be the same size as wkb.
Returns
ts : TriangleSoup
Subpackages
Submodules
- py3dtiles.b3dm module
- py3dtiles.batch_table module
- py3dtiles.bounding_volume module
- py3dtiles.bounding_volume_box module
BoundingVolumeBox
BoundingVolumeBox.add()
BoundingVolumeBox.get_box_array_from_mins_maxs()
BoundingVolumeBox.get_box_array_from_point()
BoundingVolumeBox.get_canonical_as_array()
BoundingVolumeBox.get_center()
BoundingVolumeBox.get_corners()
BoundingVolumeBox.is_box()
BoundingVolumeBox.is_valid()
BoundingVolumeBox.set_from_array()
BoundingVolumeBox.set_from_list()
BoundingVolumeBox.set_from_mins_maxs()
BoundingVolumeBox.set_from_points()
BoundingVolumeBox.sync_with_children()
BoundingVolumeBox.to_dict()
BoundingVolumeBox.transform()
BoundingVolumeBox.translate()
- py3dtiles.command_line module
- py3dtiles.constants module
- py3dtiles.convert module
- py3dtiles.earcut module
- py3dtiles.exceptions module
- py3dtiles.export module
- py3dtiles.extendable module
- py3dtiles.extension module
- py3dtiles.feature_table module
- py3dtiles.gltf module
- py3dtiles.info module
- py3dtiles.merger module
- py3dtiles.pnts module
- py3dtiles.tile module
Tile
Tile.add_child()
Tile.get_children()
Tile.get_content()
Tile.get_content_uri()
Tile.get_direct_children()
Tile.get_refine_mode()
Tile.get_transform()
Tile.has_children()
Tile.set_content()
Tile.set_content_uri()
Tile.set_refine_mode()
Tile.set_transform()
Tile.sync_bounding_volume_with_children()
Tile.to_dict()
Tile.write_content()
- py3dtiles.tile_content module
- py3dtiles.tileset module
- py3dtiles.utils module
- py3dtiles.wkb_utils module