Skip to main content
chat link Build pipeline status Py3dtiles version on pypi Supported python versions Code coverage py3dtiles GitLab last commit Py3dtiles license

Py3dtiles

Py3dtiles is a CLI tool and a library writing with Python for creating and manipulating 3D Tiles.

Features

Tileset manipulation

  • Read tileset lazily (to avoid useless memory consumption)

  • Write tilesets with their tile contents

  • Browse the tile structure, access to the properties and tile content with the ability to modify them

  • Read and write pnts and b3dm with the batch table support

Tiling tools

All tiling tools are available with the API and the CLI

  • Convert data into 3d tiles (tileset.json + pnts/b3dm files). The supported file formats are:
    • las/laz

    • xyz

    • ply

    • wkb

  • Merge 3D Tiles tilesets into one tileset

  • Read pnts and b3dm files and print a summary of their contents

Installation

With pip

To install Py3dtiles with pip (recommended method)

pip install py3dtiles

For installing specific format dependencies (las/laz, ply, postgis, install from source…), please read the installation section in the documentation.

With docker

docker run -it --rm \
    --mount type=bind,source="$(pwd)",target=/data/ \
    --volume /etc/passwd:/etc/passwd:ro \
    --volume /etc/group:/etc/group:ro \
    --user $(id -u):$(id -g) \
    py3dtiles/py3dtiles:<version> \
    convert <file>

The 3dtiles/ directory should appear in your current directory.

NOTE:

  • the –mount option is necessary for docker to read your source data and to write the result. The way it is written in this example only allows you to read source files in the current folder or in a subfolder

  • This line –volume /etc/passwd:/etc/passwd:ro –volume /etc/group:/etc/group:ro –user $(id -u):$(id -g) is only necessary if your uid is different from 1000.

API basic example

>>> from pathlib import Path
>>>
>>> from py3dtiles.tileset.tileset import TileSet
>>>
>>> tileset = TileSet.from_file(Path("tests/fixtures/tiles/tileset.json"))
>>> all_tiles = (tileset.root_tile, *tileset.root_tile.get_all_children())
>>> for tile in all_tiles:
...     if not tile.has_content():
...         continue
...     tile_content = tile.get_or_fetch_content(tileset.root_uri)
...     print(f"The tile {tile.content_uri} has a content of {type(tile_content)} type")
...     print(f"with this bounding volume: {tile.bounding_volume.to_dict()}")
The tile r.pnts has a content of <class 'py3dtiles.tileset.content.pnts.Pnts'> type
with this bounding volume: {'box': [np.float64(0.390625), np.float64(0.3125), np.float64(0.0), np.float64(0.390625), np.float64(0.0), np.float64(0.0), np.float64(0.0), np.float64(0.3125), np.float64(0.0), np.float64(0.0), np.float64(0.0), np.float64(0.0)]}
The tile r1.pnts has a...

Result example

The data visualized on this website is generated with the convert and merge CLI command of Py3dtiles: https://giro3d.org/examples/lidar_hd.html

The library used on this site is giro3d but there are other 3dtiles viewers.

Lidar HD data converted into 3d tiles visualized with giro3d

Documentation

The CLI and API documentation with examples are available here:

Roadmap

The objectives are:

  • to support the standard at version 1.1 (mainly gltf as content)

  • to convert more file formats

  • to have a better tiler for geometries

Contributing

We welcome new contributions. This may be fixing an issue or adding a feature, but also:

  • reporting an issue

  • reviewing a MR

  • improving the documentation or creating a tutorial

  • talking about this project to others

  • help others on the [chat room](https://matrix.to/#/#py3dtiles:matrix.org)

We have written a contributing guide to help you for your first contribution.

License

Py3dtiles is distributed under the Apache 2 Licence.

Thanks

The following entities have funded py3dtiles:

Release files for py3dtiles 12.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py3dtiles 12.1.1
File Size Uploaded
py3dtiles-12.1.1.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for py3dtiles 12.1.1
File Interpreter ABI Platform
py3dtiles-12.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.7 MB

Release files / py3dtiles-12.1.1.tar.gz

Download URL py3dtiles-12.1.1.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
b750a3724ad88c74a8fc6f3a7f465d67581db9006f3c7dcbbc77e9281bb57b40
BLAKE2b-256 checksum
How to use checksums
6c901430cb7ab17b6ea33c11c0b31cb27c0eace90dfd759a3dc135dfea6316c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / py3dtiles-12.1.1-py3-none-any.whl

Download URL py3dtiles-12.1.1-py3-none-any.whl
Size 123.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba6b0e1b573ea2a45bbaf826804d7d46d30cb21dcceb416e428b464addc16f2f
BLAKE2b-256 checksum
How to use checksums
5d5628d24bf069ca8600ac106977665d1c8931a346b45ac5276a082f657a688d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.10.20

Release history Release notifications | RSS feed

This release

12.1.1 This release

2 release files

12.1.0

2 release files

11.1.0

2 release files

11.0.0

2 release files

9.0.0

2 release files

8.0.2

2 release files

8.0.1

2 release files

7.0.0

2 release files

6.0.0

2 release files

5.0.0

2 release files

4.0.0

2 release files

3.0.0

1 release file

2.0.0

2 release files

1.0.2

2 release files

1.0.1

1 release file

0.0.9

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page