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 theepsilonvalues. If set totrue, the algorithm will dynamically adjust theepsilonvalues based on the input data.
Implementations§
Source§impl Config
Provides accessors and modifiers for the Config struct.
impl Config
Provides accessors and modifiers for the Config struct.
Sourcepub fn max_face_count(&self) -> u32
pub fn max_face_count(&self) -> u32
Gets the maximum number of faces allowed in the convex hull.
Sourcepub fn max_point_count(&self) -> u32
pub fn max_point_count(&self) -> u32
Gets the maximum number of points to be considered for the convex hull.
Sourcepub fn plane_test_epsilon(&self) -> f32
pub fn plane_test_epsilon(&self) -> f32
Gets the epsilon value used for testing if a point is on a plane.
Sourcepub fn min_init_distance(&self) -> f32
pub fn min_init_distance(&self) -> f32
Gets the minimum distance required for the initial simplex points.
Sourcepub fn conflict_point_epsilon(&self) -> f32
pub fn conflict_point_epsilon(&self) -> f32
Gets the epsilon value used when assigning points to the conflict list of a face.
Sourcepub fn auto_calculate_epsilons(&self) -> bool
pub fn auto_calculate_epsilons(&self) -> bool
Returns true if epsilon values are automatically calculated based on the input point
cloud’s AABB.
Sourcepub fn set_max_face_count(&mut self, max_face_count: u32)
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.
Sourcepub fn set_max_point_count(&mut self, max_point_count: u32)
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.
Sourcepub fn set_epsilon(&mut self, epsilon: f32)
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.
Sourcepub fn set_plane_test_epsilon(&mut self, plane_test_epsilon: f32)
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.
Sourcepub fn set_min_init_distance(&mut self, min_init_distance: f32)
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.
Sourcepub fn set_conflict_point_epsilon(&mut self, conflict_point_epsilon: f32)
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.
Sourcepub fn set_auto_calculate_epsilons(&mut self, auto_calculate_epsilons: bool)
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.
Sourcepub fn set_shift_point_align_aabb_center(&mut self, align_to_center: bool)
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.
Sourcepub fn shift_point_align_aabb_center(&self) -> bool
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.
Sourcepub fn set_expand_faces_in_partial_success_state(&mut self, v: bool)
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).
Sourcepub fn expand_faces_in_partial_success_state(&self) -> bool
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.
impl Config
Provides constructors and internal methods for Config.
Sourcepub fn new(
max_face_count: u32,
max_point_count: u32,
base_epsilon: f32,
auto_calculate_epsilons: bool,
shift_point_align_aabb_center: bool,
) -> Config
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 ifauto_calculate_epsilonsis false.auto_calculate_epsilons- Iftrue, various epsilon values are dynamically calculated based on the scale of the input points.shift_point_align_aabb_center- Iftrue, input points will be translated so their AABB center is at the origin. This can improve numerical stability.