how to make the surface of a 3D region smooth
Sometimes, it is easier to discretize before intersecting.
BoundaryDiscretizeRegion@RegionIntersection[
Map[
BoundaryDiscretizeRegion[#,
MaxCellMeasure -> (1 -> 0.05)] &,
{Cylinder[{{0, 0, -2}, {0, 0, 2}}], Cylinder[{{0, -2, 0}, {0, 2, 0}}],
Cylinder[{{-2, 0, 0}, {2, 0, 0}}]}
]
]
Using OpenCascadeLink from version 12.1 makes this easier and better quality:
Needs["NDSolve`FEM`"]
rr = RegionIntersection[Cylinder[{{0, 0, -2}, {0, 0, 2}}],
Cylinder[{{0, -2, 0}, {0, 2, 0}}],
Cylinder[{{-2, 0, 0}, {2, 0, 0}}]];
bmesh = ToBoundaryMesh[rr,
"BoundaryMeshGenerator" -> {"OpenCascade",
"ShapeSurfaceMeshOptions" -> {"LinearDeflection" -> 0.00125}}];
bmesh["Wireframe"[
"MeshElementStyle" -> Directive[FaceForm[Green], EdgeForm[]]]]
ri = RegionIntersection[Cylinder[{{0, 0, -2}, {0, 0, 2}}],
Cylinder[{{0, -2, 0}, {0, 2, 0}}], Cylinder[{{-2, 0, 0}, {2, 0, 0}}]];
You can use PlotPoints
as a suboption for Method
options:
DiscretizeRegion[ri,
Method -> {"DualMarchingCubes", PlotPoints -> 150}]