libfive 0.3.1

Tools for solid modeling, especially suited for parametric and procedural design.
Documentation
//
// Rust API for the libfive standard library’s ‘csg’ module.
//
// DO NOT EDIT BY HAND!
// This file is automatically generated from libfive/stdlib/stdlib.h.
//
// It was last generated on 2021-05-09 16:23:13 by user moritz.
//

/// # Csg <a name="csg"></a>
impl Tree {
    pub fn union(self, b: Tree) -> Self {
        Self(unsafe { sys::_union(self.0, b.0) })
    }

    pub fn intersection(self, b: Tree) -> Self {
        Self(unsafe { sys::intersection(self.0, b.0) })
    }

    pub fn inverse(self) -> Self {
        Self(unsafe { sys::inverse(self.0) })
    }

    pub fn difference(self, b: Tree) -> Self {
        Self(unsafe { sys::difference(self.0, b.0) })
    }

    pub fn offset(self, o: TreeFloat) -> Self {
        Self(unsafe { sys::offset(self.0, o.0) })
    }

    pub fn clearance(self, b: Tree, offset: TreeFloat) -> Self {
        Self(unsafe { sys::clearance(self.0, b.0, offset.0) })
    }

    pub fn shell(self, offset: TreeFloat) -> Self {
        Self(unsafe { sys::shell(self.0, offset.0) })
    }

    pub fn blend_expt(self, b: Tree, m: TreeFloat) -> Self {
        Self(unsafe { sys::blend_expt(self.0, b.0, m.0) })
    }

    pub fn blend_expt_unit(self, b: Tree, m: TreeFloat) -> Self {
        Self(unsafe { sys::blend_expt_unit(self.0, b.0, m.0) })
    }

    pub fn blend_rough(self, b: Tree, m: TreeFloat) -> Self {
        Self(unsafe { sys::blend_rough(self.0, b.0, m.0) })
    }

    pub fn blend_difference(self, b: Tree, m: TreeFloat, o: TreeFloat) -> Self {
        Self(unsafe { sys::blend_difference(self.0, b.0, m.0, o.0) })
    }

    pub fn morph(self, b: Tree, m: TreeFloat) -> Self {
        Self(unsafe { sys::morph(self.0, b.0, m.0) })
    }

    pub fn loft(self, b: Tree, zmin: TreeFloat, zmax: TreeFloat) -> Self {
        Self(unsafe { sys::loft(self.0, b.0, zmin.0, zmax.0) })
    }

    pub fn loft_between(
        self,
        b: Tree,
        lower: TreeVec3,
        upper: TreeVec3,
    ) -> Self {
        Self(unsafe {
            sys::loft_between(
                self.0,
                b.0,
                sys::tvec3 {
                    x: lower.x.0,
                    y: lower.y.0,
                    z: lower.z.0,
                },
                sys::tvec3 {
                    x: upper.x.0,
                    y: upper.y.0,
                    z: upper.z.0,
                },
            )
        })
    }
}