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,
impl<T, K> HrbfBuilder<T, K>where T: Real, K: Kernel<T> + Clone + Default,
sourcepub fn new(sites: Vec<Point3<T>>) -> HrbfBuilder<T, K>
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.
sourcepub fn offsets(&mut self, offsets: Vec<T>) -> &mut Self
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
.
sourcepub fn points(&mut self, points: Vec<Point3<T>>) -> &mut Self
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.
sourcepub fn normals(&mut self, normals: Vec<Vector3<T>>) -> &mut Self
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.
sourcepub fn build_system(&self) -> Result<(DMatrix<T>, DVector<T>)>
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§impl<T, K> HrbfBuilder<T, K>where
T: Real,
K: Kernel<T> + LocalKernel<T>,
impl<T, K> HrbfBuilder<T, K>where T: Real, K: Kernel<T> + LocalKernel<T>,
sourcepub fn radius(self, radius: T) -> Self
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.
sourcepub fn radii(self, radii: Vec<T>) -> Self
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§
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§
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.