Skip to content

Commit

Permalink
Make assimp feature disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 13, 2024
1 parent 7247c3a commit d2e0a45
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
if: startsWith(matrix.os, 'windows')

- run: cargo fmt --all --check
- run: cargo clippy --all-targets
- run: cargo clippy --all-features --all-targets
- run: cargo hack build --feature-powerset
- run: cargo test
- run: cargo test --all-features

wasm:
runs-on: ubuntu-20.04
Expand All @@ -68,7 +68,7 @@ jobs:
targets: wasm32-unknown-unknown
- name: Install wasm-pack
uses: taiki-e/install-action@wasm-pack
- run: cargo build --target wasm32-unknown-unknown --no-default-features --lib
- run: cargo build --target wasm32-unknown-unknown --lib
- run: cargo build --target wasm32-unknown-unknown -p urdf-viz-wasm
- name: Build wasm example
run: npm install && npm run build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
with:
bin: urdf-viz
include: ${{ matrix.include-files }}
# TODO: Should we enable assimp feature for pre-built binary?
# all-features: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_PROFILE_RELEASE_LTO: true
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exclude = [".github/*", "img/*"]
members = ["examples/wasm"]

[features]
default = ["assimp"]
default = []
assimp = ["dep:assimp", "assimp-sys", "tempfile"]

# Note: k, kiss3d, serde, structopt, tokio, urdf-rs, and wasm-bindgen are public dependencies.
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,18 @@ If you are using rust-lang already and `cargo` is installed, you can install by
cargo install urdf-viz
```

If you don't use mesh other than `.obj`, `.stl`, and `.dae` files, you can skip install
of assimp by disabling the `assimp` feature like below.
If you want to use mesh other than `.obj`, `.stl`, and `.dae` files, you need to install
with assimp like below.

```bash
cargo install urdf-viz --no-default-features
cargo install urdf-viz --features assimp
```

Note: When the `assimp` feature is disabled, materials are not fully supported yet.

### Pre-requirements for build

#### Common

You need [cmake](https://cmake.org/download/) to use assimp (mesh loader).
It can be skipped if you use `--no-default-features`, but it will make it
fail to show mesh files other than `.obj`, `.stl`, and `.dae`.
If you want to use `--features assimp` to use mesh other than `.obj`, `.stl`, and `.dae` files, you need [cmake](https://cmake.org/download/).

#### On Linux

Expand Down Expand Up @@ -241,7 +237,7 @@ curl http://127.0.0.1:7777/get_urdf_text
* [kiss3d](https://github.com/sebcrozet/kiss3d): `urdf-viz` is strongly depend on `kiss3d`, which is super easy to use, great 3D graphic engine.
* [nalgebra](https://github.com/sebcrozet/nalgebra): linear algebra library.
* [k](https://github.com/openrr/k): kinematics library which is based on [nalgebra](https://github.com/sebcrozet/nalgebra). It can load URDF files using `urdf-rs`.
* [assimp-rs](https://github.com/Eljay/assimp-rs): assimp rust interface. `kiss3d` supports `.obj` files natively, but urdf contains `dae` or `stl` files. These files are converted to kiss3d mesh model by `assimp-rs`
* [mesh-loader](https://github.com/openrr/mesh-loader): Mesh files (`.obj`, `.stl`, and `.dae`) loader.
* [urdf-rs](https://github.com/openrr/urdf-rs): URDF file loader.
* [structopt](https://github.com/TeXitoi/structopt): super easy command line arguments parser.

Expand Down
2 changes: 1 addition & 1 deletion examples/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
crate-type = ["cdylib"]

[target.'cfg(target_family = "wasm")'.dependencies]
urdf-viz = { path = "../..", default-features = false }
urdf-viz = { path = "../.." }
console_error_panic_hook = "0.1"
tracing-wasm = "0.2"
wasm-bindgen = "0.2"
Expand Down

0 comments on commit d2e0a45

Please sign in to comment.