Expand description
Geometry attributes access and iterators
Geometry attributes of different types are represented as trait objects and need to be downcast to concrete types
use hapi_rs::session::new_in_process;
use hapi_rs::geometry::*;
use hapi_rs::attribute::*;
let session = new_in_process(None).unwrap();
let lib = session.load_asset_file("otls/hapi_geo.hda").unwrap();
let node = lib.try_create_first().unwrap();
let geo = node.geometry().unwrap().unwrap();
geo.node.cook_blocking().unwrap();
let attr_p = geo.get_attribute(0, AttributeOwner::Point, "P").unwrap().expect("P exists");
let attr_p = attr_p.downcast::<NumericAttr<f32>>().unwrap();
attr_p.get(0).expect("read_attribute");
Structs
- Returned by
DataArray::iter
- Returned by
DataArray::iter_mut
- Groups data and sizes arrays for working with geometry attributes. See
crate::attribute::NumericArrayAttr::get
. - Represents multi-array string data. Returned by
crate::attribute::StringArrayAttr::get