# Unexpected quitting of the kernel when discretizing parametric region

I have a region defined parametrically (-actually the union and difference of several ones), and when I try to discretize it Mathematica suddenly quits the kernel, as show in the picture below (I'm working with Mathematica 12.3.1.0 on MW 64-bit platform).

 f1[x_] := Piecewise[{{-x - 1.8, x < -1.8}, {0, -1.8 < x < -1}, {x + 1, -1 < x < 0}}];
f2[x_] := Piecewise[{{x + 6.5, x < -3}, {-x + 0.5, x < -1}, {x + 2.5, -1 < x < 0}}];
rf = ImplicitRegion[y <= 1.5*f1[x], {{x, -4.15, 0}, {y, 0, 5.5}}];
rg = ImplicitRegion[y <= 1.5*f2[x], {{x, -4.15, 0}, {y, 0, 5.5}}];
rf2 = ImplicitRegion[y <= 1.5*f1[-x], {{x, 0, 4.15}, {y, 0, 5.5}}];
rg2 = ImplicitRegion[y <= 1.5*f2[-x], {{x, 0, 4.15}, {y, 0, 5.5}}];
reg = RegionUnion[RegionDifference[rg, rf], RegionDifference[rg2, rf2]];
ParametricPlot[{x, y}, Element[{x, y}, reg]]

DiscretizeRegion[reg]


• The same happens with the newest version of MMA 13.1. Please report this to [email protected] Commented Jul 16, 2022 at 11:09
• code runs in Mathematica v12.2 Commented Jul 16, 2022 at 12:06

We PiecewiseExpand the expression of reg.
ImplicitRegion[PiecewiseExpand[reg[[1]]], {x, y}] // DiscretizeRegion