fanvanzh / 3dtiles

The fastest tools for 3dtiles convert in the world!
Apache License 2.0
1.98k stars 594 forks source link
3d-tiles 3dtiles b3dm cesium-3dtiles gltf osgb

English | 简体中文

Introduction

glTF status Action status Action status

3D-Tiles convertion:

You may intereted in:

Build

Ubuntu

sudo apt-get update
sudo apt-get install -y g++ libgdal-dev libopenscenegraph-dev cargo
git clone https://github.com/fanvanzh/3dtiles
cd 3dtiles
cargo build --release

Centos

sudo yum install -y gdal-devel cargo g++
git clone https://github.com/fanvanzh/3dtiles
cd 3dtiles
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install osg:x64-linux-release
cargo build --release

Windows

curl https://sh.rustup.rs -sSf -o rustup-init.exe
./rustup-init.exe -y
git clone https://github.com/fanvanzh/3dtiles
cd 3dtiles
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.bat
./vcpkg/vcpkg install osg:x64-windows-release
./vcpkg/vcpkg install gdal:x64-windows-release
cargo build --release

Usage

① Command Line

_3dtile.exe [FLAGS] [OPTIONS] --format <FORMAT> --input <PATH> --output <DIR>

② Examples

# from osgb dataset
_3dtile.exe -f osgb -i E:\osgb_path -o E:\out_path
_3dtile.exe -f osgb -i E:\osgb_path -o E:\out_path -c "{\"offset\": 0}"
# use pbr-texture
_3dtile.exe -f osgb -i E:\osgb_path -o E:\out_path -c "{\"pbr\": true}"

# from single shp file
_3dtile.exe -f shape -i E:\Data\aa.shp -o E:\Data\aa --height height

# from single osgb file to glb file
_3dtile.exe -f gltf -i E:\Data\TT\001.osgb -o E:\Data\TT\001.glb

# from single obj file to glb file
_3dtile.exe -f gltf -i E:\Data\TT\001.obj -o E:\Data\TT\001.glb

# convert single b3dm file to glb file
_3dtile.exe -f b3dm -i E:\Data\aa.b3dm -o E:\Data\aa.glb

English | 简体中文

简介

3D-Tile 转换工具集,高效快速的 3D-Tiles 生产工具。

提供了如下的子工具:

编译

Ubuntu

sudo apt-get update
sudo apt-get install -y g++ libgdal-dev libopenscenegraph-dev cargo
git clone https://github.com/fanvanzh/3dtiles
cd 3dtiles
cargo build --release

Centos

sudo yum install -y gdal-devel cargo g++
git clone https://github.com/fanvanzh/3dtiles
cd 3dtiles
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
./vcpkg/vcpkg install osg:x64-linux-release
cargo build --release

Windows

curl https://sh.rustup.rs -sSf -o rustup-init.exe
./rustup-init.exe -y
git clone https://github.com/fanvanzh/3dtiles
cd 3dtiles
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.bat
./vcpkg/vcpkg install osg:x64-windows-release
./vcpkg/vcpkg install gdal:x64-windows-release
cargo build --release

使用说明

① 命令行格式

_3dtile.exe [FLAGS] [OPTIONS] --format <FORMAT> --input <PATH> --output <DIR>

② 示例命令

# from osgb dataset
_3dtile.exe -f osgb -i E:\osgb_path -o E:\out_path
_3dtile.exe -f osgb -i E:\osgb_path -o E:\out_path -c "{\"offset\": 0}"

# from single shp file
_3dtile.exe -f shape -i E:\Data\aa.shp -o E:\Data\aa --height height

# from single osgb file to glb file
_3dtile.exe -f gltf -i E:\Data\TT\001.osgb -o E:\Data\TT\001.glb

# from single obj file to glb file
_3dtile.exe -f gltf -i E:\Data\TT\001.obj -o E:\Data\TT\001.glb

# convert single b3dm file to glb file
_3dtile.exe -f b3dm -i E:\Data\aa.b3dm -o E:\Data\aa.glb

③ 参数说明

数据要求及说明

① 倾斜摄影数据

倾斜摄影数据仅支持 smart3d 格式的 osgb 组织方式:

正确的目录结构示意:

- Your-data-folder
  ├ metadata.xml
  └ Data\Tile_000_000\Tile_000_000.osgb

② Shapefile

目前仅支持 Shapefile 的面数据,可用于建筑物轮廓批量生成 3D-Tiles.

Shapefile 中需要有字段来表示高度信息。

③ 通用模型转 glTF:

支持 osg、osgb、obj、fbx、3ds 等单一通用模型数据转为 gltf、glb 格式。

转出格式为 2.0 的gltf,可在以下网址验证查看: https://pissang.github.io/clay-viewer/editor/

④ B3dm 单文件转 glb

支持将 b3dm 单个文件转成 glb 格式,便于调试程序和测试数据