# Slice and clip filter

**URL:** https://discourse.paraview.org/t/slice-and-clip-filter/3799
**Category:** ParaView Support
**Created:** [March 12, 2020, 2:34pm UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799 "2020-03-12T14:34:41Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 12, 2020, 2:34pm UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/1 "2020-03-12T14:34:41Z")

</div>

Hello,

I am trying to extract a surface region in my computational domain.  
I use the slice filter together with the clip filter to do this.  
However I have recently noticed this:

- When i use the clip filter directly on my .case file with the data, there are no points within that region.  

- However when i used the slice filter - and then the clip filter there are point within the region.  
What is the reason for this?  

I wonder why this happens.  
Could someone help me with this.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 13, 2020, 3:06am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/2 "2020-03-13T03:06:54Z")

</div>

Please share your dataset

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 14, 2020, 12:54pm UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/4 "2020-03-14T12:54:33Z")

</div>

Hi,  
The results are written in EnSight6 binary format.  
The result files are case files.  
I am not quite sure how i can share the dataset. There are a lot of files each timestep.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 16, 2020, 2:46am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/5 "2020-03-16T02:46:47Z")

</div>

Save a single timestep as a .vtu file and share it here.

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 16, 2020, 6:27pm UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/6 "2020-03-16T18:27:57Z")

</div>

Hello,

I’ve saved the data for a single timestep and attached the .vtu file.  
Please have a look and let me know.

[Paraview\_1\_0.vtu](https://discourse.paraview.org/uploads/short-url/2cB1bqqHT4fC81sqyL7y18vtkei.vtu) (6.7 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 17, 2020, 2:12am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/7 "2020-03-17T02:12:53Z")

</div>

Your dataset is really flat. Is that really how your model.case looks like ?

In any case, I was able to use slice and clip on your dataset without any issues.

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 17, 2020, 10:45am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/8 "2020-03-17T10:45:30Z")

</div>

Hi, I think there was a problem while saving the data.  
I am not able to upload the dataset here because the file size is too big.  
I have uploaded it to the drive, and I have sent a link to you.

Please check your inbox.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 18, 2020, 1:16am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/9 "2020-03-18T01:16:09Z")

</div>

I am able to use Clip on both dataset you sent me.

Please provide precise steps to reproduce your issue.

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 18, 2020, 10:09am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/10 "2020-03-18T10:09:12Z")

</div>

Hello,

These are the following steps:  
Approach 1

1. Slice filter on the model.case file  
Type: Plane  
Origin: 1.168, 0.02196, 0.4578  
Normal: 0.202789776, 0.81456055, 0.54347716
2. Clip filter on the above slice filter:  
Type: Sphere  
Origin: 1.168, 0.02196, 0.4578  
Radius: 0.0017

Approach 2  
3. Clip filter directly on the model.case file  
Origin: 1.168, 0.02196, 0.4578  
Radius: 0.0017

The resulting number of points selected in Approach 1, is different from Approach 2.#  
I hope this helps.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 18, 2020, 10:25am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/11 "2020-03-18T10:25:04Z")

</div>

Approach 1 would give you a 2D dataset  
Approach 2 would give you a 3D dataset

Why do you expect to have the same result here ?

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 18, 2020, 7:23pm UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/12 "2020-03-18T19:23:07Z")

</div>

Yeah i understand that, but won’t the 2D dataset be a subset of the 3D dataset?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 19, 2020, 2:06am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/13 "2020-03-19T02:06:08Z")

</div>

Yes, the 2D dataset is that surface of the 3D dataset. But they do not have the same number of points.

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 19, 2020, 10:11am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/14 "2020-03-19T10:11:19Z")

</div>

Yes. So shouldn’t the 3D dataset have the points contained in the 2D dataset as well ?considering the coordinates of the origin and type of filters I have used, shouldn’t approach 2 have the same or more number of points than approach 1?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 19, 2020, 11:34am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/15 "2020-03-19T11:34:21Z")

</div>

> shouldn’t the 3D dataset have the points contained in the 2D dataset as well

No, because clip and slice are not the same operation

> shouldn’t approach 2 have the same or more number of points than approach 1

Not at all. their exterior surface is the same, but the 3D dataset has points inside, the 2D dataset do not.

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 19, 2020, 12:18pm UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/16 "2020-03-19T12:18:51Z")

</div>

Yes that’s my understanding of it as well.

But please look at the pictures I have posted above. Image one is Approach 2, and image 2 is approach one ( sorry they aren’t in order ).  
Image one is a 3D dataset ( has no points ).  
Image two is a 2D dataset ( has points )

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 20, 2020, 2:36am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/17 "2020-03-20T02:36:28Z")

</div>

You clip with sphere is failing because your cells in your dataset are completely mixed up and overlapping.

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 20, 2020, 7:03am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/18 "2020-03-20T07:03:51Z")

</div>

Why does that happen? And how can I fix it?  
Is there any other operation (filter) that works the same as image 2?  
I need to extract a part of a certain surface.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 20, 2020, 9:46am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/19 "2020-03-20T09:46:31Z")

</div>

> [@vishruthdilip](#):
>
> Why does that happen?

Because you are creating an incorrect mesh. How did you create it ?

> how can I fix it?

By creating a corrected mesh

Just take a look at your dataset with the `surface with edges` representation, you will see that your cells are all mixed up.

---

<div class="post-metadata">

### Author: ![vishruthdilip](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/f9ae1b/32.png) [@vishruthdilip](https://discourse.paraview.org/u/vishruthdilip)
#### Post date: [March 20, 2020, 9:49am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/20 "2020-03-20T09:49:34Z")

</div>

Since the solver is based on the point cloud approach, I don’t create the mesh. The solver fills the points in the computational domain. The surfaces are just for representation.

Is there a workaround for this? Something I can maybe do on Paraview?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 20, 2020, 10:09am UTC](https://discourse.paraview.org/t/slice-and-clip-filter/3799/21 "2020-03-20T10:09:50Z")

</div>

Your point cloud is fine, it is your mesh that is incorrect. If the cells are just for representation, then you can’t expect the cells based filter like clip to perform correctly.

How are the cells created ?

[Next page](https://discourse.paraview.org/t/slice-and-clip-filter/3799.md?page=2)
