# How to unite the region of ParametricPlot and set up the mesh for FEM?

I have used the ParametricPlot to plot the sector of the disk and use Show to combine them in one picture, however it cannot be converted to the region and cannot use the RegionUnite, and cannot be meshed by ToElementMesh, **so how to convert the plot to region and get the mesh later for FEM and boundary conditions indication?

The code and its results are as follows:

R1 = 4/100;
R2 = 7/100;
R3 = 8/100;

ToothNumber = 8;
SlotNumber = ToothNumber;
RectangleNumber = ToothNumber + SlotNumber;

betaSlot = Pi/8;
betaPole = 2*Pi/(ToothNumber) - betaSlot;

thetaInitial = Pi/12;

regionR2R3 =
ParametricPlot[{r Cos[theta], r Sin[theta]}, {theta, 0, 2 Pi}, {r,
R2, R3}];
region[n_] :=
ParametricPlot[{r Cos[theta], r Sin[theta]}, {theta,
thetaInitial + betaPole + (n - 1)*(betaPole + betaSlot),
thetaInitial + betaPole +
betaSlot + (n - 1)*(betaPole + betaSlot)}, {r, R1, R2}];
regionR1R2 =
Show[Table[region[n], {n, 1, ToothNumber}], PlotRange -> All];
regionAll = Show[{regionR1R2, regionR2R3}, PlotRange -> All]


The above code can plot the right region (But it is not in region format) and the output figure is as this:

The following code doesn't work:

RegionUnion[regionR1R2, regionR2R3]
\[CapitalOmega] = regionAll;
bounds = {{-R3, R3}, {-R3, R3}};
meshAll = ToElementMesh[\[CapitalOmega], bounds]

• mesh = ToElementMesh[regionAll // BoundaryDiscretizeGraphics]; mesh["Wireframe"] Mar 22, 2023 at 3:55
• @cvgmt, excellent and thank you very much!
– fhrl
Mar 22, 2023 at 5:57

Another way maybe replace all the ParametricPlot to ParametricRegion and use RegionUnion.

Clear["Global*"];
Needs["NDSolveFEM"];
R1 = 4/100;
R2 = 7/100;
R3 = 8/100;

ToothNumber = 8;
SlotNumber = ToothNumber;
RectangleNumber = ToothNumber + SlotNumber;

betaSlot = Pi/8;
betaPole = 2*Pi/(ToothNumber) - betaSlot;

thetaInitial = Pi/12;

regionR2R3 =
ParametricRegion[{r Cos[theta],
r Sin[theta]}, {{theta, 0, 2 Pi}, {r, R2, R3}}];
region[n_] :=
ParametricRegion[{r Cos[theta],
r Sin[theta]}, {{theta,
thetaInitial + betaPole + (n - 1)*(betaPole + betaSlot),
thetaInitial + betaPole +
betaSlot + (n - 1)*(betaPole + betaSlot)}, {r, R1, R2}}];

regionR1R2 = RegionUnion[Table[region[n], {n, 1, ToothNumber}]];
regionAll = RegionUnion[regionR1R2, regionR2R3];
mesh = RegionPlot[regionAll] // BoundaryDiscretizeGraphics //
ToBoundaryMesh
mesh["Wireframe"]


• Great answer and thank you very much! However what is the difference of Region and RegionPlot,as I cannot get the mesh for your code.
– fhrl
Mar 22, 2023 at 5:59
• @fhrl Needs["NDSolveFEM"]; I am using version 13.2.1 ,the code work for me. If we want to use Region, we can using mesh = Region[regionAll] // Show // BoundaryDiscretizeGraphics // ToBoundaryMesh` Mar 22, 2023 at 7:58
• Well received and thank you!
– fhrl
Mar 22, 2023 at 11:08