# Slicing with a Cone

**URL:** https://discourse.paraview.org/t/slicing-with-a-cone/4527
**Category:** ParaView Support
**Created:** [June 7, 2020, 5:42am UTC](https://discourse.paraview.org/t/slicing-with-a-cone/4527 "2020-06-07T05:42:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Yannick](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/b782af/32.png) [@Yannick](https://discourse.paraview.org/u/Yannick)
#### Post date: [June 7, 2020, 5:42am UTC](https://discourse.paraview.org/t/slicing-with-a-cone/4527/1 "2020-06-07T05:42:19Z")

</div>

Dear Paraview users,

First of all I would like to point out that I am a beginner in Paraview, therefore please excuse my lack of depth in the field.

I am dealing with a vtk file which contains the (x, y, z) components of a current density vectorial field that is defined within a rectangular box. What I would like to do is to slice that input data, not with a plane or the other available slice types, but with a Cone strategically placed.  
The actual set of data is pretty heavy, so in order to illustrate my problem, I built a dummy set of data:

 ![Screen Shot 2020-06-07 at 14.38.45](https://discourse.paraview.org/uploads/default/original/2X/5/5f08b0a02b4fc997ee0242bf77ee3db37fd77dec.jpeg)

Let’s assume that the dots represent a component of the current density field within space. In a nutshell I am trying to extract the components of that field that lie on the surface of the Cone.  
I am a bit puzzled on to how to attack this problem properly. I did try a few things around the Resample to Dataset filter but without any success.

Any advice or help is welcome !

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [June 8, 2020, 8:55am UTC](https://discourse.paraview.org/t/slicing-with-a-cone/4527/2 "2020-06-08T08:55:53Z")

</div>

Hello,

If you really want to sample the field data onto a cylinder, the cylinder filled with isotropic mesh would be preferable. However, creating an isotropic mesh in ParaView is somewhat difficult. So, an easy way is to firstly make the cylinder isotropically refined with external tools like  
[instant-meshes](https://github.com/wjakob/instant-meshes). Then load it into ParaView and perform resampling operation.

For your reference I attached a cylinder mesh and state file:  
[map\_to\_cone.zip](https://discourse.paraview.org/uploads/short-url/8ZZiTZGQX1F5Fiyh9j08vDwYVbT.zip) (96.7 KB)

 ![map_cone_img](https://discourse.paraview.org/uploads/default/original/2X/3/32a8f372b295cb5614839d0c1aac6859021ac665.png)

---

<div class="post-metadata">

### Author: ![Yannick](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/b782af/32.png) [@Yannick](https://discourse.paraview.org/u/Yannick)
#### Post date: [June 9, 2020, 12:45am UTC](https://discourse.paraview.org/t/slicing-with-a-cone/4527/3 "2020-06-09T00:45:11Z")

</div>

Hi Kenichiro,

Thank you for your answer !  
I will sure give it a try as it seems pretty straightforward.

I have an extra question at this stage :

- As it is very unlikely that the two meshes coincide perfectly, what will happen during the resampling operation ?  
=\> Case 1: Certain nodes of the cone’s mesh do not have any data point from the input field that fall onto it.  
=\> Case 2: The contrary, that is to say a data point from the field is present on the Cone’s theoretical surface but does not coincide with a node of the Cone’s mesh.

I am sorry if my questions seem naive. It is actually yet unclear to me of what happens during the resampling operaton.

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [June 9, 2020, 2:55am UTC](https://discourse.paraview.org/t/slicing-with-a-cone/4527/4 "2020-06-09T02:55:20Z")

</div>

Hello Yannick,

The answer is Case 1. The Resampling operation is mainly based on some of the interpolation methods.

Incidentally, could you tell me what type of data set is in vtk file? If the vtk data is 3D volume mesh such as vtkRectilinearGrid, vtkStructuredGrid, or vtkUnstructuredGrid, you can use the “Resample To DataSet” filter to resample the 3D volume onto a cone surface by means of the linear interpolation. If data is a point cloud, you would need to apply the “Point Dataset Interpolator” filter to interpolate point cloud to the cone surface.

---

<div class="post-metadata">

### Author: ![Yannick](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/b782af/32.png) [@Yannick](https://discourse.paraview.org/u/Yannick)
#### Post date: [June 10, 2020, 3:39am UTC](https://discourse.paraview.org/t/slicing-with-a-cone/4527/5 "2020-06-10T03:39:53Z")

</div>

Hello Kenichiro,

Thank you for your answer.  
I have to admit that I am not entirely sure of the exact vtk file type.  
The fact is that :

- First a 3D simulator produces a .dis file containing various physical field, including the current
- Then a conversion of that .dis file is done in order to produce a .vtk file to allow an analysis of the physical fields through Paraview. However I do not know which type of vtk file is actually produced.

In order to check, what should I do ? Maybe it is as simple as checking the vtk file itself, the information being possibly written in the headers (though for disk space management reasons, the vtk files are systematically removed once the analysis has been carried out, which I can obviously deal with by altering slightly the main code handling the whole procedure) ?

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [June 10, 2020, 4:05am UTC](https://discourse.paraview.org/t/slicing-with-a-cone/4527/6 "2020-06-10T04:05:00Z")

</div>

Hello Yannick,

I’m sorry I didn’t explain it enough.

Would you take a look at the information tab? In the statistics box, the data type will be shown.

 ![intormation_tab](https://discourse.paraview.org/uploads/default/original/2X/0/0b2805ee31d483f65c4e319355fd9f91b9b365af.jpeg)

---

<div class="post-metadata">

### Author: ![Yannick](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/b782af/32.png) [@Yannick](https://discourse.paraview.org/u/Yannick)
#### Post date: [June 12, 2020, 6:16am UTC](https://discourse.paraview.org/t/slicing-with-a-cone/4527/7 "2020-06-12T06:16:33Z")

</div>

Hi Kenichiro,

Sorry for my late reply.  
After checking the file, it appears to be an UnstructuredGrid vtk file, therefore based on your previous message I can apply a “Resample to DataSet” filter in principle.  
Again, thanks for your inputs, it really helps.
