pub enum CurveGeometry {
Polylines(Vec<Polyline>),
Unsupported(UnsupportedCurve),
}Expand description
The result of decoding a curves attribute that is well formed.
Variants§
Polylines(Vec<Polyline>)
Linear curves, one polyline per curve.
Unsupported(UnsupportedCurve)
Curves of a type that is not drawn yet. Skip them rather than draw their control points as lines.
Implementations§
Source§impl CurveGeometry
impl CurveGeometry
Sourcepub fn from_attribute(value: &Value) -> Result<Self, DecodeError>
pub fn from_attribute(value: &Value) -> Result<Self, DecodeError>
Decodes the value of a ATTRIBUTE (usd::usdgeom::basiscurves)
attribute.
use openbim_ifcx_geometry::curves::CurveGeometry;
let value = serde_json::json!({"points": [[0, 0, 0], [10, 0, 0]]});
let CurveGeometry::Polylines(lines) = CurveGeometry::from_attribute(&value)? else {
unreachable!()
};
assert_eq!(lines[0].points, [[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]]);Trait Implementations§
Source§impl Clone for CurveGeometry
impl Clone for CurveGeometry
Source§fn clone(&self) -> CurveGeometry
fn clone(&self) -> CurveGeometry
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CurveGeometry
impl Debug for CurveGeometry
Source§impl PartialEq for CurveGeometry
impl PartialEq for CurveGeometry
impl StructuralPartialEq for CurveGeometry
Auto Trait Implementations§
impl Freeze for CurveGeometry
impl RefUnwindSafe for CurveGeometry
impl Send for CurveGeometry
impl Sync for CurveGeometry
impl Unpin for CurveGeometry
impl UnwindSafe for CurveGeometry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more