Link Search Menu Expand Document

Sample Nearest Points

Sample points within a spherical range

The Sample Nearest Points node explore points within a range using various methods. Define sampling range, weight targets, and obtain useful attributes.


In
Points that will sample data from targets
Targets
Target points to read data from
Out
In with extra attributes and properties

Table of content


Properties


Each output property is written individually for each point.

Property Description
Sampling
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.

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.

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.
Outputs
Success Attribute Name Writes a boolean attribute to each point specifying whether the sampling has been successful (true) or not (false).
Location Attribute Name Writes the sampled location, as an FVector.
Look at Attribute Name Writes the direction from the point to the sampled location, as an FVector.
Normal Attribute Name Writes the normal of the point at the sampled location, as an FVector.
Normal Source Which direction to use as an Up vector for the Normal cross-product maths.
Distance Attribute Name Writes the distance between the point and the sampled location, as a double.
Signed Distance Attribute Name Writes the signed distance between the point and the sampled location, as a double.
Signed Distance Axis Which axis to use to determine whether the distance is positive or negative (toward/away).
Currently based on point Transform, this will likely change in the future to an attribute selector.
Angle Attribute Name Writes the angle between the point and the sampled location, as a double.
Angle Axis Which axis to use to determine the angle sign/range (toward/away)
Angle Range The output range for the Angle value.

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

Sampling Methods

Method Description
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.
Target Extents Reverse the sampling mechanisms so points will sample the targets which Extents contains them.
At the time of writing, will only check targets which position in world space is within range.
It is recommend to use a max range of 0 with this method.

Weighting


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.

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.


Weighting

docs/relax/range.png

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.