In order to completeness,here we provide another ways to do this. Thanks
@xzczd suggestion。
Related How to graph a solid common to multiple functions
Clear[f, g, h, fgh, ghf, hfg];
SetOptions[ContourPlot3D, PlotPoints -> 80, MaxRecursion -> 4,
Mesh -> {{0}, {0}, {0}}, BoundaryStyle -> None, Boxed -> False,
Axes -> False];
f = {x, y, z} |-> x^2 + y^2 - 1;
g = {x, y, z} |-> y^2 + z^2 - 1;
h = {x, y, z} |-> z^2 + x^2 - 1;
fgh = ContourPlot3D[
f[x, y, z] == 0, {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
MeshFunctions -> {g, h},
MeshShading -> {{Red, None}, {None, None}}, MeshStyle -> None];
ghf = ContourPlot3D[
g[x, y, z] == 0, {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
MeshFunctions -> {h, f},
MeshShading -> {{Yellow, None}, {None, None}}, MeshStyle -> None];
hfg = ContourPlot3D[
h[x, y, z] == 0, {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
MeshFunctions -> {f, g},
MeshShading -> {{Cyan, None}, {None, None}}, MeshStyle -> None];
Show[fgh, ghf, hfg]
CSGRegion["Intersection", {Cylinder[{{0, 0, -2}, {0, 0, 2}}],
Cylinder[{{0, -2, 0}, {0, 2, 0}}],
Cylinder[{{-2, 0, 0}, {2, 0, 0}}]}, BaseStyle -> Darker@Cyan]
- OpenCascadeLink` (Thanks @user21)
Needs["OpenCascadeLink`"];
shape = OpenCascadeShape[
RegionIntersection[Cylinder[{{0, 0, -1}, {0, 0, 1}}],
Cylinder[{{0, -1, 0}, {0, 1, 0}}],
Cylinder[{{-1, 0, 0}, {1, 0, 0}}]]];
bm = OpenCascadeShapeSurfaceMeshToBoundaryMesh[shape,
"ShapeSurfaceMeshOptions" -> {"AngularDeflection" -> .01}] //
BoundaryMeshRegion;
RegionPlot3D[bm, ColorFunction -> "Rainbow", Boxed -> False]
Or
Needs["OpenCascadeLink`"];
reg1 = Cylinder[{{0, 0, -2}, {0, 0, 2}}];
reg2 = Cylinder[{{0, -2, 0}, {0, 2, 0}}];
reg3 = Cylinder[{{-2, 0, 0}, {2, 0, 0}}];
shape1 = OpenCascadeShape[reg1];
shape2 = OpenCascadeShape[reg2];
shape3 = OpenCascadeShape[reg3];
bm = OpenCascadeShapeSurfaceMeshToBoundaryMesh[
OpenCascadeShapeIntersection[shape1, shape2, shape3],
"ShapeSurfaceMeshOptions" -> {"AngularDeflection" -> .01}] //
BoundaryMeshRegion;
bm // Volume;
RegionPlot3D[bm, ColorFunction -> "Rainbow", Boxed -> False]