py3dtiles.tileset.tile module#
- class py3dtiles.tileset.tile.Tile(geometric_error: float = 500, bounding_volume: BoundingVolume[Any] | None = None, transform: ndarray[Any, dtype[float64]] = array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), refine_mode: Literal['ADD', 'REPLACE'] = 'ADD', content_uri: Path | str | None = None)[source]#
Bases:
RootProperty[TileDictType]Represents a Tile in the 3dtiles specs
- change_base(from_path: Path, to_path: Path) None[source]#
Change the base for all the relative tile content uri. For instance, calling tile.change_base(Path(“outfolder/points”), Path(“outfolder/”)) would change the content uri to points/path/to/content.pnts.
It’s useful to transfer a tile to another tileset. For instance, let’s say tile t has been loaded from the on disk tileset1 and you want to use this tile in tileset2. If you want to keep the binary tile contents in the same place in the file hierarchy, you can just do:
`python t.change_base(tileset1.root_uri, tileset2.root_uri) `
- delete_on_disk(root_uri: Path, delete_sub_tileset: bool = False) None[source]#
Deletes all files linked to the tile and its children. The uri of the folder where tileset is, should be defined.
- Parameters:
root_uri – The folder where tileset is.
delete_sub_tileset – If True, all tilesets present as tile content will be removed as well as their content. If False, the linked tilesets in tiles won’t be removed.
- classmethod from_dict(tile_dict: TileDictType) Tile[source]#
- get_all_children() list[Tile][source]#
- Returns:
the recursive (across the children tree) list of the children tiles
- get_or_fetch_content(root_uri: Path | None) TileContent | TileSet[source]#
If a tile_content content has been set, returns this content. If the tile content is None and a tile_content uri has been set, the tile will load the file and return its content.
- Parameters:
root_uri – the base uri which tile.content_uri is relative to. Usually the directory containing the tileset containing this tile.
- get_transformed_bounding_volume() BoundingVolume[Any][source]#
Get the bounding volume of this tile, transformed according to this tile transformation.
This bounding volume is therefore in the parent’s local coordinate system, possibly the world coordinate if this tile has no parent.
- to_dict() TileDictType[source]#
- transform_coord(coord: ndarray[Any, dtype[T]]) ndarray[Any, dtype[T]][source]#
Transform one coordinate according to this tile transformation property.
NOTE: this only applies the current tile transformation, not the transformation of ancestors