Config

Struct Config 

Source
pub struct Config { /* private fields */ }
Expand description

Configuration struct for quick hull algorithm parameters

This struct encapsulates various configuration parameters that control the limit and various of the algorithm . Users can customize the algorithm’s execution by adjusting these settings, such as the number of faces, points, distance thresholds, etc., depending on the specific needs of the application.

§Fields

  • max_face_count: The maximum number of faces. This limits the number of faces involved in the computation, preventing the algorithm from becoming too complex with large inputs.
  • max_point_count: The maximum number of points. This limits the number of points that can be processed, helping optimize performance by capping the input size.
  • epsilon: The primary distance threshold used to determine whether two points are close enough. The exact value depends on the scale of the problem domain.
  • plane_test_epsilon: The distance threshold used during plane tests to determine if a point lies on a plane.
  • min_init_distance: The minimum distance threshold during init the first simplex.
  • conflict_point_epsilon: The distance threshold used to determine if there are conflicting points in the computation.
  • auto_calculate_epsilons: A flag indicating whether to automatically calculate the epsilon values. If set to true, the algorithm will dynamically adjust the epsilon values based on the input data.

Implementations§

Source§

impl Config

Provides accessors and modifiers for the Config struct.

Source

pub fn max_face_count(&self) -> u32

Gets the maximum number of faces allowed in the convex hull.

Source

pub fn max_point_count(&self) -> u32

Gets the maximum number of points to be considered for the convex hull.

Source

pub fn epsilon(&self) -> f32

Gets the general epsilon value for floating-point comparisons.

Source

pub fn plane_test_epsilon(&self) -> f32

Gets the epsilon value used for testing if a point is on a plane.

Source

pub fn min_init_distance(&self) -> f32

Gets the minimum distance required for the initial simplex points.

Source

pub fn conflict_point_epsilon(&self) -> f32

Gets the epsilon value used when assigning points to the conflict list of a face.

Source

pub fn auto_calculate_epsilons(&self) -> bool

Returns true if epsilon values are automatically calculated based on the input point cloud’s AABB.

Source

pub fn set_max_face_count(&mut self, max_face_count: u32)

Sets the maximum number of faces allowed in the convex hull.

§Panics

Panics if max_face_count is less than 4.

Source

pub fn set_max_point_count(&mut self, max_point_count: u32)

Sets the maximum number of points to be considered for the convex hull.

§Panics

Panics if max_point_count is less than 4.

Source

pub fn set_epsilon(&mut self, epsilon: f32)

Sets the general epsilon value for floating-point comparisons.

§Panics

Panics if epsilon is not a positive number.

Source

pub fn set_plane_test_epsilon(&mut self, plane_test_epsilon: f32)

Sets the epsilon value for testing if a point is on a plane.

§Panics

Panics if plane_test_epsilon is not a positive number.

Source

pub fn set_min_init_distance(&mut self, min_init_distance: f32)

Sets the minimum distance required for the initial simplex points.

§Panics

Panics if min_init_distance is not a positive number.

Source

pub fn set_conflict_point_epsilon(&mut self, conflict_point_epsilon: f32)

Sets the epsilon value used when assigning points to the conflict list of a face.

§Panics

Panics if conflict_point_epsilon is not a positive number.

Source

pub fn set_auto_calculate_epsilons(&mut self, auto_calculate_epsilons: bool)

Sets whether to automatically calculate epsilon values based on the input point cloud’s AABB.

Source

pub fn set_shift_point_align_aabb_center(&mut self, align_to_center: bool)

Sets whether to shift the input points to align their AABB center with the origin. This can improve numerical stability for point clouds far from the origin.

Source

pub fn shift_point_align_aabb_center(&self) -> bool

Returns true if the input points are shifted to align their AABB center with the origin.

Source

pub fn set_expand_faces_in_partial_success_state(&mut self, v: bool)

Sets whether to expand the hull with on-plane points when the construction ends in a partial success state (e.g., due to face count limits).

Source

pub fn expand_faces_in_partial_success_state(&self) -> bool

Returns true if the hull should be expanded with on-plane points when the construction ends in a partial success state.

Source§

impl Config

Provides constructors and internal methods for Config.

Source

pub fn new( max_face_count: u32, max_point_count: u32, base_epsilon: f32, auto_calculate_epsilons: bool, shift_point_align_aabb_center: bool, ) -> Config

Creates a new Config with specified parameters.

This constructor allows for fine-grained control over the hull generation process.

§Arguments
  • max_face_count - The maximum number of faces allowed in the resulting convex hull.
  • max_point_count - The maximum number of points to use for hull construction.
  • base_epsilon - The base epsilon value for floating-point comparisons. This is used to derive other epsilon values if auto_calculate_epsilons is false.
  • auto_calculate_epsilons - If true, various epsilon values are dynamically calculated based on the scale of the input points.
  • shift_point_align_aabb_center - If true, input points will be translated so their AABB center is at the origin. This can improve numerical stability.

Trait Implementations§

Source§

impl Default for Config

Provides a default configuration for the QuickHull algorithm.

The default values are suitable for general use cases but may need tuning for specific point distributions.

Source§

fn default() -> Config

Creates a default Config instance.

  • max_face_count: 255
  • max_point_count: 65536
  • base_epsilon: 1e-6
  • auto_calculate_epsilons: true
  • shift_point_align_aabb_center: false

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.