48 : a0_(resolution * LatticeVectors[0]),
49 a1_(resolution * LatticeVectors[1]),
50 a2_(resolution * LatticeVectors[2]),
51 b0_(DualLatticeVectors[0] / resolution),
52 b1_(DualLatticeVectors[1] / resolution),
53 b2_(DualLatticeVectors[2] / resolution),
55 ext_bbox_(compute_extended_bbox(bbox, resolution)),
56 resolution_(resolution) {
58 ext_bbox_vertices << ext_bbox_.min()(0), ext_bbox_.min()(1), ext_bbox_.min()(2),
59 ext_bbox_.max()(0), ext_bbox_.min()(1), ext_bbox_.min()(2), ext_bbox_.min()(0),
60 ext_bbox_.max()(1), ext_bbox_.min()(2), ext_bbox_.min()(0), ext_bbox_.min()(1),
61 ext_bbox_.max()(2), ext_bbox_.min()(0), ext_bbox_.max()(1), ext_bbox_.max()(2),
62 ext_bbox_.max()(0), ext_bbox_.min()(1), ext_bbox_.max()(2), ext_bbox_.max()(0),
63 ext_bbox_.max()(1), ext_bbox_.min()(2), ext_bbox_.max()(0), ext_bbox_.max()(1),
66 cell_vectors cvs(8, 3);
67 for (
auto i = 0; i < 8; i++) {
68 cvs.row(i) = cell_vector_from_point(ext_bbox_vertices.row(i));
72 cv_min = cvs.colwise().minCoeff().array() + 1;
73 cv_max = cvs.colwise().maxCoeff();
79 return cv(0) * a0_ + cv(1) * a1_ + cv(2) * a2_;
83 return {
static_cast<int>(std::floor(p.dot(b0_))),
static_cast<int>(std::floor(p.dot(b1_))),
84 static_cast<int>(std::floor(p.dot(b2_)))};
91 double resolution()
const {
return resolution_; }
102 return {bbox.min() - ext, bbox.max() + ext};
113 const double resolution_;