pub struct Cylinder {
pub guid: String,
pub name: String,
pub radius: f32,
pub line: Line,
pub mesh: Mesh,
pub xform: Xform,
}
Expand description
A cylinder geometry defined by a line and radius.
The cylinder is generated as a 10-sided cylinder mesh that is oriented along the line direction and scaled to match the line length and specified radius.
Fields§
§guid: String
§name: String
§radius: f32
§line: Line
§mesh: Mesh
§xform: Xform
Implementations§
Source§impl Cylinder
impl Cylinder
fn create_cylinder_mesh(line: &Line, radius: f32) -> Mesh
fn unit_cylinder_geometry() -> (Vec<Point>, Vec<[usize; 3]>)
fn line_to_cylinder_transform(line: &Line, radius: f32) -> Xform
fn transform_geometry( geometry: &(Vec<Point>, Vec<[usize; 3]>), xform: &Xform, ) -> Mesh
Sourcepub fn jsondump(&self) -> Result<String, Box<dyn Error>>
pub fn jsondump(&self) -> Result<String, Box<dyn Error>>
Serializes the Cylinder to a JSON string.
Sourcepub fn jsonload(json_data: &str) -> Result<Self, Box<dyn Error>>
pub fn jsonload(json_data: &str) -> Result<Self, Box<dyn Error>>
Deserializes a Cylinder from a JSON string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cylinder
impl<'de> Deserialize<'de> for Cylinder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Cylinder
impl RefUnwindSafe for Cylinder
impl Send for Cylinder
impl Sync for Cylinder
impl Unpin for Cylinder
impl UnwindSafe for Cylinder
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