void createGrid(); void evaluateImplicitFunc(); void getLines(); bool callback_key_down(Viewer& viewer, unsigned char key, int modifiers); Eigen::RowVector3d spatial_min, spatial_max; int spatial_res; std::vector>spatial_index; int spatial_i(int x, int y, int z){ return z+(y*spatial_res)+(x*spatial_res*spatial_res); } void initSpatialIndex(Eigen::RowVector3d min, Eigen::RowVector3d max, int resolution){ spatial_min = min; spatial_max = max; spatial_res = resolution; int rres = 1+resolution; spatial_index = std::vector>(rres*rres*rres, std::vector()); } void registerPoint(Eigen::RowVector3d point, int value){ Eigen::RowVector3d local = (point - spatial_min).array() / (spatial_max - spatial_min).array(); int x = local[0]*spatial_res; int y = local[1]*spatial_res; int z = local[2]*spatial_res; spatial_index[spatial_i(x,y,z)].push_back(value); } std::vector calcPointsInReach(Eigen::RowVector3d point, float radius){ std::vector vec; // Primitive full scan for(int i=P.rows(); i getPointsInReach(Eigen::RowVector3d point, float radius){ std::vector vec; // Use spatial index localised scan Eigen::RowVector3d dim = spatial_max - spatial_min; Eigen::RowVector3d local = (point - spatial_min).array() / dim.array(); int x = local[0]*spatial_res; int y = local[1]*spatial_res; int z = local[2]*spatial_res; int r = ceil(radius / dim.norm() * spatial_res)+1; for(int i=max(0,x-r); i