Input. While our algorithm is generalizable to other configurations, we describe our method for the case when
\(\mathcal {S}\) is embedded in
\({\mathbb {R}^3}\) and
\(\dim (\mathcal {S}) = 1, 2\). Recall that we use the word surface to refer both to “surfaces” with
\(\dim (\mathcal {S})=1\) (curves) as well as
\(\dim (\mathcal {S})=2\) surfaces. We also allow mixed codimension where parts of the surface have
\(\dim (\mathcal {S}) = 1\) and the rest of the surface has
\(\dim (\mathcal {S}) = 2\). We assume that we can query the closest point function
\(\mathrm{cp}_\mathcal {S}(\mathbf {x})\) for
\(\mathbf {x}\in {\mathbb {R}^3}\). Additionally, for surfaces with
\(\dim (\mathcal {S}) = 2\), we assume that we can query the unoriented normal direction of the surface
n(
x) for
\(\mathbf {x}\in \mathcal {S}\). For surfaces with
\(\dim (\mathcal {S}) = 1\), we assume that we can query the tangential direction of the surface
t(
x) for
\(\mathbf {x}\in \mathcal {S}\). These assumptions are valid for common surface representations, including, but not limited to, polygonal meshes, oriented point clouds, and implicit functions. The theory discussed in Section
2.2 is based on the assumption that
\(\mathcal {S}\) is smooth; in practice, we observe that applying our technique on discretized surfaces with sharp features behaves well as we show in Section
5.1. Additionally, we assume the Dirichlet boundaries
\(\mathcal {C}\) have a lower dimension than the dimension of
\(\mathcal {S}\) and support the closest point query
\(\mathrm{cp}_\mathcal {C}\). When solving a two-sided boundary value problem for boundaries with
\(\dim (\mathcal {C})=1\), we also assume that we can query the tangent direction of
\(\mathcal {C}\).
The problem we solve is the embedding PDE
Δu(
x) =
f(
x) +
g(
x) within
\(\mathcal {N}(\mathcal {S})\). The Monte Carlo estimate of Eq.
2 holds by assuming
g(
x) = 0 because the embedding PDE is defined with the Cartesian differential operator. To estimate the surface PDE’s solution at point
\(\mathbf {x}\in \mathcal {S}\), we consider a 3D ball centered at
x and fully contained inside
\(\mathcal {N}(\mathcal {S})\). Theoretically, it should be the largest ball fully contained inside
\(\mathcal {N}(\mathcal {S})\) that does not cross the extended Dirichlet boundaries
\(\mathcal {C}\), to minimize the number of steps needed to reach the boundary. We determine the radius of such a ball by taking the minimum of a conservative (under-)estimate of the local feature size at point
x (Section
3.1) and the distance to the (extended) Dirichlet boundaries (Section
3.2). In Eq.
2, the Monte Carlo estimate of the solution on the sphere,
\(\widehat{u}(\mathbf {y})\), needs to be evaluated at point
y, which does not lie on
\(\mathcal {S}\) in general. The closest point extension constraint of
u provides a convenient relationship here: the embedding PDE’s solution at point
y should coincide with the surface PDE’s solution at the projected point,
\(\mathrm{cp}_\mathcal {S}(\mathbf {y})\). We can therefore project the point
y onto
\(\mathcal {S}\) at the end of each recursion step hence
\(\widehat{u}(\mathbf {y}) = \widehat{u}(\mathrm{cp}_\mathcal {S}(\mathbf {y}))\). After this projection at the end of each step, we continue the recursion. The source term similarly uses the closest point projection for the closest point extension, replacing the recursive relationship of WoS (Eq.
2) with
We choose
p(
zi) ∝ 1/‖
x −
zi‖
2 in our implementation.
Analogous to the original WoS method, we terminate the recursion when the point
x falls within a distance ϵ of the (extended) Dirichlet boundary by taking the boundary value
\(u(\mathrm{cp}_\mathcal {S}(\mathbf {x}))\). We provide pseudocode for an instance of our algorithm in Alg. 1, where we highlight the difference between our proposed method and WoS. We also provide a visualization of a potential path of our algorithm when
\(\mathcal {S}\) is embedded in
\({\mathbb {R}^2}\) in Fig.
2. Notably, PWoS is a generalization of the WoS algorithm: when
\(\dim (\mathcal {S}) = d\) (i.e., the codimension-zero case), the local feature size is infinite, the distance to the Dirichlet boundary
\(\mathcal {C}\) can be computed with the closest point query
\(\mathrm{cp}_\mathcal {C}\), and the last closest point projection of
y has no effect since
\(\mathrm{cp}_\mathcal {S}(\mathbf {y}) = \mathbf {y}\). When
\(\dim (\mathcal {S}) \lt d\), in addition to the closest point projection at the end of each recursion step, our algorithm utilizes two nontrivial steps: the local feature size estimation using a medial axis point cloud and the computation of the distance to the (extended) Dirichlet boundary. We discuss these in the following two subsections.
3.1 Local Feature Size Estimation
To determine the radius of the sphere centered at
\(\mathbf {x}\in \mathcal {S}\) that is fully contained inside
\(\mathcal {N}(\mathcal {S})\) at each recursion step of the walk, we need a conservative lower bound estimate for the local feature size at
x. One naive approach would be to use a small enough positive constant value for all
\(\mathbf {x}\in \mathcal {S}\), similar to the grid-based CPM [Ruuth and Merriman
2008]. This is a valid strategy, but it would often yield a sphere radius smaller than necessary, requiring more recursion steps for the walks to reach a Dirichlet boundary and making the method inefficient. Fig.
3 illustrates a result of our algorithm on a unit sphere using different (artificial) local feature size estimates. The analytical local feature size of this surface is 1 everywhere. Although using any smaller value would still give consistent results, it significantly increases the average step count for the walks. For more complex shapes, one cannot compute the analytical local feature size in general and using a small constant value in its place is inefficient. This issue motivates our need for a better local feature size estimate.
To estimate the local feature size, we compute a point cloud approximation of the medial axis and estimate the local feature size as the distance from any query point
\(\mathbf {x}\in \mathcal {S}\) to its nearest point in the medial axis point cloud. One could use any local feature size estimation algorithm and/or medial axis extraction algorithm (see e.g., [Tagliasacchi et al.
2016]), such as one that outputs or uses the medial axis’ connectivity. Since such methods are often comparatively costly, we employed a simple point cloud-based method, which we describe below.
Medial ball extraction. We first densely scatter points
xi inside a ball in
\({\mathbb {R}^3}\) having a radius equal to half the length of the diagonal of the bounding box of
\(\mathcal {S}\), so the entire surface is fully enclosed. For each point
xi, we use the closest point query
\(\mathrm{cp}_\mathcal {S}(\mathbf {x}_i)\) to compute its two opposing normal directions at
\(\mathrm{cp}_\mathcal {S}(\mathbf {x}_i)\). Specifically, we normalize the vector
\(\mathbf {x}_i-\mathrm{cp}_\mathcal {S}(\mathbf {x}_i)\) to get the first direction and invert its direction to get the second one. We then use the method of Ma et al. [
2012] to extract a point cloud that represents the medial axis, as follows. For each side of the surface (i.e., each normal), we start with a large sphere tangent to
\(\mathrm{cp}_\mathcal {S}(\mathbf {x}_i)\), whose center necessarily lies on the normal ray. The initial radius of the ball is set to the length of the diagonal of the bounding box of
\(\mathcal {S}\). Then, we iteratively shrink the size of the sphere, moving its center to maintain tangency at the surface point
\(\mathrm{cp}_\mathcal {S}(\mathbf {x}_i)\), until the closest surface point from the center of the sphere does not change. This algorithm gives
medial balls, i.e., balls with their centers on the medial axis. As the number of initial scattered points increases, the extracted point cloud balls tend to cover the entire medial axis. While Ma et al. [
2012] assumed that the surface is represented as an oriented point cloud, we observed that the algorithm works well with other surface representations by adjusting its termination criteria. See the paper by Ma et al. [
2012] and our implementation for details.
Scale axis pruning. Directly using the medial ball centers as the medial axis point cloud does not work well in general when
\(\mathcal {S}\) contains any noise or artificial sharp corners introduced by the discretization of a smooth surface. We therefore prefer to estimate (only) the
stable part of the medial axis, which is not affected by any small perturbation of
\(\mathcal {S}\). A common solution is, therefore, to
prune unstable components of the medial axis, which itself remains an active research topic [Tagliasacchi et al.
2016]. We take inspiration from the scale axis transform (SAT) [Giesen et al.
2009; Miklos et al.
2010], but design an alternative since SAT considers topology information of the medial axis, which is unnecessary for local feature size estimation. Our alternative is simpler and faster since topology information is omitted. We first scale all the medial balls by a constant factor
s > 1. Then, for any pair of medial balls
\(B_{r_1}(\mathbf {x}_1)\) and
\(B_{r_2}(\mathbf {x}_2)\), we remove the smaller ball from the set of medial balls if it is fully contained in the other. That is, if
s ·
r1 <
s ·
r2 + ‖
x1 −
x2‖
2, we remove the ball
\(B_{r_1}(\mathbf {x}_1)\).
Note that some of the medial balls may have a very large radius before pruning. For example, an exterior medial ball for a surface of a convex shape would have an infinite radius in theory (but our algorithm returns at most the length of the diagonal of the bounding box of
\(\mathcal {S}\)). When such large medial balls are used in our pruning algorithm, they can easily (and undesirably) remove important, stable parts of the medial axis. The original SAT approach was applied only to the interior medial axis of closed surfaces. Therefore, this issue was not observed since the interior medial ball radii are always bounded and proportional to the size of local features of
\(\mathcal {S}\). To address this problem, we consider each pair of tangent balls generated at the same surface point, and replace the larger one with a tangent ball having the radius of the smaller one. In other words, before we prune the medial axis, we shift the medial ball centers of the larger medial ball in the pair and shrink its radius. In Fig.
2, we visualize the medial ball centers after this shifting operation.
After this pruning, the set of medial ball centers gives the medial axis point cloud we use to estimate the local feature size. Adjusting the scaling parameter s allows us to control the pruning strength. Unless otherwise stated, we use the value s = 1.15 for our results.
Conservative and nonzero local feature size. As the medial axis is represented as a point cloud and the nearest point distance may give a larger value than the actual local feature size, we multiply by a small constant (0.9 in our implementation) to ensure a conservative estimate of the local feature size. When there are sharp corners in the geometry, the analytical local feature size is zero, and the walk will become stuck. To prevent this problem, when the estimated local feature size is smaller than a positive constant threshold
λ, we return
λ as the local feature size estimate instead. This process essentially rounds sharp corners with rounding radius
λ. The uniform grid size adopted in grid-based CPM has a similar effect. We do not observe any significant error due to this rounding, as we show in Section
5.1.
3.2 Distance to Extended Dirichlet Boundaries
Dirichlet boundaries
\(\mathcal {C}\) are extended in the normal direction of
\(\mathcal {S}\) and the solution in the embedding space on this extended boundary is determined by the closest point extension of Dirichlet values on
\(\mathcal {C}\). Therefore, we need to compute the minimum distance to the extended Dirichlet boundaries, and limit the sphere radius in PWoS further if it is less than the local feature size. To determine the distance to the extended Dirichlet boundary from point
\(\mathbf {x}\in \mathcal {S}\), we first find the closest point that lies on the boundary before the extension,
\(\mathrm{cp}_\mathcal {C}(\mathbf {x})\). The subset of the extended boundary that is extended from
\(\mathrm{cp}_\mathcal {C}(\mathbf {x})\) takes the shape of a line segment when
\(\dim (\mathcal {S})=2\) and a disk when
\(\dim (\mathcal {S})=1\). We set the line segment’s half-length or the disk radius to the local feature size at
\(\mathrm{cp}_\mathcal {C}(\mathbf {x})\) using the algorithm in Section
3.1. We can compute the distance from the point
\(\mathbf {x}\in \mathcal {S}\) to this line segment or disk without explicitly constructing the extended boundary geometry. When
\(\dim (\mathcal {S})=2\), the distance
δ to the extended boundary is given by
where
n and
l are the surface normal and the local feature size estimate at
\(\mathrm{cp}_\mathcal {C}(\mathbf {x})\), respectively. When
\(\dim (\mathcal {S})=1\), the normal direction is not uniquely defined, so we instead use a similar method based on the surface tangent
t: