obj2tiles — OBJ → Cesium 3D Tiles
将大型 OBJ 三维模型转换为 Cesium 3D Tiles 格式(B3DM + tileset.json),适用于 CesiumJS 等 3D 地图/地球场景加载。
安装
# 从 PyPI 安装
pip install obj2tiles
# 处理纹理的可选依赖(自动缩放大纹理到 2048 以内)
pip install obj2tiles[texture]
# 本地开发安装
cd obj2tiles && pip install -e .
前置依赖
编码需要 draco_encoder 命令行工具:
# macOS
brew install draco
# Linux(从 Draco GitHub Release 下载)
# https://github.com/google/draco/releases
draco_encoder不是 Python 包,需要单独安装。运行时缺少它会给出提示。
用法
# 基本用法(本地坐标系)
obj2tiles model.obj ./output
# 指定地理位置(例如龙门石窟大佛)
obj2tiles model.obj ./output --lon 112.47 --lat 34.56
# 控制精度/大小
obj2tiles model.obj ./output --pos-bits 12 --compress 7 --levels 5
输出结构
output/
├── tileset.json Cesium 3D Tiles 清单文件
├── metadata.json 处理统计信息
├── index.html CesiumJS 查看器页面
├── lod_0.b3dm 最粗糙 LOD 层级
├── lod_1.b3dm
├── ...
└── lod_N.b3dm 最精细 LOD 层级
查看方式
cd output && python -m http.server 8080
# 打开 http://localhost:8080
Metadata
Release files for obj2tiles 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| obj2tiles-0.1.0.tar.gz | 23.5 kB | Without provenance | Details for obj2tiles-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| obj2tiles-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for obj2tiles-0.1.0-py3-none-any.whl |
Total release size: 48.2 kB
Release files / obj2tiles-0.1.0.tar.gz
| Download URL | obj2tiles-0.1.0.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34d169ca33130688bfcd6ceca87764d8e3985eeb7511c3d88d7827aabec6803f
|
|
BLAKE2b-256 checksum How to use checksums |
f0345086bab69200bfc632125335d304b57792b4d0ba81cc9b584a69528bcd97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / obj2tiles-0.1.0-py3-none-any.whl
| Download URL | obj2tiles-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b72a4373635ec3380fb678de16e3b8d2faa542595263457c3d08bfe1beea11b8
|
|
BLAKE2b-256 checksum How to use checksums |
ab9a4cf57f0cf585f360a67561c79a4378f0d810f9c3f93ea49daefb9f9ae50a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for obj2tiles 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.