10.105. Point Sample Triangle Geometry

Group (Subgroup)

Sampling (Geometry)

Description

This Filter randomly samples point locations on the triangles of a Triangle Geometry (a node-based surface mesh of triangular faces) and uses those sampled locations to construct a new Vertex Geometry (a point cloud). The total number of sample points is supplied directly through the Number of Sample Points parameter.

To ensure an even sampling across the whole surface area of the Triangle Geometry, the average number of points placed on each triangle is made proportional to that triangle’s area. Larger triangles therefore receive proportionally more samples than smaller ones, which produces a spatially uniform point density rather than an even count per triangle.

Within a given triangle, each point is chosen with the following formula:

Equation: the sampled point P equals (1 minus the square root of r1) times A, plus the square root of r1 times (1 minus r2) times B, plus the square root of r1 times r2 times C.

where the sampled point coordinates P are the coordinates of the sampled point; vertex A, vertex B, and vertex C are the coordinates of the vertices belonging to the triangle; and random number r1 and random number r2 are random real numbers on the interval the interval from zero to one. This approach gives uniform sampling within the triangle area and works correctly regardless of the dimensionality of the embedding space (whether the triangle lies in a plane or is embedded in 3D).

Random Sampling and Reproducibility

The point placement is random: both the distribution of samples across triangles and the location of each point within its triangle are drawn from a pseudo-random number generator. By default a new seed is used each run, so the output point cloud differs from run to run. To obtain repeatable results, enable Use Seed for Random Generation and supply a fixed Seed Value; the seed actually used is also stored in an output array so a run can be reproduced later.

Masking and Transferred Data

The user may opt to use a mask (a boolean per-face flag) to prevent certain triangles from being sampled; where the mask is false, the triangle is not sampled. Additionally, the user may choose any number of Face Attribute Arrays to transfer to the created Vertex Geometry. Each vertex in the new geometry inherits the values of the face from which it was sampled.

Required Input Sources

Input Parameter(s)

Parameter Name

Parameter Type

Parameter Notes

Description

Number of Sample Points

Scalar Value

Int32

The number of sample points to use

Optional Data Mask

Parameter Name

Parameter Type

Parameter Notes

Description

Use Mask Array

Bool

Specifies whether or not to use a mask array

Mask Array

Array Selection

Allowed Types: uint8, boolean Comp. Shape: 1

DataPath to the boolean mask array. Values that are true will mark that cell/point as usable.

Random Number Seed Parameters

Parameter Name

Parameter Type

Parameter Notes

Description

Use Seed for Random Generation

Bool

When true the user will be able to put in a seed for random generation

Seed Value

Scalar Value

UInt64

The seed fed into the random generator

Stored Seed Value Array Name

DataObjectName

Name of array holding the seed value

Input Triangle Geometry

Parameter Name

Parameter Type

Parameter Notes

Description

Triangle Geometry to Sample

Geometry Selection

Triangle

The complete path to the triangle Geometry from which to sample

Input Triangle Face Data

Parameter Name

Parameter Type

Parameter Notes

Description

Face Areas

Array Selection

Allowed Types: float64 Comp. Shape: 1

The complete path to the array specifying the area of each Face

Face Attribute Arrays to Transfer

MultiArraySelection

The paths to the Face Attribute Arrays to transfer to the created Vertex Geometry where the mask is false, if Use Mask is checked

Output Vertex Geometry

Parameter Name

Parameter Type

Parameter Notes

Description

Vertex Geometry Name

DataGroupCreation

The complete path to the DataGroup holding the Vertex Geometry that represents the sampling points

Output Vertex Attribute Matrix

Parameter Name

Parameter Type

Parameter Notes

Description

Vertex Data

DataObjectName

The complete path to the vertex data arrays for the Vertex Geometry

DREAM3D-NX Help

If you need help, need to file a bug report or want to request a new feature, please head over to the DREAM3DNX-Issues GitHub site where the community of DREAM3D-NX users can help answer your questions.