0
$\begingroup$

I want to create the following 3D solid object, which is an octahedron, cutting by six spheres centered at its vertices.

The code is as:

RegionPlot3D[-2 x + 2 y - 2 z + Sqrt[2] >= 
   0 && -2 x - 2 y - 2 z + Sqrt[2] >= 0 && 
  2 x - 2 y - 2 z + Sqrt[2] >= 0 && 2 x + 2 y - 2 z + Sqrt[2] >= 0 && 
  2 x + 2 y + 2 z + Sqrt[2] >= 0 && -2 x + 2 y + 2 z + Sqrt[2] >= 0 &&
   2 x - 2 y + 2 z + Sqrt[2] >= 0 && -2 x - 2 y + 2 z + Sqrt[2] >= 0
  && (-(1/Sqrt[2]) - x)^2 + y^2 + z^2 > 1/4 && 
  x^2 + (1/Sqrt[2] - y)^2 + z^2 > 1/4 && 
  x^2 + y^2 + (-(1/Sqrt[2]) - z)^2 > 1/4 && 
  x^2 + y^2 + (1/Sqrt[2] - z)^2 > 1/4 && 
  x^2 + (-(1/Sqrt[2]) - y)^2 + z^2 > 
   1/4 && (1/Sqrt[2] - x)^2 + y^2 + z^2 > 1/4, {x, -1, 1}, {y, -1, 
  1}, {z, -1, 1}, PlotPoints -> 250, Mesh -> None, 
 PlotTheme -> "Classic"]

and the output looks like: enter image description here

There are moustache like black lines on the edge. Increase the PlotPoints option to 250 cannot remove it.

Update:

Outputs with BoundaryStyle->None: enter image description here

How can I obtain desired smooth version of the solid? Why such black lines happen?

$\endgroup$
5
  • 1
    $\begingroup$ Try BoundaryStyle -> None. $\endgroup$ Jul 27, 2017 at 10:11
  • $\begingroup$ The lines still exist but turn into white or something transparent. $\endgroup$ Jul 27, 2017 at 10:17
  • 1
    $\begingroup$ I've found Regions to be a bit unreliable when they get really thin like that. An adaptive mesh approach, using DiscretizeRegion with an appropriate MeshRefinementFunction could do the trick. Have a look at 105756, and see if it helps. $\endgroup$ Jul 27, 2017 at 11:10
  • 1
    $\begingroup$ Using contourRegionPlot3D[] on this problem gives this. $\endgroup$ Jul 27, 2017 at 12:52
  • $\begingroup$ Thank you @J.M. , this new function via ContourPlot3D solves my problem. By increasing PlotPoints into 80 or so, the output graph looks pretty good. contourRegionPlot3D is much better than the built-in RegionPlot3D in these aspects if 3D solid model is not needed $\endgroup$ Jul 28, 2017 at 2:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy