1. Creating a point cloud

Loading point cloud from a .txt file

Generating a point cloud

2. Kernel definitions

We define several kernel profiles. The standard kernel, of derivative standardPrime, corresponds to $$ \rho(t) = \exp \left(\frac{-1}{1-t^2}\right) \quad \text{et} \quad \rho^\prime(t) = \frac{-2t}{(1-t^2)^2} \exp \left(\frac{-1}{1-t^2}\right) \: . $$

To each kernel $\rho$, we associate its kernelPair $\xi$ satisfying $n \xi(t) = - t \rho^\prime(t)$. For instance, the standardPair kernel is $$ \xi(t) = \frac{2}{n} \frac{t^2}{(1-t^2)^2} \exp \left(\frac{-1}{1-t^2}\right) \: . $$

3. Mass computation

The method computeMassKnn attributes relative weights $m_i$ for $i = 1 \ldots N$ in order to rectify potential bias in the sampling: masses should be small in areas where points are concentrated.

More precisely, we assume that the given set of points $\{ x_i \}_i$ is close to some surface (and more generally $d$-submanifold or $d$-rectifiable set) and we want to define masses $m_i$ for $i = 1 \ldots N$ so that the Radon measures $\displaystyle \mu_N = \sum_{i = 1}^N m_i \delta_{x_i}$ and $\mathcal{H}^d_{| M}$ are close, where $\mathcal{H}^d$ denotes the $d$-dimensional Hausdorff measure in $\mathbb{R}^n$. Let $\eta_r$ be a compactly supported radial kernel, i.e. given $\eta : \mathbb{R} \rightarrow \mathbb{R}_+$ even and compactly supported in $[-1,1]$, define for $r>0$ and $x \in \mathbb{R}^n$, $\eta_r(x) := \eta (|x|/r)$. A natural choice is then to consider

$$ m_i = C_\eta \frac{r^d}{\displaystyle \sum_{j=1}^N \eta \left(\frac{|x_i - x_j|}{r} \right)} = \frac{\displaystyle\mathcal{H}^d_{| T_{x_i} M} \ast \eta_r(x_i)}{\mu_N \ast \eta_r(x_i) } \simeq_{r \to 0} \frac{\displaystyle\mathcal{H}^d_{| M} \ast \eta_r(x_i)}{\mu_N \ast \eta_r(x_i) } $$

where $C_\eta > 0$ is the integral over any $d$-vector subspace $P \subset \mathbb{R}^n$ of $x \mapsto \eta(|x|)$ (since $\eta$ is radial): $$ C_\eta = \int_P \eta (|x|) \: d \mathcal{H}^d(x) = d \omega_d \int_0^1 \eta(r) r^{d-1} \: dr \quad \text{and} \quad \omega_d \text{ is the Lebesgue measure of the unit ball of } \mathbb{R}^d \: . $$ Constant $C_\eta$ can however be dropped when computing relative weights of points since it is uniform in the whole point cloud.

We can either choose the number $k_M$ of neighbours and infer the radius $r>0$ of the neighbouring ball to be considered (Knn) or choose the radius $r>0$ of the neighbouring ball (not implemented yet) and infer $k_M$.

Up to now, we implemented the following expression: $$ m_i = \frac{r^d}{k_M} $$ corresponding to $\eta = \chi_{[-1,1]}$ and thus $C_\eta = \omega_d$ has been dropped in the implementation (for $d = 2$, $\omega_d = \pi$ for instance).

Example of mass visualisation

4. Regression

The method regressionKnn and regressionRadius perform a local covariance analysis, weighted with kernel, hereafter denoted by $\omega$, so as to define the tangent at each point of the point cloud varifold. We can either choose the number $k_T$ of neighbours and infer the radius $r>0$ of the neighbouring ball to be considered (Knn) or choose the radius $r >$ of the neighbouring ball (Radius) and infer $k_T$. Given a point $x_{i_0}$ in the cloud, we compute the matrix $$ \frac{1}{k_T} \sum_{j = 1}^N m_j \omega \left( \frac{|x_j - x_{i_0} |}{r} \right) \underbrace{(x_j - x_{i_0})^T (x_j - x_{i_0})}_{n \times n \text{ rank } 1 \text{ matrix}} \: . $$ While the sum is over the whole set of points, the kernel has support $r>0$ and the sum is over $k_T$ terms. Depending on the option massWeights, $m_j$ is the local mass stored in the attribute mass or all $m_j$ are set to $1$.

5. Computation of second fundamental form

Example of gaussian and mean curvature visualisation