1
$\begingroup$

I would like to do a 3D contour plot over an implicit region, however, it seems that mma does not support the arguments within an implicit region for ContourPlot3D, is there any way to get over this? As for my problem, the region is defined as:

reg3d = ImplicitRegion[( 1+k1+k2>=0&&1-k1+k2>=0&&k2<=0&&0<=k3<=6 )||(k2>=0&&-4k2<=k1<=4 k2 &&k1^2-8k2 (1-k2)<=0&&0<=k3<=6)||(k2>=0&& 4k2<k1&&-k1+k2+1>=0&&0<=k3<=6)||(k2>=0&& -4k2>k1&&k1+k2+1>=0&&0<=k3<=6 ), { { k1, -1.5, 1.5 }, { k2, -1, 1 }, { k3, 0, 6 } } ];

which looks like:

enter image description here

and the function I would like to plot is:

gsc1[ K0_, K1_, K2_ ] := 1 - ( K0 - (K0 K1 K2)/2 );

hope some expert can give me some suggestion, thanks a lot!

$\endgroup$
2
  • 1
    $\begingroup$ does Show[ContourPlot3D[ gsc1[k1, k2, k3], {k1, -1.5, 1.5}, {k2, -1, 1}, {k3, 0, 6}, RegionFunction -> Function[{x, y, z}, RegionMember[reg3d][{x, y, z}]]], RegionPlot3D[reg3d, PlotStyle -> Opacity[.3]]] give what you need? $\endgroup$
    – kglr
    Apr 7, 2019 at 5:00
  • $\begingroup$ @kglr It works, thanks a lot! $\endgroup$
    – Ogawa Chen
    Apr 8, 2019 at 1:07

1 Answer 1

2
$\begingroup$
Show[ContourPlot3D[gsc1[k1, k2, k3], {k1, -1.5, 1.5}, {k2, -1, 1}, {k3, 0, 6}, 
  PlotPoints -> 100, Mesh -> None, 
  RegionFunction -> Function[{x, y, z}, RegionMember[reg3d][{x, y, z}]]], 
 RegionPlot3D[reg3d, PlotStyle -> Opacity[.3]]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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