```{index} single: Filters; Remove Flagged Triangles
```
# Remove Flagged Triangles

## Group (Subgroup)

Surface Meshing (Misc)

## Description

This **Filter** removes **Triangles** from the supplied **Triangle Geometry** that are flagged by a boolean mask array as **true**.  A new reduced **Geometry** is created that contains all the remaining **Triangles**.  It is unknown until run time how many **Triangles** will be removed from the **Geometry**. Therefore, this **Filter** requires that a new **TriangleGeom** be created to contain the reduced **Triangle Geometry**. This new **Geometry** will *NOT* contain copies of any **Feature Attribute Matrix** or **Ensemble Attribute Matrix** from the original **Geometry**. The mask is expected to be over the triangles themselves so it should be based on something from the ***Face Data*** **Attribute Matrix**.

## Data Handling

For each of the vertex and edge data attribute matrices, the user can select to copy none, some or all of the associated data arrays into the newly created geometry. If the user wishes to not copy any of the data, just leave the choice to "Copy Selected XXX Data" [0] but do not populate the list with any selections.

*Note:* Since it cannot be known before run time how many **Vertices** will be removed, the new **Triangle Geometry** and all associated **Triangle** data to be copied will be initialized to have size 0.

## Example Output

- The next figure shows a triangle geometry that has had a mask generated. Yellow parts are flagged as true.

![Masked triangle geometries for removal.](Images/RemoveFlaggedTriangles_1.png)

- The next figure shows the result of running the filter.

![Resulting triangle geometry](Images/RemoveFlaggedTriangles_2.png)


### Input Data Objects

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Triangle Geometry | Geometry Selection | Triangle | The Triangle Geometry that will be processed. |
| Mask | Array Selection | Allowed Types: uint8, boolean Comp. Shape: 1 | The DataArrayPath to the mask array that marks each face as either true (remove) or false(keep). |

### Output Geometry

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Created Geometry | DataGroupCreation |  | The name of the created Triangle Geometry |

### Vertex Data Handling

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Vertex Data Handling | Choices |  | How to handle Data that resides on the triangles |
| Vertex Data | AttributeMatrixSelection |  | Vertex Attribute Matrix that will be copied to the reduced geometry |
| Vertex Attribute Arrays to Copy | MultiArraySelection |  | Vertex DataPaths to copy |

### Triangle Data Handling

| Parameter Name | Parameter Type | Parameter Notes | Description |
|----------------|----------------|-----------------|-------------|
| Triangle Data Handling | Choices |  | How to handle Data that resides on the triangles |
| Triangle Data | AttributeMatrixSelection |  | Triangle Attribute Matrix that will be copied to the reduced geometry |
| Triangle Attribute Arrays to Copy | MultiArraySelection |  | Triangle DataPaths to copy |

## Example Pipeline

*'remove_flagged_triangles_example'* in **SimplnxCore**

## 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) GitHub site where the community of DREAM3D-NX users can help answer your questions.
