Parametrization#
- class Parametrization(*args, **kwargs)[source]#
Bases:
ABCAbstract base class to represent picklable parametrizations.
Methods
Parametrization.compute_distance(points, ...)Computes the distance between points and the parameterization.
Parametrization.compute_normal(positions, ...)Compute the normal vector at a given point on the surface.
Parametrization.fit(positions, *args, **kwargs)Fit a parametrization to a point cloud.
Parametrization.points_per_sampling(...[, ...])Computes the approximate number of random samples required to achieve a given spatial sampling_density.
Parametrization.sample(n_samples[, ...])Samples points from the surface of the parametrization.
- compute_distance(points, **kwargs)[source]#
Computes the distance between points and the parameterization.
- Parameters:
- pointsnp.ndarray
Array of coordinates (n, d).
- Returns:
- np.ndarray
Distances between points and the parametrization.
- abstractmethod compute_normal(positions, *args, **kwargs)[source]#
Compute the normal vector at a given point on the surface.
- Parameters:
- pointsnp.ndarray
Points on the surface with shape n x d
- Returns:
- np.ndarray
Normal vectors at the given points
- abstractmethod fit(positions, *args, **kwargs)[source]#
Fit a parametrization to a point cloud.
- Parameters:
- positionsnp.ndarray
Point coordinates with shape (n x 3)
- *argsList
Additional arguments
- **kwargsDict
Additional keywoard arguments.
- Returns:
- Parametrization
Parametrization instance.
- abstractmethod points_per_sampling(sampling_density, normal_offset=None)[source]#
Computes the approximate number of random samples required to achieve a given spatial sampling_density.
- Parameters:
- sampling_densityfloat
Average distance between points.
- normal_offsetfloat, optional
Compute number of samples on offset parametrization, instead of current.
- Returns:
- int
Number of required random samples.
- abstractmethod sample(n_samples, normal_offset=0.0, *args, **kwargs)[source]#
Samples points from the surface of the parametrization.
- Parameters:
- n_samplesint
Number of samples to draw
- normal_offsetfloat, optional
Offset points by normal_offset times their normal vector.
- *argsList
Additional arguments
- **kwargsDict
Additional keywoard arguments.
- Returns:
- np.ndarray
Point coordinates (n, 3).