I've create a region by making a rectangle and two disks and using RegionUnion, resulting in a rectangle with two curved sides. Now I want to add an intersecting ellipsoid above it and then remove it (including the area of intersection), or create a "negative" region, so to speak... My aim is to have a region that's like a rounded rectangle with a concave upper side (see image), but I have no idea how to do it.

Thanks enter image description here

  • 1
    $\begingroup$ Edit the post and add the code you have used thus far. Format it with the code button {}. $\endgroup$
    – Edmund
    Mar 20, 2017 at 23:50

1 Answer 1


You can use a combination of RegionUnion and RegionDifference:

region = RegionDifference[RegionUnion[Disk[{0, 0}, 1], Rectangle[{0,-1},{4,1}], 
    Disk[{4,0}, 1]], Ellipsoid[{2, 1}, {2,1/2}]];


Mathematica graphics

  • 1
    $\begingroup$ You can use StadiumShape[] instead: RegionDifference[StadiumShape[{{0, 0}, {4, 0}}, 1], Ellipsoid[{2, 1}, {2, 1/2}]]. $\endgroup$ Mar 21, 2017 at 3:03
  • $\begingroup$ @J.M. thanks; didn't know about StadiumShape. $\endgroup$
    – kglr
    Mar 21, 2017 at 3:58

Your Answer

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

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