Non linear extrusion?

Hi,

I have a bathymetric CSV dataset that I managed to transform into a nice surface thanks to community answers here No difference between surface and points representations

But I now have another problem. I want to have some sort of non linear extrusion that will fill the void created by warp by scalar, something like this :

I’ve seen the use of the calculator to extrude, by I really don’t understand this filter to extrude surfaces like here Extrude a land surface based on topography — Visualization 1.0 documentation.

Here again, I wanted to copy what has been done here How to make 2D data look like more realistic in 3D view?

I’ve used the linear extrusion, it is quite nice for water, but has two major problems:
I either have a reflect when I’m putting just enough water, or when I avoid by making the water far below seabed, it is just too unrealistic when side viewing.

My filters for the moment:
Bathy.CSV
Tabletopoints
Point dataset interpolator applied on a plane source the same size of bathy (14500x13000, precision of 4000x3500)
Warp by scalar
Smooth if I want a better looking plane, not necessary for testing

I’m pretty sure the answer is with the calculator filter but I can’t figure out how.

Thanks ! :slight_smile:

Bathy data : Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

Hi,

If you replace the elevations at the points in Bathy.csv that form the boundary with the minimum elevation, you can create sides when you apply Warp By Scalar. To do this, you may want to use the following Programmable filter for TableToPoints for Bathy.csv.

import numpy as np
from vtk.util.numpy_support import vtk_to_numpy, numpy_to_vtk

input0 = inputs[0]
bounds = input0.GetBounds()
print(f'bounds: {bounds}')

field2 = input0.GetPointData().GetArray('Field 2')
min_elev = field2.GetRange()[0]

points = vtk_to_numpy(output.GetPoints())
print(len(points))
num_pnts = len(points)

elevation = np.full(num_pnts, min_elev)

for id, (x, y, z) in enumerate(points):
    if (x <= bounds[0] or x >= bounds[1] or
        y <= bounds[2] or y >= bounds[3]):
        continue
    elevation[id] = field2.GetTuple1(id)

output.PointData.append(elevation, 'elevation')

This allows the result of the Warp By Scalar filter to have sidewall surfaces.

I also tried Ray Traced Rendering on the water surface (H_3_CSV.txt). This would avoid the problem of reflections at the bottom.

I am attaching the STATE file I used, just in case.
ray_tracing_bathy.pvsm (866.1 KB)