-1
$\begingroup$

How do I have to change math expression or imaging intervals in order to cut 'legs' by sagittal secant planes I marked with red?enter image description here

ContourPlot3D[(1 - z) ((x - 1)^2 + y^2 - 1/3)*((x + 1)^2 + y^2 - 
    1/3) + z (x^2 + y^2 - 1/3) == 0, {x, -2, 2}, {y, -2, 2}, {z, 
0, 1}, PlotPoints -> 200]

and a bit changed with two planes to cut

p1 = ContourPlot3D[
   0.475 x - z == -0.55, {x, -2, 2}, {y, -2, 2}, {z, 0, 1}, 
   ContourStyle -> Red];
p2 = ContourPlot3D[(1 - z) ((x - 1)^2 + y^2 - 1/3)*((x + 1)^2 + y^2 - 
        1/3) + z (x^2 + y^2 - 1/3) == 0, {x, -2, 2}, {y, -2, 2}, {z, 
    0, 1}, PlotPoints -> 200];
p3 = ContourPlot3D[
   0.475 x + z == 0.55, {x, -2, 2}, {y, -2, 2}, {z, 0, 1}, 
   ContourStyle -> Blue];
Show[p1, p2, p3, ViewPoint -> {0.3, -2, 0.3}]

enter image description here

$\endgroup$
4
  • $\begingroup$ Look up RegionFunction. $\endgroup$ Commented Sep 12, 2017 at 14:23
  • $\begingroup$ Thank you very much $\endgroup$ Commented Sep 12, 2017 at 14:31
  • 4
    $\begingroup$ You should proviide your code,but not just screenshoot.That why you get those downvote I think.. $\endgroup$
    – yode
    Commented Sep 13, 2017 at 12:18
  • $\begingroup$ Here its considered helpful to show your own efforts and share your code in a well formatted form instead of images or links to external files, so we can quickly Copy&Paste your code, test it, and see the problem you are facing. Please help us to help you and edit your question accordingly. This question in Meta could be useful. $\endgroup$
    – rhermans
    Commented Sep 13, 2017 at 14:01

2 Answers 2

9
$\begingroup$

RegionFunction (per @J.M. comment) can help. A less known but nice option is ClipPlanes. Just for fun I will explain this. Because you giving no copy-able code (which you need to learn to do at already >1000 reputation) and no equations for planes I gave you my own example with various details/options.

Graphics3D[
    {Sphere[{0, 0, 0}, 1/2], 
    Style[Sphere[], Red, 
        ClipPlanes -> InfinitePlane[{{0, 0, 0}, {0, 1, 1}, {1, 1, 2}}]]}, 
ClipPlanesStyle -> Opacity[0.3],
SphericalRegion->True]

enter image description here

Because ClipPlanes is Graphics3D option you need to do some tricks, for example:

transcendental=ContourPlot3D[
Cos[x]Sin[y]+Cos[y]Sin[z]+Cos[z]Sin[x]==0,
{x,-2π,2π}, {y,-2π,2π},{z,-2π,2π},
ContourStyle->Directive[FaceForm[Orange,Red],Specularity[White,30]],
Mesh->None]

enter image description here

Graphics3D[First[transcendental], 
 ClipPlanes -> InfinitePlane[{{0, 0, 0}, {0, 1, 1}, {1, 1, 2}}], 
 ClipPlanesStyle -> Opacity[0.3]]

enter image description here

$\endgroup$
0
3
$\begingroup$

I updated my Mathematica and finally did it with both methods!

regions = {Function [{x, y, z}, 0.55 < (0.3 x + z) && x < 0], Function [{x, y, z}, (0.3 x - z) < -0.55 && x > 0]};
MapThread [ContourPlot3D [(1 - z) ((x - 1)^2 + y^2 - 1/3)*((x + 1)^2 + y^2 - 
         1/3) + z (x^2 + y^2 - 1/3) == 0, {x, -2, 2}, {y, -2, 2}, {z, 
     0, 1}, RegionFunction -> #, PlotPoints -> 200] &, {regions}] // Show

Pair of pants

trans = ContourPlot3D [(1 - z) ((x - 1)^2 + y^2 - 1/3)*((x + 1)^2 + 
   y^2 - 1/3) + z (x^2 + y^2 - 1/3) == 0, {x, -2, 2}, {y, -2, 2}, {z, 0, 1}, PlotPoints -> 200]; 
Graphics3D [First[trans], ClipPlanes -> {InfinitePlane[{{0, 0, 0.55}, {-2, 2, 1.5}, {-2, -2, 
      1.5}}], InfinitePlane[{{0, 0, 0.55}, {-2, 
      2, -0.5}, {-2, -2, -0.5}}]}]

Pair of panties Thank you for hints!

And several more, sorry I can't resist:
Striped with MeshFunctions

regions = {Function[{x, y, z}, 0.55 < (0.475 x + z) && x < 0], 
   Function[{x, y, z}, (0.475 x - z) < -0.55 && x > 0]};

MapThread[
  ContourPlot3D[(1 - z) ((x - 1)^2 + y^2 - 1/3)*((x + 1)^2 + y^2 - 
         1/3) + z (x^2 + y^2 - 1/3) == 0, {x, -2, 2}, {y, -2, 2}, {z, 
     0.5, 1}, RegionFunction -> #, PlotPoints -> 200, 
    BoxRatios -> {1, 1, 1/8}, ViewPoint -> {Front}, Mesh -> 5, 
    MeshShading -> {Pink, White}, MeshFunctions -> {#1 &}, 
    ImageSize -> Large, 
    Lighting -> {{"Directional", White, {0, -2, 0}}}] &, {regions}
  ] // Show

just for fun, sorry

Sine sections

regions = {Function[{x, y, z}, 
    0.55 < (0.3*x + z + 0.04*Sin[1.7*x - 17*z]) && x < 0], 
   Function[{x, y, z}, (0.3 *x - z + 0.04*Sin[1.7*x + 17*z]) < -0.55 &&
      x > 0]};

gobj = MapThread[
   ContourPlot3D[(1 - z) ((x - 1)^2 + y^2 - 1/3)*((x + 1)^2 + y^2 - 
          1/3) + z (x^2 + y^2 - 1/3) == 0, {x, -2, 2}, {y, -2, 2}, {z,
       0.5, 1}, RegionFunction -> #, PlotPoints -> 200, 
     BoxRatios -> {1, 1, 1/8}, ViewPoint -> {0.3, -2, -1}, 
     Mesh -> None, ContourStyle -> Red] &, {regions}];
Show[gobj, ImageSize -> Large, Boxed -> False]

Red cape

Sorry. It was big fun.

$\endgroup$

Your Answer

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

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