# how to combine two different vtk file?

**URL:** https://discourse.vtk.org/t/how-to-combine-two-different-vtk-file/9170
**Category:** Support
**Tags:** file-formats
**Created:** [August 18, 2022, 7:21am UTC](https://discourse.vtk.org/t/how-to-combine-two-different-vtk-file/9170 "2022-08-18T07:21:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Zhao412](https://discourse.vtk.org/user_avatar/discourse.vtk.org/zhao412/32/5670_2.png) [@Zhao412](https://discourse.vtk.org/u/Zhao412)
#### Post date: [August 18, 2022, 7:21am UTC](https://discourse.vtk.org/t/how-to-combine-two-different-vtk-file/9170/1 "2022-08-18T07:21:25Z")

</div>

i have two different vtk file,both are RECTILINEAR\_GRID  
could i combine these into one vtk file?

# vtk DataFile Version 4.2

vtk output  
ASCII  
DATASET RECTILINEAR\_GRID

DIMENSIONS 11 11 11  
X\_COORDINATES 11 double  
-20.000000 -16.000000 -12.000000 -8.000000 -4.000000  
0.000000 4.000000 8.000000 12.000000 16.000000  
20.000000  
Y\_COORDINATES 11 double  
-20.000000 -16.000000 -12.000000 -8.000000 -4.000000  
0.000000 4.000000 8.000000 12.000000 16.000000  
20.000000  
Z\_COORDINATES 11 double  
100.000000 110.000000 120.000000 130.000000 140.000000  
150.000000 160.000000 170.000000 180.000000 190.000000  
200.000000

# vtk DataFile Version 4.2

vtk output  
ASCII  
DATASET RECTILINEAR\_GRID

DIMENSIONS 11 11 6  
X\_COORDINATES 11 double  
-20.000000 -16.000000 -12.000000 -8.000000 -4.000000  
0.000000 4.000000 8.000000 12.000000 16.000000  
20.000000  
Y\_COORDINATES 11 double  
-20.000000 -16.000000 -12.000000 -8.000000 -4.000000  
0.000000 4.000000 8.000000 12.000000 16.000000  
20.000000  
Z\_COORDINATES 6 double  
0.000000 10.000000 20.000000 30.000000 40.000000  
50.000000

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [August 19, 2022, 3:10am UTC](https://discourse.vtk.org/t/how-to-combine-two-different-vtk-file/9170/2 "2022-08-19T03:10:20Z")

</div>

Please see [How to merge two PolyData into one](https://discourse.vtk.org/t/how-to-merge-two-polydata-into-one/4431)

Essentialy you need to read in each file and merge them using vtkAppendPolyData----\>vtkCleanPolyData as mentioned there.
