1
$\begingroup$

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}]

enter image description here

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.

Many thanks in advance!

$\endgroup$
  • 1
    $\begingroup$ Try RegionFunction $\endgroup$ – Wjx Jun 9 '17 at 6:54
  • $\begingroup$ @Wjx But the analytical expression of the yellow curve is not known... $\endgroup$ – Vaggelis_Z Jun 9 '17 at 6:57
  • $\begingroup$ How did you have this yellow line? You can set the PlotRange->{Your_minlevel,Your_maxlevel} and ClippingStyle->None $\endgroup$ – Rom38 Jun 9 '17 at 6:59
  • $\begingroup$ @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. $\endgroup$ – Vaggelis_Z Jun 9 '17 at 7:05
  • 1
    $\begingroup$ @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. $\endgroup$ – Rom38 Jun 9 '17 at 7:15
1
$\begingroup$

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[{{#[[1]]}, #[[2]]} & /@ 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. enter image description here

$\endgroup$
  • $\begingroup$ If I add this to L1 the area is not deleted. $\endgroup$ – Vaggelis_Z Jun 9 '17 at 8:31
  • $\begingroup$ Could you upload somewhere your data set to test the solution directly? I've tested this with arbitrary surface and it was working good. $\endgroup$ – Rom38 Jun 9 '17 at 11:27
  • $\begingroup$ In the first line of my original post there is a link to the full data which define the surface. $\endgroup$ – Vaggelis_Z Jun 9 '17 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.