2
$\begingroup$

I want to make a RegionPlot3D only in the range x + y + z < 1. The following works, but is slow and poor quality.

ρ12 = ρ23 = ρ31 = 0.4;
a12 = a23 = a31 = 2;

RegionPlot3D[{
  1/ρ12 > a12 x/y > ρ12 && x + y + z < 1,
  1/ρ23 > a23 y/z > ρ23 && x + y + z < 1,
  1/ρ31 > a31 z/x > ρ31 && x + y + z < 1
  }, {x, 10^-10, 1}, {y, 10^-10, 1}, {z, 10^-10, 1},
 PlotPoints -> 101, PlotStyle -> Opacity[0.5], Mesh -> None, ViewPoint -> {1, 1, 1}]

enter image description here

Any ideas on how to make this sharper looking (highest priority) and faster (lower priority)? I'm not wedded to using RegionPlot3D if there are approaches using different functions.

Bonus question: can I make the faces towards the viewer a different style?

$\endgroup$
5
  • $\begingroup$ You could try DiscretizeRegion with an ImplicitRegion to give finer-grained control over how the regions are meshed, but this keeps crashing my 12.1 kernel $\endgroup$ – b3m2a1 Mar 31 at 23:11
  • 1
    $\begingroup$ Are these the only types of regions you'll want to plot? If so, it might be worth solving for the appropriate coordinates, and building them as Polyhedra or directly as MeshRegions. $\endgroup$ – thorimur Mar 31 at 23:18
  • 1
    $\begingroup$ You could also try using Tetrahedron[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}] to represent your target region and use RegionIntersection with that. Or you could use RegionBoundary and apply your transformations to the boundary and see what pops out $\endgroup$ – b3m2a1 Mar 31 at 23:21
  • $\begingroup$ Region stuff seems buggy on my copy of Mathematica, but yet another idea is to use TransformedRegion on Tetrahedron and take the intersection with your boundary conditions and then invert the transformation $\endgroup$ – b3m2a1 Mar 31 at 23:31
  • $\begingroup$ I just found this post which is showing promise... $\endgroup$ – Chris K Mar 31 at 23:32
1
$\begingroup$

Putting together some hints from @b3m2a1 and @thorimur, this works great (although not quite as automated as RegionPlot3D):

simplex3 = Tetrahedron[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}];
Graphics3D[{
  {Opacity[0.5], ColorData[97, 1], 
   RegionIntersection[simplex3, 
    Prism[{{0, 0, 0}, {1, a12/ρ12, 0}, {1, a12 ρ12, 0}, {0, 0, 1}, {1, a12/ρ12, 1}, {1, a12 ρ12, 1}}]]},
  {Opacity[0.5], ColorData[97, 2], 
   RegionIntersection[simplex3, 
    Prism[{{0, 0, 0}, {0, 1, a23/ρ23}, {0, 1, a23 ρ23}, {1, 0, 0}, {1, 1, a23/ρ23}, {1, 1, a23 ρ23}}]]},
  {Opacity[0.5], ColorData[97, 3], 
   RegionIntersection[simplex3, 
    Prism[{{0, 0, 0}, {a31/ρ31, 0, 1}, {a31 ρ31, 0, 1}, {0, 1, 0}, {a31/ρ31, 1, 1}, {a31 ρ31, 1, 1}}]]}
  }]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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