Group Abstract Group Abstract

Message Boards Message Boards

1
|
52 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Does anyone know how to remove that hole from the graph?

4 Replies

Sensational as always I thank you very much, I am learning many things, again thank you Michael, once I improve it I will publish it again!!

For RegionPlot3D[] you will need to refine the mesh considerably near where the spheres are tangent. It probably cannot be done efficiently. At least, I don't know how to do it with the plotter or DiscretizeRegion[]. Consequently, another approach should be considered. There's FEM and Open Cascade available. The geometry is also simple enough to consider constructing the surfaces by hand. For a somewhat simple approach, use ParametricPlot3D[] to draw each surface separately. It won't construct an exactly closed region, but it may be close enough if all you want is a graphic representation.

With a little cleverness, one can transform a discretized outer sphere into the inner one. Here's a quick proof of concept:

Block[{t1 = 9.2},
 ParametricPlot3D[4 Pi {Sin[u] Cos[w], Sin[u] Sin[w], Cos[u]}
   , {u, ArcCos[t1/(4 Pi)], Pi/2}
   , {w, ArcCos[Csc[u]/2], -ArcCos[Csc[u]/2]}
   , Mesh -> None, PlotStyle -> {Red, Opacity[0.5]}] //
  Show[
    Graphics3D[{}, PlotRange -> All, Axes -> True, 
     AxesLabel -> {x, y, z}],
    #,
    # /. GraphicsComplex[pts_, rest___] :> (* map outer to inner sphere *)
      GraphicsComplex[
       Block[{x, y, z, n},
        {x, y, z} = Transpose@pts;
        n = Sqrt[4 Pi^2 - (Min[2 Pi/t1, 1] z)^2]/
          Sqrt[(x - 2 Pi)^2 + y^2];
        Transpose[{n (x - 2 Pi) + 2 Pi, n y, Min[2 Pi/t1, 1] z}]
        ]
       , rest],
    PlotLabel -> HoldForm[t1] == t1
    ] &
 ]

Here the vertices of the inner sphere kind of line up with those of the outer one, making it less likely that they clash. Also the boundary vertices match up, so it's relatively easy to form the closing, flat faces.

POSTED BY: Michael Rogers

Thank you very much, I'm going to implement it!!

It looks like a discretization problem. It can be circumvented with CountourPlot3D:

Manipulate[Show[{ContourPlot3D[{x^2 + y^2 + z^2 == 16 \[Pi]^2,
     (x - 2 \[Pi])^2 + y^2 + z^2 == 4 \[Pi]^2},
    {x, 2 \[Pi], 4 \[Pi]}, {y, -2 Sqrt[3] \[Pi], 2 Sqrt[3] \[Pi]}, {z,
      0, t1}, ContourStyle -> Directive[Red, Opacity[0.3],
      Specularity[White, 40]], Mesh -> None],
   RegionPlot3D[x^2 + y^2 + z^2 <= 16 \[Pi]^2 &&
     (x - 2 \[Pi])^2 + y^2 + z^2 >= 4 \[Pi]^2 && x == 2 \[Pi] && 
     t1 >= z >= 0,
    {x, 2 \[Pi], 4 \[Pi]}, {y, -2 Sqrt[3] \[Pi], 2 Sqrt[3] \[Pi]}, {z,
      0, t1},
    Mesh -> None,
    PlotStyle -> Directive[Red, Opacity[0.3], Specularity[White, 40]]],
   RegionPlot3D[x^2 + y^2 + z^2 <= 16 \[Pi]^2 &&
     (x - 2 \[Pi])^2 + y^2 + z^2 >= 4 \[Pi]^2 && z == 0,
    {x, 2 \[Pi], 4 \[Pi]}, {y, -2 Sqrt[3] \[Pi], 2 Sqrt[3] \[Pi]}, {z,
      0, t1},
    Mesh -> None, PlotPoints -> 60,
    PlotStyle -> Directive[Red, Opacity[0.3],
      Specularity[White, 40]]]},
  AxesLabel -> (Style[#, 15, Blue] & /@ {"X", "Y", "Z"}),
  Axes -> True, Boxed -> False, BoxRatios -> Automatic,
  ViewPoint -> {-1, -2.4, 1.}], {{t1, 0.00002, "Value (t1)"},
  0.00001, 2 Sqrt[3] \[Pi], 0.00001},
 ControlPlacement -> Top]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard