Point Cloud Generation

1. Concept and Role in Meshfree Analysis

In classical Finite Element Analysis (FEA), the domain is discretized into a mesh of elements defined by their connectivity. In meshfree methods — and in particular in the Meshless Local Petrov-Galerkin (MLPG) method implemented in GearMaster — the domain is represented exclusively by a cloud of nodes. No element connectivity is required. The governing equations are integrated locally at each node over small local subdomains (e.g., circular or rectangular control volumes), and the approximation of field variables is constructed using Moving Least Squares (MLS) basis functions over a compact support domain.

The quality of the analysis is therefore strongly affected by the spatial distribution of nodes. A good point cloud must satisfy the following requirements:

Note for students: Think of the point cloud as a kind of flexible "mesh" where you keep only the nodes and throw away all the triangles or tetrahedra. The meshfree solver will reconstruct local approximations on-the-fly at each node, without ever needing to know which nodes are "connected".

2. Generation Workflow

The generation process is orchestrated by the PointCloudGenerator class. The workflow is the following:

  1. The CAD geometry is loaded as an OpenCASCADE BRep (Boundary Representation) model, via the GearMaster CAD module.
  2. The generator iterates over all active leaf entities of the model (i.e., the geometric bodies that are actually used in the analysis).
  3. For each entity, the generator detects its dimensionality (currently 2D planar faces are fully implemented; 3D solids are reserved for future work).
  4. A pair of samplers is dispatched: one for boundary nodes (placed along the edges of the face) and one for interior nodes (placed inside the face). Some strategies unify boundary and interior generation in a single pass.
  5. All sub-clouds from individual entities are merged into a single GM_PointCloud object.
  6. The exact domain polygon is extracted from the CAD geometry and attached to the cloud, for use by the MLPG solver during Voronoi cell clipping.

3. Characteristic Spacing h

The parameter h (in model units, typically mm) is the single most important control parameter. It represents the target average distance between neighbouring nodes. A smaller h yields a denser, more accurate (but more expensive) point cloud. A larger h gives a coarser, faster analysis.

The choice of h should be guided by the expected stress gradients in the problem. For uniform stress fields, a coarse cloud is sufficient; near stress concentrations (e.g., notches, welds), a finer spacing is required. As a general rule, h should be at least 5–10 times smaller than the smallest geometrical feature of interest.

4. Available Sampling Strategies

Five interior sampling strategies are implemented, selectable via the interior_method parameter of PointCloudGenerator. Boundary nodes are always sampled at uniform arc-length spacing along the face edges, except for the Delaunay method (which handles boundary and interior together via gmsh). The table below summarises the available methods:

interior_method Boundary sampler Interior sampler Recommended for
poisson_disk (default) SurfaceSampler2D InteriorSampler2D (Bridson) General use; irregular domains
poisson_disk_relaxed SurfaceSampler2D InteriorSampler2D + Lloyd relaxation Improved uniformity; higher quality
poisson_disk_boundary_aware InteriorSampler2DBoundaryAware (unified) Consistent boundary-to-interior spacing
regular_grid UnifiedSampler2DRegular (unified) MLPG5-rect (CV ≈ 0); structured domains
delaunay DelaunaySampler2D via gmsh (unified) Highest quality; near-uniform triangulated sets

5. Multi-Face Shell Geometry Support

For 3D shell models composed of multiple planar faces (e.g., lattice cubes, folded plates, structural sections), the generator processes each face independently and then merges all sub-clouds into a single GM_PointCloud. Two additional pipeline stages handle the cross-face interactions that arise after merging.

5.1 Per-Face Lloyd Relaxation with Geometry Constraint

When using interior_method="poisson_disk_relaxed", the Lloyd relaxation is applied after merging the surface and interior sub-clouds for a single entity. To prevent nodes from being displaced across face boundaries during relaxation, the entity object is passed to lloyd_relax(), which activates the in-loop geometry containment constraint described in the Lloyd Relaxation page (Section 4.1). This constraint is generic and works for any planar face shape.

5.2 Global Thinning (_thin_global)

After per-face generation and relaxation, the merged cloud from a multi-face entity may contain pairs of interior nodes from adjacent faces that are closer than the minimum allowed spacing. A global thinning pass (_thin_global) is applied to enforce the minimum spacing constraint across the whole entity.

The thinning algorithm is a greedy independent-set selection: nodes are visited in random order (fixed seed for reproducibility), and each node is accepted only if no previously accepted interior node lies within the exclusion radius d_\text{min} = 0.6\,h:

Key design decision — boundary nodes excluded from exclusion centres: Boundary nodes (lying on face edges and hole perimeters) are always kept and are never used as exclusion centres. Only interior-to-interior distances are checked. This is critical: boundary nodes are placed at spacing ≈ h along edges, and including them as exclusion centres would cause the thinning to reject virtually all interior nodes within one spacing of any boundary — i.e., almost the entire interior of thin faces or small faces.

The practical effect: after thinning, the minimum nearest-neighbour distance between interior nodes is guaranteed to be at least 0.6\,h, while boundary nodes remain untouched regardless of their proximity to interior nodes.

6. Local Refinement Workflow (Sphere Features)

After the base cloud is generated, GearMaster can apply local spherical refinements per entity. This is useful near notches, holes, and load introduction zones where higher nodal density is needed.

Engineering practice: start with one coarse global spacing h, then add a small number of local refinement spheres only where result gradients require it.

7. Algorithm Detail Pages

Each algorithm is documented in depth in a dedicated page:

8. General References