4 releases

0.1.3 Apr 13, 2023
0.1.2 May 25, 2021
0.1.1 Jul 31, 2020
0.1.0 Jul 30, 2020

#501 in Graphics APIs


Used in nsi

Apache-2.0…

17KB
308 lines

Dl OpenVDB Query

Safe wrapper for lib3Delight’s OpenVDB metadata query API.

Dependencies

This crate needs 3Delight at runtime.

If you build the crate with the feature link_lib3delight you also need this installed at compile time.

Features

[build-dependencies.dl-openvdb-query]
version = "0.1.0"
features = ["link_lib3delight"]

Use

let open_vdb_query =
    dl_openvdb_query::DlOpenVdbQuery::new(
        "tests/sphere_points.vdb",
    )
    .unwrap();

let min = -0.9416000247001648;
let max =  1.0593000277876854;
assert_eq!(
    open_vdb_query.bounding_box().unwrap(),
    [min, min, min, max, max, max]
);
assert_eq!(
    open_vdb_query.grid_names().unwrap(),
    vec!["points"]
);

lib.rs:

Safe wrapper for 3Delight’s OpenVDB metadata query API.

This is a simple API to query:

  • The bounding box.
  • The names of the grids.
  • A simplified representation of a density grid as points.
let sphere_vdb =
    dl_openvdb_query::DlOpenVdbQuery::new(
         "tests/sphere_points.vdb",
    )
    .unwrap();

let min = -0.9416000247001648;
let max =  1.0593000277876854;
assert_eq!(
    sphere_vdb.bounding_box().unwrap(),
    [min, min, min, max, max, max]
);
assert_eq!(
    sphere_vdb.grid_names().unwrap(),
    vec!["points"]
);

The lib3delight dynamic library can be linked to or it can be loaded at runtime. The latter is the default.

Linking can be forced using the feature link_lib3delight.

Dependencies

~0.5–2.4MB
~37K SLoC