Filling between two arrays with ListPointPlot3D
Filling -> {2 -> {1, Directive[{Opacity[0.4], Red}]}}
Update: Since the two surfaces are separated by a plane a much easier approach is to fill both surfaces to a plane (say, the z == 1500
plane) between the two and post-process to remove the polygons whose third coordinates are constant at z
:
z = 1500.;
DeleteCases[Normal[ListPlot3D[{cc, bb}, PlotRange -> {500, 3000},
Filling -> {1 -> {z, Opacity[.5, Green]}, 2 -> {z, Opacity[.5, Green]}}]],
Polygon[{{_, _, z} ..}, ___], All]
Original answer:
David's method fills from the top surface to the z == 1
plane. To fill between the two surfaces we can
- Create a
ListPlot3D
object,lp3D
, usingbb
with filling to a plane below thecc
surface (say, the planez==0
) - Post-process the output of the previous step (a) to replace the coordinates
{x_, y_, 0.}
with{x, y, w}
usingw
from the entry ofcc
whose first two coordinates match{x,y}
; (b) remove the polygons at the top and bottom (these happen to be in the first group of polygons) - Use
Show
to combine the result from the previous step withListPlot3D
of the two data sets.
lp3D = ListPlot3D[bb, Filling -> 0,
FillingStyle -> Opacity[.5, Green], PlotStyle -> None,
BoundaryStyle -> None, Mesh -> None];
assocc = Association[{#, #2} -> #3 & @@@ N[cc]];
lp3D = lp3D /. GraphicsComplex[a_, b___] :>
GraphicsComplex[a /. {x_, y_, 0.} :> {x, y, assocc[{x, y}]}, b];
lp3D = Replace[lp3D, {a___, {EdgeForm[], ___}, ___, b : {EdgeForm[], ___}, c___} :>
{a, b, c}, All];
Show[ListPlot3D[{cc, bb}, PlotRange -> {500, 3000}], lp3D]
Note: If you define disp = Dispatch[{#, #2} -> #3 & @@@ N[cc]];
and use {x, y} /. disp
in place of assocc[{x,y}]
, and {0, Infinity}
in place of All
above, this method also works in version 9.