Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] matrix-os build #306

Merged
merged 15 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ RUN apt-get update && apt-get install -y \
libc6-dev \
m4 \
gcc \
libgdal-dev \
libopenscenegraph-dev \
&& rm -rf /var/lib/apt/lists/*

# 设置工作目录
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"rust-lang.rust"
"rust-lang.rust-analyzer"
]
}
21 changes: 21 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Ubuntu

on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install dependencies on Ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y g++ libgdal-dev libopenscenegraph-dev

- name: Build
run: cargo build --verbose --release

- name: Test
run: cargo test --verbose
25 changes: 0 additions & 25 deletions .github/workflows/rust.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Windows

on: [push]
jobs:
build-and-test:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v4
id: cache-vcpkg
with:
path: ./vcpkg
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/build.rs') }}
restore-keys: |
${{ runner.os }}-vcpkg-

- name: Install dependencies on Windows
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.bat
./vcpkg/vcpkg install gdal:x64-windows-release
./vcpkg/vcpkg install osg:x64-windows-release
tree ./vcpkg/installed /F /A

- name: Build
run: cargo build --verbose --release
163 changes: 85 additions & 78 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
# Introduction

[![glTF status](https://img.shields.io/badge/glTF-2%2E0-green.svg?style=flat)](https://github.com/KhronosGroup/glTF)
[![Action status](https://github.com/fanvanzh/3dtiles/actions/workflows/rust.yml/badge.svg)](https://github.com/fanvanzh/3dtiles/actions/workflows/rust.yml)
[![Action status](https://github.com/fanvanzh/3dtiles/actions/workflows/linux.yml/badge.svg)](https://github.com/fanvanzh/3dtiles/actions/workflows/linux.yml)
[![Action status](https://github.com/fanvanzh/3dtiles/actions/workflows/windows.yml/badge.svg)](https://github.com/fanvanzh/3dtiles/actions/workflows/windows.yml)

Tools for 3D-Tiles convertion.

This is a `RUST language` project with cpp lib to handle osgb data.

Tools provided are as follow:
3D-Tiles convertion:

- `Osgb(OpenSceneGraph Binary)` to `3D-Tiles`: convert huge of osgb file to 3D-Tiles.

Expand All @@ -18,68 +15,83 @@ Tools provided are as follow:
- `Fbx` to `3D-Tiles`: convert fbx file to 3D-Tiles, include auto_lod\texture convertion etc.



You may intereted in:

- [How to build this project?](https://github.com/fanvanzh/3dtiles/wiki/How-to-build)
- [How to build?](https://github.com/fanvanzh/3dtiles/wiki/How-to-build)

- [How to debug?](https://github.com/fanvanzh/3dtiles/wiki/How-to-debug)

- [Download Windows Pre-build](https://github.com/fanvanzh/3dtiles/releases/download/v0.4/3dtile.zip)

- [Docker Image](https://hub.docker.com/r/winner1/3dtiles)

# 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

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

## ② Examples

```sh
# 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}"
_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}"
_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
_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
_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
_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
_3dtile.exe -f b3dm -i E:\Data\aa.b3dm -o E:\Data\aa.glb
```

## ③ Paramters

To Translate.

# Data Requirements & Announcement

To Translate.





---

**[English](#Introduction) | 简体中文**

<h1 id="intro">简介</h1>

3D-Tile 转换工具集,高效快速的 3D-Tiles 生产工具,极度节省你的处理时间。

这是一个混合了 c 和 c++ 库(主要是 osgb)的 Rust 项目。
3D-Tile 转换工具集,高效快速的 3D-Tiles 生产工具。

提供了如下的子工具:

Expand All @@ -90,34 +102,63 @@ To Translate.
- `Fbx` 转 `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
```
# 使用说明

## ① 命令行格式

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

## ② 示例命令

```sh
# 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}"
_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
_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
_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
_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
_3dtile.exe -f b3dm -i E:\Data\aa.b3dm -o E:\Data\aa.glb
```

## ③ 参数说明
Expand All @@ -130,8 +171,8 @@ To Translate.
{
"x": 120,
"y": 30,
"offset": 0 , // 模型最低面地面距离
"max_lvl" : 20 // 处理切片模型到20级停止
"offset": 0,
"max_lvl" : 20
}
```

Expand Down Expand Up @@ -183,37 +224,3 @@ Shapefile 中需要有字段来表示高度信息。
### ④ B3dm 单文件转 glb

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


---

# Who use / Who star

- NASA JPL (gkjohnson)
- AnalyticalGraphicsInc (kring)
- NVIDIA (Vinjn Zhang)
- Ubisoft (Cmdu76)
- Baidu (hinikai)
- Esri (suny323)
- Geostar (hekaikai\shitao1988)

- MapTalks (brucin\fuzhenn\axmand)
- Alibaba (luxueyan)
- Tencent (NichoZhang)
- Data Cloud Co- Ltd (liujin834)
- Tsinghua University (DeZhao-Zhang)
- Peking University (CHRIS-WiNG\Weizhen-Fang)
- Wuhan University (chenguanzhou)
- Guangzhou University (LreeLenn)
- Hopkins University (AndrewAnnex)

- 中国铁道科学设计研究院
- 上海华东设计研究院
- 江苏省测绘研究所
- 宁波市测绘设计研究院
- 合肥火星科技有限公司 (muyao1987)
- 北京西部数据科技 (vtxf\elfc2000)

# About author

作者不是专业搞三维GIS的,因偶尔有个需求要展示 3D-Tiles,一时找不到工具,就写了个轮子,代码多有纰漏,仅供参考。
Binary file removed bin/gdal201.dll
Binary file not shown.
Loading