有人知道如何只对使用 parametricplot 描述的立体面之一进行着色吗?例如,对下面立体面进行着色?一般来说,如何用不同的颜色/图案对每一面进行着色?可能需要更改整个代码(?)
谢谢你!
\documentclass[pstricks,border=2mm]{standalone}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}(-1.5,-1)(2.5,2)
\psset{unit=2cm,Alpha=70,Beta=15,fillstyle=solid}
%\psgrid
\pstThreeDCoor[linecolor=gray,xMin=0,xMax=2,yMin=0,yMax=2,zMin=0,zMax=1.5]
\pstThreeDLine[linecolor=lightgray]{-}(1,-0.1,0)(1,0.1,0)
\pstThreeDPut(1,-0.2,0.1){$1$}
\pstThreeDLine[linecolor=lightgray]{-}(-0.1,1,0)(0.1,1,0)
\pstThreeDPut(-0.3,1,0.1){$1$}
\pstThreeDLine[linecolor=lightgray]{-}(-0.1,0,1)(0.1,0,1)
\pstThreeDPut(-0.3,-0.3,1){$1$}
\parametricplotThreeD[linecolor=black,%
linewidth=.5pt,xPlotpoints=200,%
plotstyle=curve,arrows=-](0,90){%
t cos %
0 %
t sin}%
\parametricplotThreeD[linecolor=black,%
linewidth=.5pt,xPlotpoints=200,%
plotstyle=curve,arrows=-](0,90){%
t cos %
t sin %
0}%
\parametricplotThreeD[linecolor=black,%
linewidth=.5pt,xPlotpoints=200,%
plotstyle=curve,arrows=-](0,90){%
t cos %
t sin %
t sin }%
\parametricplotThreeD[linecolor=black,%
linewidth=.5pt,xPlotpoints=200,%
plotstyle=curve,arrows=-](0,1){%
0 %
1 %
t}%
\parametricplotThreeD[linecolor=black,%
linewidth=.5pt,xPlotpoints=200,%
plotstyle=curve,arrows=-](0,1){%
0 %
t %
1}%
\parametricplotThreeD[linecolor=black,%
linewidth=.5pt,xPlotpoints=200,%
plotstyle=curve,arrows=-](0,1){%
0 %
0 %
t}%
\psline[linewidth=0.5pt]{->}(1.2,-0.6)(0.5,-0.3)
\put(1.3,-0.7){$x^2+y^2=1$}
\psline[linewidth=0.5pt]{->}(-1.1,0.5)(-0.4,0.35)
\put(-2.2,0.5){$x^2+z^2=1$}
\end{pspicture}
\end{document}
答案1
\documentclass[pstricks,border=2mm]{standalone}
\usepackage{pst-3dplot}
\begin{document}
\begin{pspicture}(-4.5,-1.5)(5,3.5)
\psset{unit=2cm,Alpha=70,Beta=15,fillstyle=solid}
%\psgrid
\pstThreeDCoor[linecolor=gray,xMin=0,xMax=2,yMin=0,yMax=2,zMin=0,zMax=1.5]
\pstThreeDLine[linecolor=lightgray]{-}(1,-0.1,0)(1,0.1,0)
\pstThreeDPut(1,-0.2,0.1){$1$}
\pstThreeDLine[linecolor=lightgray]{-}(-0.1,1,0)(0.1,1,0)
\pstThreeDPut(-0.3,1,0.1){$1$}
\pstThreeDLine[linecolor=lightgray]{-}(-0.1,0,1)(0.1,0,1)
\pstThreeDPut(-0.3,-0.3,1){$1$}
\parametricplotThreeD[linecolor=black,linewidth=.5pt,xPlotpoints=200,plotstyle=curve,arrows=-](0,90)
{ t cos 0 t sin }
\pscustom[fillstyle=solid,fillcolor=red!50,opacity=0.5]{%Build a closed apth:
\parametricplotThreeD[linecolor=black,%
linewidth=.5pt,xPlotpoints=200,%
plotstyle=curve,arrows=-](0,90){%
t cos t sin 0}
\parametricplotThreeD[linecolor=black,linewidth=.5pt,xPlotpoints=200,%
plotstyle=curve,arrows=-](0,1){%
0 1 t}
\parametricplotThreeD[linecolor=black,linewidth=.5pt,xPlotpoints=200,plotstyle=curve,arrows=-](90,0)
{ t cos t sin t sin }
}
\parametricplotThreeD[linecolor=black,linewidth=.5pt,xPlotpoints=200,plotstyle=curve,arrows=-](0,1)
{ 0 t 1}
\parametricplotThreeD[linecolor=black,linewidth=.5pt,xPlotpoints=200,plotstyle=curve,arrows=-](0,1)
{ 0 0 t}
\psline[linewidth=0.5pt]{->}(1.2,-0.6)(0.5,-0.3)
\put(1.3,-0.7){$x^2+y^2=1$}
\psline[linewidth=0.5pt]{->}(-1.1,0.5)(-0.4,0.35)
\put(-2.2,0.5){$x^2+z^2=1$}
\end{pspicture}
\end{document}