Skip to content

"Empty point set" for non-empty point set (possible numerical stability issue) #2

@cormacrelf

Description

@cormacrelf

The following points cause a panic with "Empty point set", which is clearly a bit wrong because I'm counting six points there. I have a suspicion that if the circumscribing sphere part of the algorithm used https://crates.io/crates/robust, that this might not happen.

use nalgebra::{Point3, Vector3};
use std::collections::VecDeque;
type Ball = miniball::Ball<f32, nalgebra::Const<3>>;

#[test]
fn test_miniball_failure_case() {
    let mut buffer = [
        [0.8155192, -0.5787301, 0.0],
        [0.7634287, -0.6458921, 0.0],
        [0.7634287, -0.6458921, 8.751844e-16],
        [0.8993817, -0.43716416, -1.7844731e-15],
        [0.8155192, -0.5787301, -2.9261717e-15],
        [0.8993817, -0.43716416, 0.0],
    ]
    .into_iter()
    .map(|v| Vector3::<f32>::from_column_slice(&v[..]))
    .map(From::from)
    .collect::<VecDeque<Point3<f32>>>();
    let _ = Ball::enclosing_points(&mut buffer);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions