# How to delete an area of a surface

I have a data file which defines a three-dimensional surface.

data = Import["lvo.dat", "Table"];
L1 = ListPlot3D[data, InterpolationOrder -> 3,
ColorFunction -> "SolarColors", PlotRange -> All];


Then we define a simple curve on that surface

dE = 30;
dataf3 = {{7.59, 4.8, -3407 + dE}, {7.82, 4.75, -3393 + dE},
{8.05, 4.72, -3384 + dE}, {8.22, 4.71, -3381 + dE},
{8.33, 4.71, -3381 + dE}, {8.51, 4.72, -3384 + dE},
{8.72, 4.75, -3395 + dE}, {8.94, 4.8, -3413 + dE}};

f3 = Interpolation[Transpose[{Range[Length[dataf3]], dataf3}],
InterpolationOrder -> 3];

n = 1000;
dataf33 = Table[f3[u], {u, 1, Length[dataf3], (Length[dataf3] - 1)/(n - 1)}];

L2 = ListPointPlot3D[dataf33, PlotStyle -> {{Yellow, PointSize[0.01]}}];


Therefore we have

plot = Show[{L1, L2}, ImageSize -> 500, ViewPoint -> {1.9, -1.6, 2.8}] My question: Is there an easy way to delete the area of the surface which lies inside and below the yellow parabolic curve?

By the way, I use version 9.0 of Mathematica.

• Try RegionFunction – Wjx Jun 9 '17 at 6:54
• @Wjx But the analytical expression of the yellow curve is not known... – Vaggelis_Z Jun 9 '17 at 6:57
• How did you have this yellow line? You can set the PlotRange->{Your_minlevel,Your_maxlevel} and ClippingStyle->None – Rom38 Jun 9 '17 at 6:59
• @Rom38 PlotRange has a global effect to the entire surface. I could define manually the limits of the vertical axis and delete the area inside the curve but I will also loose some of the corners of the surface. I need a local treatment. – Vaggelis_Z Jun 9 '17 at 7:05
• @Vaggelis_Z, this re-turn us to a question how did you define the yellow curve? You can solve the equation on interpolating functions for this curve setting the certain height and the domain for x,y. – Rom38 Jun 9 '17 at 7:15

I've re-written the answer to the simplest case of solution but it is going by the previously depicted way:

You can define the cut-off region function as

RegionFunction->Function[{x, y, z}, (6 < x < 11) && (4 < y < f3[x]) && (z > -3380)


Where the f3 is a bit another interpolation of your line points:

f3 = Interpolation[{{#[]}, #[]} & /@ dataf3,
InterpolationOrder -> 3];


Further,

Off[InterpolatingFunction::dmval]
L1 = ListPlot3D[data, InterpolationOrder -> 3,
ColorFunction -> "SolarColors", PlotRange -> All,
RegionFunction ->
Function[{x, y,
z}, (6 < x < 11) && (4 < y < f3[x]) && (z > -3380)]]


The switched off error-message appears due to certain mismatch in definitions of the boundaries of interpolation function and the region definitions for region-function. • If I add this to L1 the area is not deleted. – Vaggelis_Z Jun 9 '17 at 8:31
• Could you upload somewhere your data set to test the solution directly? I've tested this with arbitrary surface and it was working good. – Rom38 Jun 9 '17 at 11:27
• In the first line of my original post there is a link to the full data which define the surface. – Vaggelis_Z Jun 9 '17 at 11:49