Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Sampling > API/Runtime/GeometryCore/Sampling/FMeshSurfacePointSampling
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/Sampling/MeshSurfacePointSampling.h |
| Include | #include "Sampling/MeshSurfacePointSampling.h" |
| Source | /Engine/Source/Runtime/GeometryCore/Private/Sampling/MeshSurfacePointSampling.cpp |
void ComputePoissonSampling
(
const FDynamicMesh3 & Mesh,
FProgressCancel * Progress
)
Remarks
Compute an approximate Poisson sampling of the mesh, either uniform or non-uniform depending on the settings above. The sampling will attempt to fully cover the mesh unless .MaxSamples is provided, in which case exactly that many samples will be generated and they will be randomly distributed (so not at all Poisson...!)
By default the sampling will be uniform - all points will be spaced at least .SampleRadius*2, ie no "collisions" between their bounding spheres.
If .MaxSampleRadius is larger than .SampleRadius, the sampling will be non-uniform, ie samples will be emitted with radii within this range. By default a random uniform distribution of radii will be attempted, .SizeDistribution and related parameters can be used to make this distribution non-uniform. The spacing between points will always be greater than the sum of their two sample radii, so again no collisions. However the "density" of the sampling will vary depending on how well the algorithm can find gaps to fill.
If .bUseVertexWeights is defined and valid VertexWeights are provided, they will be used to modulate the sampling radii. The .InterpretWeightMode setting controls how the weights are used to influence the sample radii.
The strategy used is to compute a much higher density sampling than needed (based on .SubSampleDensity), then iteratively select from that point set and decimate it within the radius of selected samples. The implementation also introduces various biases to increase performance. Generally increasing SubSampleDensity will result in more tightly-packed results, but at increasingly expensive computation time.