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"]
There are moustache like black lines on the edge. Increase the PlotPoints
option to 250 cannot remove it.
Update:
Outputs with BoundaryStyle->None
:
How can I obtain desired smooth version of the solid? Why such black lines happen?
BoundaryStyle -> None
. $\endgroup$Region
s to be a bit unreliable when they get really thin like that. An adaptive mesh approach, usingDiscretizeRegion
with an appropriateMeshRefinementFunction
could do the trick. Have a look at 105756, and see if it helps. $\endgroup$contourRegionPlot3D[]
on this problem gives this. $\endgroup$