14 namespace signed_distance_field {
25 assert(data.cols() >= 2);
27 const Eigen::Index m{data.cols()};
28 const float resInv{1.0F / resolution};
29 const float doubleResInv{1.0F / (2.0F * resolution)};
32 centralDifference.col(0) = resInv * (data.col(1) - data.col(0));
35 for (Eigen::Index i = 1; i + 1 < m; ++i) {
36 centralDifference.col(i) = doubleResInv * (data.col(i + 1) - data.col(i - 1));
40 centralDifference.col(m - 1) = resInv * (data.col(m - 1) - data.col(m - 2));
48 const float resInv{1.0F / resolution};
49 result = resInv * (data_kp1 - data_k);
57 const float doubleResInv{1.0F / (2.0F * resolution)};
58 result = doubleResInv * (data_kp1 - data_km1);
void columnwiseCentralDifference(const Matrix &data, Matrix ¢ralDifference, float resolution)
void layerCentralDifference(const Matrix &data_km1, const Matrix &data_kp1, Matrix &result, float resolution)
void layerFiniteDifference(const Matrix &data_k, const Matrix &data_kp1, Matrix &result, float resolution)