3

Does anyone know how to shade only one of the faces of a solid whose faces are described using parametricplot? For example, shade the faces of the solid below? In general, how to color each of the sides with different colors/patterns? It might be necessary to change the whole code (?)

Thank you!

\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}
3
\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}

enter image description here

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.