I'm trying to use Eigen AlignedBox. Specifically, I'm trying to cast a box of double into an int one, by using AlignedBox::cast
AlignedBox<double, 2> aabbox2d = AlignedBox<double, 2>(Vector2d(0.52342, 2.12315), Vector2d(3.87346, 4.72525));
aabbox2d.cast<AlignedBox<int, 2>>();
auto minx = aabbox2d.min().x();
Anyway, when the execution gets to min() I get an assert:
Assertion failed: (((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime==Dynamic || size<=MaxSizeAtCompileTime)) || SizeAtCompileTime == size) && size>=0), function resize, file /Users/max/Developer/Stage/Workspace/AutoTools3D/dep/libigl/external/eigen/Eigen/src/Core/PlainObjectBase.h, line 312.
Note that this is different from casting a matrix scalar to another one. An object is implied. Supposedly I'm not doing the cast correctly. Does someone know the right way? Thank you