# Writing custom class based on \`vtkDataSet\`

**URL:** https://discourse.vtk.org/t/writing-custom-class-based-on-vtkdataset/6950
**Category:** Development
**Created:** [October 23, 2021, 1:12pm UTC](https://discourse.vtk.org/t/writing-custom-class-based-on-vtkdataset/6950 "2021-10-23T13:12:40Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![kerim](https://discourse.vtk.org/user_avatar/discourse.vtk.org/kerim/32/1175_2.png) [@kerim](https://discourse.vtk.org/u/kerim)
#### Post date: [October 25, 2021, 4:01pm UTC](https://discourse.vtk.org/t/writing-custom-class-based-on-vtkdataset/6950/3 "2021-10-25T16:01:06Z")

</div>

Thank you for the response,

> [@will.schroeder](#):
>
> I assume that you have some sort of surface tessellation that goes along with the x-y points? And that these tessellated cells are triangles or quads that when extruded create 3D wedges or hexes?

Absolutely right. About an hour ago I finally achieved some success (with memory leaks yet of course) and I’m proud to show it 🙂

![image](https://discourse.vtk.org/uploads/default/original/2X/1/116cb3e518253720979430b3312100a9b9e8f68f.jpeg)

As you said one have to provide XYZ surface grid and Z spacings (double array where all elements are either positive or negative). To visualize with colors o course one need to provide array of values for each cell/point.

> [@will.schroeder](#):
>
> FindCell() and FindPoint() are probably some of the trickiest methods.

Does these methods should return the nearest point/cell in the terms of Eigen space like `min(sqrt(x1-x0)^2+(y1-y0)^2+(z1-z0)^2)` ? For now I have defined these methods with that logic.

I would like to contribute to VTK but not soon as I need to be confident that the project is pretty stable and may be applied in practical tasks.

---

_[View the full topic](https://discourse.vtk.org/t/writing-custom-class-based-on-vtkdataset/6950)._
