Boundary-Aware Poisson Disk Sampling

Implemented class: InteriorSampler2DBoundaryAware  |  Method key: "poisson_disk_boundary_aware"

1. Motivation: The Boundary Layer Problem

The standard two-pass approach (boundary nodes from SurfaceSampler2D, then interior nodes from InteriorSampler2D) generates boundary and interior nodes independently. As a consequence, the minimum distance guarantee d ≥ h is enforced only within each set, not between them. Near the boundary, interior nodes may accidentally come closer than h to boundary nodes.

This is problematic for the MLPG method because:

The Boundary-Aware Poisson Disk algorithm solves this problem by generating boundary and interior nodes in a single unified pass, ensuring the minimum distance h is respected globally — between any pair of nodes, regardless of their classification.

2. Algorithm

The algorithm has three phases:

Phase 1: Boundary node generation

Boundary nodes are placed exactly as in SurfaceSampler2D: at uniform arc-length spacing h along the face edges, with outward in-plane normals computed from the edge tangent and face normal. See Boundary Sampling for full details.

For faces with inner holes, the OCC boundary node validation filter (filter_boundary_pts_occ) is applied after arc-length sampling to remove any node that sits on a topologically valid but geometrically spurious arc segment — for example, an arc of a hole edge that extends outside the outer boundary. The filter probes each node on both sides of its outward normal using BRepClass_FaceClassifier and keeps only nodes where exactly one side is inside the material. See Boundary Sampling §4 for the full description.

Phase 2: Grid pre-loading (boundary as obstacles)

The boundary nodes are loaded into the Bridson background grid as obstacles. Each boundary node bi occupies the corresponding grid cell and prevents any interior candidate from being accepted within distance h from it. Crucially, boundary nodes are not added to the active list — they block interior nodes but do not generate new candidates.

Phase 3: Interior node generation (standard Bridson)

The standard Bridson algorithm runs with the grid already populated by boundary obstacles. The initial seed is chosen uniformly inside the domain (away from the boundary). New interior nodes are accepted only if they are at distance ≥ h from all existing nodes (both interior and boundary obstacles). The domain containment test (ray casting) is applied to each candidate.

The result is a single cloud containing both boundary and interior nodes, all separated by at least h. The is_boundary flag correctly marks each node's classification.

2.1 Comparison with Standard Poisson Disk

Property poisson_disk poisson_disk_boundary_aware
Boundary nodes exactly on edges ✓ ✓
Interior-interior distance ≥ h ✓ ✓
Boundary-interior distance ≥ h ✗ (not guaranteed) ✓
Generation passes 2 (independent) 1 (unified)
Interior node count Higher (ignores boundary proximity) Lower near boundary (buffer zone)

3. Implementation Details

4. Parameters

5. When to Use

Use "poisson_disk_boundary_aware" when accurate enforcement of boundary conditions is critical and when you observe numerical instabilities near the boundary with the standard "poisson_disk" method. It is the recommended default for problems with significant boundary stress gradients (e.g., notch analyses, contact zones).

6. References