# 3D surface extraction from a 3D cube

**URL:** https://discourse.paraview.org/t/3d-surface-extraction-from-a-3d-cube/12150
**Category:** ParaView Support
**Tags:** vtk
**Created:** [May 24, 2023, 6:39pm UTC](https://discourse.paraview.org/t/3d-surface-extraction-from-a-3d-cube/12150 "2023-05-24T18:39:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Fred](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Fred](https://discourse.paraview.org/u/Fred)
#### Post date: [May 24, 2023, 6:39pm UTC](https://discourse.paraview.org/t/3d-surface-extraction-from-a-3d-cube/12150/1 "2023-05-24T18:39:09Z")

</div>

Hi there,

I would like to extract 3D surfaces from a 3D cube.

In order to clarify my pupose, let’s take a simpler case: I have 3 2D grids data where values represent z value.

This is what I want and obtain:

 ![Capture d’écran du 2023-05-24 20-21-59](https://discourse.paraview.org/uploads/default/original/2X/c/cc28939cc218d0b36d19f7c4180a43cf58ed856c.png)

OK, that’s for the simpler case (it’s just 3 VTK UnstructuredGrid with 3D points where z values are the data values).

Now, what I would like to do is to get the same display, but with only one 3D grid data (where 3 2D grids data are stacked, in fact).

I think about something like this:

3D grid data  
|  
 → extraction of the first slice → elevation of the slice vs z values  
|  
 → extraction of the second slice → elevation of the slice vs z values  
|  
 → extraction of the third slice → elevation of the slice vs z values

So my question is: what kind of filters can I use to do this ?

Obviously, I could do the same as in the simpler case, ie extract 3 VTK UnstructuredGrid from the 3D cube, but in real case I have a lot of 3D surfaces, so it would be cumbersome to do it like this.

Thanks in advance.

Regards

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [May 24, 2023, 7:36pm UTC](https://discourse.paraview.org/t/3d-surface-extraction-from-a-3d-cube/12150/2 "2023-05-24T19:36:40Z")

</div>

Answering questions like this is always easier if you can post some example data to give us a better idea if what we are looking at.

It looks like you have 3 separated sheets. As long as you are sure they are separated and the connectivity within a sheet is correct, you can use the `Connectivity` filter to identify the connected sheets. This filter will create a new point field named `RegionId` that has a unique identifier for each connected region. In the example you posted, it should have `RegionId`s 0, 1, and 2 with each assigned to one of the sheets.

After you run the `Connectivity` filter, just use `Threshold` to pull out the sheet you want.

---

<div class="post-metadata">

### Author: ![Fred](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/db5fbb/32.png) [@Fred](https://discourse.paraview.org/u/Fred)
#### Post date: [May 25, 2023, 9:32pm UTC](https://discourse.paraview.org/t/3d-surface-extraction-from-a-3d-cube/12150/3 "2023-05-25T21:32:27Z")

</div>

OK.

Thanks for the answer.

Please see the attached vtkImageData file:  
[horizons.vti](https://discourse.paraview.org/uploads/short-url/sJBIvjZaM4IQ2UtAYDrjtLMLY5.vti) (740.8 KB)  
It’s a stack of 3 201\*301 cells 2D grids.

Values in each of these 3 2D grids represent a z value.  
And rather than display these 3 2D grids as horizontal planes, I would like to display them as 3 3D-surfaces “elevated” with their z values.

I’m not sure I get the point of what you suggest above, btw.  
There is no connectivity info in the VTK file.
