Say I want to plot
$$E_1 = \{(x,y,z)\in\mathbb{R}^3\mid 0\le z\le 1-y, \sqrt{x}\le y\le 1, 0\le x \le 1\}$$ or $$E_2 = \{(x,y,z)\in\mathbb{R}^3\mid 0\le z\le \sqrt{9-y^2}, {3x}\le y\le 3, 0\le x \le 1\}. $$
Is it possible to accomplish this in Sage? For example, for $E_1$, I could do something like
x,y,z=var('x,y,z');
F = parametric_plot3d((x,sqrt(x),y), (x,0,1), (y,0,1), color='red');
G = parametric_plot3d((x,y,1-y), (x,0,1), (y,0,1),opacity=.5);
XY = plot3d(0, (x,0,1), (y,0,1),opacity=.5);
XZ = parametric_plot3d((x,0,z), (x,0,1), (z,0,1),opacity=.5);
YZ = parametric_plot3d((0,y,z), (y,0,1), (z,0,1),opacity=.5);
show(F+G+XY+XZ+YZ);
But of course displays each of the surfaces with in the box $[0,1]\times[0,1]\times[0,1]$, not the exact region $E_1$.
Plotting a 3d region defined by inequalities in SageMath
Sage has no built-in function for plotting 3d regions.
The best workaround is probably to parametrise the faces and plot them with
parametric_plot3d.Start by defining a function to plot a parametric surface, taking as arguments
xyzof coordinate functions of two variablesuuvvand call this function
surf:Below we use an opacity (or "alpha") of 0.3 (ie transparency 0.7) so that we can see well through the faces and better understand the volume they bound.
For $E_1$, we parametrise with $u \in [0, 1]$ and $v \in [0, 1]$, setting $v$ equal to $y$.
For $E_2$, we parametrise with $u \in [0, 1]$ and $v \in [0, 3]$, with $v$ equal to $y$ again.
Online demo: sagecell.