# Handle point data arrays with vtkAppendFilter?

**URL:** https://discourse.vtk.org/t/handle-point-data-arrays-with-vtkappendfilter/1479
**Category:** Support
**Created:** [August 3, 2019, 7:21am UTC](https://discourse.vtk.org/t/handle-point-data-arrays-with-vtkappendfilter/1479 "2019-08-03T07:21:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [August 3, 2019, 7:21am UTC](https://discourse.vtk.org/t/handle-point-data-arrays-with-vtkappendfilter/1479/1 "2019-08-03T07:21:57Z")

</div>

I’m using the `vtkAppendFilter` to generate a `vtkUnstructuredGrid` from two meshes but the input meshes have duplicate points and cells. The `MergePoints` option for `vtkAppendFilter` is great however it doesn’t properly handle the point data arrays. For example, load the following two meshes and run this:

[mesh0.vtu](https://discourse.vtk.org/uploads/short-url/86NNeSQJrkYhXkRJILRw3LeVQM8.vtu) (1.2 MB)

[mesh1.vtu](https://discourse.vtk.org/uploads/short-url/zQvALXeldJFl15MtCHk8DPYyrnX.vtu) (1.2 MB)

```python
... # Load those meshes
append_filter = vtk.vtkAppendFilter()
append_filter.AddInputData(mesh0)
append_filter.AddInputData(mesh1)
append_filter.SetMergePoints(True)
append_filter.Update()
merged = append_filter.GetOutput()

n_points = merged.GetNumberOfPoints()
n_values = merged.GetPointData().GetArray(0).GetNumberOfValues()
print(n_values, n_points)

```

153106 114730

The resulting output from `vtkAppendFilter` isn’t useable because the PointData array has way more elements than there are points - how could I either fix this issue or not use the `SetMergePoints(True)` option and clean the `vtkUnstructuredGrid`?

It seems that when using `SetMergePoints(True)`, both values are kept for the merged points - could I avoid this or take an average?
