# RegionIntersection not work, only outputs BooleanRegion Object

This is an example to make Pi in 3D dimension

Thanks @xzczd for providing the fast version. Link Smoothing the Region？

r = RegionProduct[#, Line[{{0.}, {10.}}]] &@
ImageMesh@ColorNegate@ImageResize[Rasterize[" \[Pi]"], 100];
r2 = TransformedRegion[r, TranslationTransform[-RegionCentroid@r]];
r3 = RegionUnion@
Table[TransformedRegion[RepairMesh@r2,
RotationTransform[i, {0, 1, 0}]], {i, -Pi/6, Pi/6, Pi/75}];
cy = DiscretizeRegion@Ball[{0, 0, 0}, 15];
RegionIntersection[r3, cy]


The visualization failed, but RegionEmbeddingDimension shows the dimensions are same.

RegionIntersection says: RegionIntersection is defined only for regions with the same RegionEmbeddingDimension:

{RegionDimension /@ {r3, cy}, RegionEmbeddingDimension /@ {r3, cy}}
(* Yes, Different dimension {{2, 3}, {3, 3}} *)


Also failed by repairing the mesh

cyrepair = RepairMesh@cy;
RegionIntersection[r3, cyrepair]
(* Not worked *)
{RegionDimension /@ {r3, cyrepair}, RegionEmbeddingDimension /@ {r3, cyrepair}}
(* {{2, 2}, {3, 3}} *)


However, the code works if all dimension of regions are same.

{RegionDimension /@ {r2, cy}, RegionEmbeddingDimension /@ {r2, cy}}
RegionIntersection[r2, cy]
(* {{3, 3}, {3, 3}} *)


• Did you manage to solve this? I currently have the same problem and cannot find a solution Jun 27, 2021 at 14:44
• Then I used Shapr3D on iPad.... Aug 13, 2021 at 8:18

• For Version 13, 14,we can do such intersection all in OpenCascade package, need not use RepairMesh etc.
• In the original code, there is blank in the text " π".
r = RegionProduct[#, Line[{{0.}, {10.}}]] &@
ImageMesh@ColorNegate@ImageResize[Rasterize[" π"], 100];

ball = Ball[{0, 0, 0}, 15];

Needs["OpenCascadeLink"];
Needs["NDSolveFEM"];
bm0 = ToBoundaryMesh[r];
shape0 =
TranslationTransform[-RegionCentroid@r]];
shape1 =
RotationTransform[i, {0, 1, 0}]], {i, -Pi/6, Pi/6, Pi/75}];

{mesh1["Wireframe"[
`