Struct hrbf::HrbfBuilder

source ·
pub struct HrbfBuilder<T, K>where
    T: Real,
    K: Kernel<T>,{ /* private fields */ }
Expand description

A builder for an HRBF potential.

This struct collects the data needed to build a complete HRBF potential. This includes a set of sites, points, normals and optionally a custom kernel.

Implementations§

source§

impl<T, K> HrbfBuilder<T, K>where T: Real, K: Kernel<T> + Clone + Default,

source

pub fn new(sites: Vec<Point3<T>>) -> HrbfBuilder<T, K>

Construct an HRBF builder with a set of sites.

sites define the points used by HRBF at which the kernel will be evaluated. Typically it is recommended to use the sites colocated with, or closely approximating the points sampling the desired zero level-set of the HRBF field.

sites also initializes the size of the HRBF. Additional data to the HRBF builder must have the same size as sites.

sites also serve as the default sampling points used to interpolate the zero level-set of the HRBF. In other words, if points is not specified, sites will be used instead.

source

pub fn offsets(&mut self, offsets: Vec<T>) -> &mut Self

Specify a set of values indicating the potential to be intepolated at each corresponding point interpolated by the HRBF.

If this is not specified, each point is expected to be interpolating the zero level-set of the HRBF. Effectively, this assigns the offset of the HRBF field potential from the sample points.

Negative offsets would result in the HRBF zero level-set to be pushed outwards, while positive offsets would push it inwards assuming that the interior of the object is represented by the negative HRBF potential (it is also equally valid to reverse this convention).

The number of offsets must be the same as the sites specified to new.

source

pub fn points(&mut self, points: Vec<Point3<T>>) -> &mut Self

A set of points intended to sample the surface, or the zero level-set of the HRBF potential.

If points is the same as as sites specified in new, then this setting can be omitted.

source

pub fn normals(&mut self, normals: Vec<Vector3<T>>) -> &mut Self

A set of normal vectors setting the direction of the HRBF gradient at each of the points as specified by the points function or sites passsed into new if the points function is not called.

source

pub fn build_system(&self) -> Result<(DMatrix<T>, DVector<T>)>

(Advanced) Build the linear system that is solved to compute the actual HRBF without evaluating it.

This function returns the fitting matrix A and corresponding right-hand-side b. b is a stacked vector of 4D vectors representing the desired HRBF potential and normal at data point i, so A.inverse()*b gives the betas (or weights) defining the HRBF potential.

source

pub fn build(&self) -> Result<Hrbf<T, K>>

A non-consuming builder.

source§

impl<T, K> HrbfBuilder<T, K>where T: Real, K: Kernel<T> + LocalKernel<T>,

source

pub fn radius(self, radius: T) -> Self

Set the kernel radius to be radius for all sites.

Note that this parameter is only valid for local kernel types like Csrbf31, Csrbf42 and Gauss. The radius in the Gauss kernel specifies its standard deviation, while in Csrbf31 and Csrbf42, radius is the support radius beyond which the kernel is zero valued.

source

pub fn radii(self, radii: Vec<T>) -> Self

Set the kernel radius for each site individually.

Note that this parameter is only valid for local kernel types like Csrbf31, Csrbf42 and Gauss. The radii for the Gauss kernel specify its standard deviation, while in Csrbf31 and Csrbf42, the radii are the support radii beyond which the kernel is zero.

Trait Implementations§

source§

impl<T, K> Clone for HrbfBuilder<T, K>where T: Real + Clone, K: Kernel<T> + Clone,

source§

fn clone(&self) -> HrbfBuilder<T, K>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, K> Debug for HrbfBuilder<T, K>where T: Real + Debug, K: Kernel<T> + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T, K> RefUnwindSafe for HrbfBuilder<T, K>where K: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, K> Send for HrbfBuilder<T, K>where K: Send,

§

impl<T, K> Sync for HrbfBuilder<T, K>where K: Sync,

§

impl<T, K> Unpin for HrbfBuilder<T, K>where K: Unpin, T: Unpin,

§

impl<T, K> UnwindSafe for HrbfBuilder<T, K>where K: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.