1
$\begingroup$

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]

enter image description here

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

1 Answer 1

3
$\begingroup$

We PiecewiseExpand the expression of reg.

ImplicitRegion[PiecewiseExpand[reg[[1]]], {x, y}] // DiscretizeRegion

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.