```{index} single: Filters; Sample Triangle Geometry on Uncertain Regular Grid
```
# Sample Triangle Geometry on Uncertain Regular Grid

## Group (Subgroup)

Sampling (Resolution)

## Description

This **Filter** "samples" a triangulated surface mesh on a rectilinear grid, but with "uncertainty" in the absolute position of the **Cells**.  The "uncertainty" is meant to simulate the possible positioning error in a sampling probe.  The user can specify the number of **Cells** along the X, Y, and Z directions in addition to the resolution in each direction and origin to define a rectilinear grid.  The sampling, with "uncertainty", is then performed by the following steps:

1. Determine the bounding box and **Triangle** list of each **Feature** by scanning all **Triangles** and noting the **Features** on either side of the **Triangle**
2. For each **Cell** in the rectilinear grid, perturb the location of the **Cell** by generating a three random numbers between [-1, 1] and multiplying them by the three uncertainty values (one for each direction)
3. For each perturbed **Cell** in the rectilinear grid, determine which bounding box(es) they fall in (*Note:* the bounding box of multiple **Features** can overlap)
4. For each bounding box a **Cell** falls in, check against that **Feature's** **Triangle** list to determine if the **Cell** falls within that n-sided polyhedra. (*Note:* if the surface mesh is conformal, then each **Cell** will only belong to one **Feature**, but if not, the last **Feature** the **Cell** is found to fall inside of will *own* the **Cell**)
5. Assign the **Feature** number that the **Cell** falls within to the *Feature Ids* array in the new rectilinear grid geometry

**Note that the unperturbed grid is where the *Feature Ids* actually live, but the perturbed locations are where the Cells are sampled from.  Essentially, the *Feature Ids* are stored where the user *thinks* the sampling took place, not where it actually took place!**


### 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 Parameter(s)

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Number of Cells per Axis | Vector of UInt64 Values | Order=X Points,Y Points,Z Points | The dimensions of the created Image geometry |
| Origin | Vector of Float32 Values | Order=x,y,z | The origin of the created Image geometry |
| Spacing | Vector of Float32 Values | Order=x,y,z | The spacing of the created Image geometry |
| Uncertainty | Vector of Float32 Values | Order=x,y,z | uncertainty values associated with X, Y and Z positions of Cells |

### Input Data Objects

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Triangle Geometry | Geometry Selection | Triangle | The geometry to be sampled onto grid |
| Face Labels | Array Selection | Allowed Types: int32 Comp. Shape: 2 | Array specifying which Features are on either side of each Face |

### Output Image Geometry

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Image Geometry | DataGroupCreation |  | The name and path for the image geometry to be created |

### Output Cell Attribute Matrix

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Cell Data Name | DataObjectName |  | The name for the cell data Attribute Matrix within the Image geometry |

### Output Cell Data

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Feature Ids Name | DataObjectName |  | The name for the feature ids array in cell data Attribute Matrix |

## License & Copyright

Please see the description file distributed with this **Plugin**

## 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](https://github.com/BlueQuartzSoftware/DREAM3DNX-Issues/discussions) GitHub site where the community of DREAM3D-NX users can help answer your questions.
