pub struct ScadFile { /* private fields */ }Expand description
Object that stores scad objects along with global parameters for the objects. Also has methods for writing the data to files.
Implementations§
Source§impl ScadFile
impl ScadFile
pub fn new() -> ScadFile
Sourcepub fn get_code(&self) -> String
pub fn get_code(&self) -> String
Returns the code for the global parameters as well as all the children in the file
pub fn add_object(&mut self, object: ScadObject)
Sourcepub fn set_detail(&mut self, detail: i32)
pub fn set_detail(&mut self, detail: i32)
Sets the $fn variable for the whole file. This varibale defines the detail amount for cylindrical objects
Sourcepub fn write_to_file(&self, path: String) -> bool
pub fn write_to_file(&self, path: String) -> bool
Writes the resulting code to a file
##Arguments
path: The path to the file where we want to write relative to the current working directory.
##Returns The function will return false and print a message to the console if writing fails.
Auto Trait Implementations§
impl Freeze for ScadFile
impl RefUnwindSafe for ScadFile
impl Send for ScadFile
impl Sync for ScadFile
impl Unpin for ScadFile
impl UnwindSafe for ScadFile
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.