Boundary Sampling: Uniform Arc-Length Spacing

Implemented class: SurfaceSampler2D

1. Role in Meshfree Analysis

Boundary nodes serve a dual purpose in meshfree structural analysis:

In the MLPG method, boundary conditions are not enforced in the same way as in FEM. Dirichlet conditions are typically imposed by direct substitution or by a penalty/Lagrange multiplier approach applied at boundary nodes; Neumann conditions enter the weak form as surface integrals over the boundary of the local subdomain that overlaps with the global boundary. In both cases, having boundary nodes precisely on the geometric edges — with correct normals — is essential.

2. Mathematical Formulation

The boundary of a planar face is a closed polygon consisting of one or more edges (wires). Each edge is a parametric curve C(u), where u ∈ [u0, u1] is the curve parameter.

The arc-length along the edge is defined as:

s(u) = ∫u0u |C'(t)| dt

The total arc-length of the edge is L = s(u1). The algorithm places nodes at positions ui such that:

s(ui) = i · h,    i = 0, 1, 2, …, ⌊L/h⌋

where h is the characteristic node spacing. This guarantees that consecutive boundary nodes are separated by exactly h along the curve, regardless of the curve's parametrization (linear, arc, spline, etc.).

2.1 Outward Normal Computation

At each boundary node placed at parameter ui, the outward in-plane normal is computed as:

  1. Evaluate the first derivative of the edge curve: T = C'(ui) (edge tangent).
  2. Account for edge orientation: if the edge is traversed in the REVERSED direction with respect to the face outer wire, negate the tangent.
  3. Normalize: T̂ = T / |T|.
  4. Compute the outward normal as the cross product of the tangent and the face normal: n = T̂ × Nface.
  5. Normalize: n̂ = n / |n|.

This construction guarantees that n̂ lies in the plane of the face (perpendicular to Nface) and points outward from the domain interior for a counter-clockwise (CCW) wound outer wire.

3. Implementation Details

The sampling is performed using the OpenCASCADE (OCC) library:

Note: The SurfaceSampler2D generates only boundary nodes (is_boundary = True). Interior nodes are generated separately by a dedicated interior sampler and then merged with the boundary cloud by the PointCloudGenerator.

4. OCC Boundary Node Validation Filter

For faces with inner holes (e.g. perforated plates), the OCC topology contains one outer wire and one inner wire for each hole. The arc-length sampler walks all wires, including hole edges. However, in complex geometries, the topological arc of a hole edge may extend geometrically beyond the outer boundary — or an outer-wire segment may pass through a hole — producing nodes that are topologically on a wire but materially invalid.

To remove these spurious nodes, a post-sampling filter filter_boundary_pts_occ() is applied whenever the face has more than one wire (outer + at least one hole). The filter uses the OpenCASCADE BRepClass_FaceClassifier to validate each node by probing the material state on both sides of the stored outward normal:

  1. For each boundary node at position p with stored outward normal n̂, compute two probe points:
    p+ = p + ε n̂,    p− = p − ε n̂
    where ε = \max(0.1h,\, 10^{-3}).
  2. Each probe point is projected onto the surface UV space via ShapeAnalysis_Surface.ValueOfUV() and classified with BRepClass_FaceClassifier.
  3. A node is kept if exactly one probe point is classified as TopAbs_IN (inside the material). This is the expected condition for a genuine material-void interface node.
  4. A node is rejected if both probe points are TopAbs_OUT, which indicates that the node sits on a wire arc segment that has no material on either side — i.e. a geometrically invalid position.
Why probe both sides? The winding convention for hole-wire outward normals can vary across CAD models, so the stored n̂ might point either toward or away from the material. Probing both p+ and p− makes the filter robust regardless of normal orientation.

5. Parameters

6. References