Skip to content

Commit

Permalink
glTFへシリアライズするためのモジュールを作成 (#16)
Browse files Browse the repository at this point in the history
glTF仕様(https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#properties-reference
)に従って、モデルを`nusamai-gltf/src/models`に定義しました。


`nusamai-gltf/examples/geometry_to_gltf.rs`にモデルの利用方法を含めた、glTF(glb)への変換方法を書いています。

以下のコマンドを実行
```bash
cargo run --example geometry_to_gltf --release -- ~/path/to/22203_numazu-shi_2021_citygml_4_op/udx/bldg/52385628_*_6697_op.gml 
```
  • Loading branch information
nokonoko1203 authored and ciscorn committed Dec 27, 2023
1 parent 82766aa commit 28368e9
Show file tree
Hide file tree
Showing 117 changed files with 252,958 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
members = [
"app/src-tauri",
"nusamai-geometry",
"nusamai-gltf",
"nusamai-geojson",
"nusamai-plateau",
"nusamai-mvt",
Expand Down
2 changes: 1 addition & 1 deletion nusamai-geojson/examples/citygml_polygons.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! CityGMLファイル (.gml) からポリゴンを読み込んで .geojson 形式で出力するデモ
//! CityGMLファイル (.gml) からポリゴンを読み込んで .geojson 形式で出力するデモ
//! nusamai-geometry/examples/citygml_polygons.rs を元にしています。
//!
//! 使用例:
Expand Down
23 changes: 23 additions & 0 deletions nusamai-gltf/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "nusamai-gltf"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
encoding_rs = "0.8.33"
serde = { version = "1.0.192", features = ["derive"] }
serde_json = { version = "1.0.108", features = ["float_roundtrip"] }
serde_repr = "0.1.17"

[dev-dependencies]
glob = "0.3.1"
clap = { version = "4.4.6", features = ["derive"] }
elementtree = "1.2.3"
nusamai-geometry = { path = "../nusamai-geometry" }
quick-xml = "0.31.0"
thiserror = "1.0.50"
earcut-rs = { git = "https://github.com/MIERUNE/earcut-rs.git" }
indexmap = "2.1.0"
byteorder = "1.5.0"
Loading

0 comments on commit 28368e9

Please sign in to comment.