Link Search Menu Expand Document

Sample Nearest Points

PCGEx | Sample : Nearest Point

Sample points within a spherical range

The Sample Nearest Points node extracts and blends data from nearby target points within a customizable range, allowing you to fine-tune sampling methods, apply filters, and compute weighted outputs, making it ideal for tasks like proximity-based data collection.


In
Points that will sample data from targets
Point Filters
Points filters used to determine which points will be processed. Filtered out points will be treated as failed sampling.
Targets
Target points to read data from
Out
In with extra attributes and properties

Table of content


The Sample Nearest Point grabs and blends attributes & properties from a target dataset, as well as other spatial relationship outputs.

details/sampling-nearest-point/lead.png

Sampling


Property Description
Settings
Sample Method Selects the sampling method. See Sampling Methods.
Range Min Minimum sampling range.
Range Max Maximum sampling range.
Use 0 to sample all targets.
Local Range Min If enabled, uses a per-point double attribute value as minimum sampling range.
Local Range Max If enabled, uses a per-point double attribute value as maximum sampling range.

Points that are not within range are ignored. If no point is found within the specified range, the sampling for that point will be marked as Usuccessful.


Distance Details
Source TBD
Target TBD
Weighting
Weight Method Selects the method used to compute the weight of each target.
See Weighting.
Weight Over Distance Curve used to sample the final weight of each target.

Sampling Methods


Method Description
All (Within Range) Samples all points within the specified range.
Closest Target Sample the single closest target within the specified range.
Farthest Target Sample the single farthest target within the specified range.

Weighting


details/sampling-nearest-point/weighting.png

There is two weighting method available. Full Range and Effective Range. Each method outputs a [0..1] value that will be used to sample the Weight Over Distance curve.
However, there is a critical nuance between the two:

  • Full Range is a simple normalization, each target distance is divided by the longest one. As such, it’s very unlikely the curve will get sampled close to x=0.
  • Effective Range remaps each target distance using the shortest & longest distance as min/max. As such, the shortest sampled distance will sample the curve at x=0, and the longest at x=1.

Note that the Effective Range method tends to spread/scale the input set of values – but allows one to leverage the full range of the curve no matter the min/max input values.
Hence, using Full Range with only high (or low) input value will only sample a very narrow portion of the curve.

Important note: when using the Within range sample method, some outputs will use the final weighted position/transforms for their calculations; although mathematically correct, this may yield unusuable/innacurate results.


Blending


Properties Description
Target Attributes A Name::Blendmode map of the attributes to grab from the target points, and which blendmode to use.
Point Propeprties Blending Settings If enabled, lets you pick & choose which point properties you want to grab from the targets, and which blendmode to use.
Use None to prevent a specific property from being grabbed.

See Blending.


Outputs

Outputs are values extracted from the neighbor(s), and written to attributes on the output points.

Output Description
Generic
Success
bool
TBD
Spatial Data
Transform
FTransform
TBD
Look At
FVector
TBD
└─ Align TBD
└─ Use Up from… TBD
└─ Up Vector TBD
Distance
double
TBD
Signed Distance
double
TBD
└─ Axis TBD
Angle
double
TBD
└─ Axis TBD
└─ Range TBD
Num Samples
int32
TBD

Based on the selected Sample method, the output values are a weighted average of all the sampled targets. See Weighting.


Tagging

Some high level tags may be applied to the data based on overal sampling.

Tag Description
Has Successes Tag If enabled, add the specified tag to the output data if at least a single target has been sampled.
Has No Successes Tag If enabled, add the specified tag to the output data if no target has been sampled.

Note that fail/success tagging will be affected by points filter as well; since filtered out points are considered fails.


Advanced


Property Description
Process Filtered Out As Fails If enabled, mark filtered out points as “failed”. Otherwise, just skip the processing altogether.
Only uncheck this if you want to ensure existing attribute values are preserved.
Default is set to true, as it should be on a first-pass sampling.