Skip to content

Fix division bug in max_inscribed_ball function causing "test_max_ball" failure #453

@Shorya777

Description

@Shorya777

Describe the bug
test_max_ball testcase fails due to a numerical instability inside max_inscribed_ball.
The failure is caused by a division operation where the denominator becomes extremely small during execution, leading to failure in convergence of algorithm and ultimately a failing test.

To Reproduce
Steps to reproduce the behavior:

cd test
mkdir -p build && cd build
cmake ..
make
./test_internal_points -tc=test_max_ball

Expected behavior
test_max_ball should pass and return a valid maximum inscribed ball with a correct radius value

Screenshots
Image

Additional context
The issue originates from the following kind of division in max_inscribed_ball.hpp:

 *vec_iter1 = ((*vec_iter4) / (*vec_iter2) - (*vec_iter5)) / (*vec_iter3); 

where *vec_iter2 and *vec_iter3 can become extremely small during iterations, leading to numerical instability.

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