4
$\begingroup$

I am trying to create a geometric object represented by the intersection of a sphere and the space below a plane using ImplicitRegion. When I use the sphere alone, it works. When I use the plane alone, it also works... But when I use them both together, it does not work! I get the error message "DiscretizeRegion was unable to discretize the region ImplicitRegion".

 (* A sphere by itself works *)
reg1 = DiscretizeRegion[
   ImplicitRegion[
    x^2 + y^2 + z^2 == 1 && -40 <= x <= 40 && -40 <= y <= 40 && -20 <=
       z <= 40, {x, y, z}]];

(* The region below a given plane alone works *)
reg2 = DiscretizeRegion[
   ImplicitRegion[-(64/(3 Sqrt[3])) + (16 x)/3 - (16 y)/3 + (16 z)/
      3 <= 0 && -40 <= x <= 40 && -40 <= y <= 40 && -20 <= z <= 
      40, {x, y, z}]];

(* The sphere and region below the plane together does not work *)
reg12 = DiscretizeRegion[
   ImplicitRegion[
    x^2 + y^2 + z^2 == 
      1 && -(64/(3 Sqrt[3])) + (16 x)/3 - (16 y)/3 + (16 z)/3 <= 
      0 && -40 <= x <= 40 && -40 <= y <= 40 && -20 <= z <= 40, {x, y, 
     z}]];

Show[reg1, reg2, reg12]

Any idea how to make it work for the Implicit Region defined by both the sphere and the plane?

$\endgroup$
4
  • $\begingroup$ The intersection seems be the empty set. With x^2 + y^2 + z^2 == 10, it works for me. I have to admit, the error message is pretty useless... $\endgroup$ Oct 8, 2017 at 16:31
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Oct 8, 2017 at 16:50
  • $\begingroup$ Yes, I agree. It works if the sphere intersects the plane... But for some reason it does not work when the sphere is totally immersed inside the region of R3 delimited by the plane. Is'nt the result supposed to be the entire sphere? $\endgroup$
    – user52698
    Oct 8, 2017 at 17:41
  • 1
    $\begingroup$ The option Method -> "Semialgebraic" seems to work. $\endgroup$
    – Greg Hurst
    Oct 28, 2017 at 18:39

1 Answer 1

2
$\begingroup$

This is indeed strange behavior of DiscretizeRegion... Have a look at this simplified example:

DiscretizeRegion[ImplicitRegion[x^2 + y^2 + z^2 == 1 && x + y + z <= 3, {x, y, z}]]

DiscretizeRegion::drf: DiscretizeRegion was unable to discretize the region ImplicitRegion[<<2>>].

So this does not work, while as Henrik and Karl pointed out it works if the regions do not completely overlap:

DiscretizeRegion[ImplicitRegion[x^2 + y^2 + z^2 == 10 && x + y + z <= 3, {x, y, z}]]

This outputs the correct region. Interestingly it also works if the plane is "simple":

DiscretizeRegion[ImplicitRegion[x^2 + y^2 + z^2 == 1 && x <= 3, {x, y, z}]]

Mathematica does not immediately recognize that some of the equations/inequalities do not add any further restrictions. A workaround is to first simplify your constraints.

DiscretizeRegion[
 ImplicitRegion[
  Evaluate@FullSimplify[x^2 + y^2 + z^2 == 1 && x + y + z <= 3, 
    Assumptions -> {x ∈ Reals, y ∈ Reals, z ∈ Reals}], {x, y, z}]]

Or in your case:

reg12 = DiscretizeRegion[
  ImplicitRegion[
   Evaluate@
    FullSimplify[
     x^2 + y^2 + z^2 == 
       1 && -(64/(3 Sqrt[3])) + (16 x)/3 - (16 y)/3 + (16 z)/3 <= 
       0 && -40 <= x <= 40 && -40 <= y <= 40 && -20 <= z <= 40, 
    Assumptions -> {x ∈ Reals, y ∈ Reals, z ∈ Reals}], {x, y, z}]]
$\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.