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§
- Array
Iter - Returned by
DataArray::iter
- Array
Iter Mut - Returned by
DataArray::iter_mut
- Attribute
- Attribute
Info - Data
Array - Groups data and sizes arrays for working with geometry attributes.
See
crate::attribute::NumericArrayAttr::get
. - Dictionary
Array Attr - Dictionary
Attr - Multi
Array Iter - Numeric
Array Attr - Numeric
Attr - String
Array Attr - String
Attr - String
Multi Array - Represents multi-array string data. Used as storage for string and dictionary array attributes.
Each element of this array is itself a
StringArray