AlignedBox Volume/Empty Test Disagree
Submitted by Christopher J. Hanks
Assigned to Nobody
Link to original bugzilla bug (#999)
Version: 3.3 (current stable)
Description
In an AlignedBox<double 3> structure, two boxes can be fashioned such that their intersection yields a new box with (::volume() > 0) that (::isEmpty() == true).
#include <iostream>
#include <Eigen/Eigen>
int
main()
{
Eigen::AlignedBox<double, 3> b0(
Eigen::Vector3d(-1, -1, -1),
Eigen::Vector3d( 0, 0, 0));
Eigen::AlignedBox<double, 3> b1(
Eigen::Vector3d(-1, 2, 2),
Eigen::Vector3d( 0, 0, 0));
std::cerr << std::boolalpha
<< (b1.intersection(b0)).volume() << "\n"
<< (b1.intersection(b0)).isEmpty() << "\n";
// Prints out:
// 4
// true
return 0;
}
Edited by Eigen Bugzilla