1

I have the following code to show the intersection of two convex hulls. The plot has no problem when ViewPoint->Default. But when I try to change the viewpoint manually by holding and dragging the plot with the mouse, the image gets shrunk. Is there any way to keep the image size unchanged with a dynamic viewpoint?

P[0]={0,0,0};P[1]={1,0,0};P[2]={0,1,0};P[3]={0,0,1};P[4]={-1,-1,-1};P[5]={-1,0,-1};
    P[6]={0,-1,-1};

    R[9]=ConvexHullMesh[{P[0],P[2],P[3],P[4]}];
    R[10]=ConvexHullMesh[{P[0],P[2],P[3],P[5]}];

    face[9]=MeshPrimitives[R[9], "Polygons"];
    face[10]=MeshPrimitives[R[10], "Polygons"];
    colors1 = Opacity[0.4, #]& /@ { Green, Blue, Yellow,Red} ;
    colors3 = Opacity[0.4, #]& /@ { Red,Yellow, Green,Purple} ;

    intersectionfaces3 =  MeshPrimitives[RegionIntersection[R[9], R[10]], "Polygons"];

    Show[Graphics3D[{Transpose@{colors1 , face[9]},Transpose@{colors3, face[10]}, 
      {EdgeForm[{Thick, Red}], FaceForm[], intersectionfaces3}},  
     PlotRange -> {{-1.2, 1.2}, {-1.2, 1.2}, {-1.2, 1.2}}, Axes -> True, 
     ImageSize -> Large, AxesOrigin -> {0, 0, 0}, 
     LabelStyle -> {12, Bold, Black}, 
     AxesStyle -> Thick, Boxed -> True,AxesLabel->{x,y,z},Epilog -> {Inset[Style["Check", 20, Bold], {.2, .8}]} ],ListPointPlot3D[
       MapThread[
         Callout[#1, ToString@#1, #2, 
           LabelStyle -> {13, Black,Bold, Background ->Transparent}, 
           CalloutStyle -> White] &,
         {{  P[2], P[3],P[4],P[5]}, { Top, Right,Right,Below}} ]],ImageSize->Large]
Epsilon
  • 1,122
  • 4
  • 8
  • 3
    To your Show command, add the option SphericalRegion -> True – Jason B. Jun 07 '20 at 15:58
  • Thanks for your comment @JasonB. But it's not working. The plot still gets rescaled. – Epsilon Jun 07 '20 at 16:42
  • @Jason's recommendation works for me. – Michael E2 Jun 07 '20 at 17:28
  • I added SphericalRegion -> True after ImageSize->Large. Did you do the same way? Btw I'm using Mathematica Online. So the problem is due to it? @MichaelE2 – Epsilon Jun 07 '20 at 17:35
  • 2
    That's what I did. The online front end behaves differently from the desktop, not necessarily on purpose. It should work, so I think it's a bug with* M Online*. – Michael E2 Jun 07 '20 at 17:50
  • Yes. I also think so. Mathematica Online is not as good as the desktop version yet. The Wolfram App is pathetic. – Epsilon Jun 07 '20 at 23:40
  • @SumitBanik do you use any of the “mobile” apps? Perhaps these may behave any amount differently? That said, Mathematica Online is a double edged sword—you get access to the most recent updates as they’re softly rolled out (I’ve noticed small changes occur within the cloud version before the desktop version gets a soft update) but you also get these sorts of bugs being a web app. Do you have access to student licenses through your university? You can always grab a full & permanent desktop version at the student rate, or subscribe for a bit less :)) – CA Trevillian Jun 09 '20 at 09:29

0 Answers0