pst-3dplot 对象中的不透明度/透明度

pst-3dplot 对象中的不透明度/透明度

pst-3dplot我正在尝试使用如下所示的方式 创建 3D 图形:在此处输入图片描述

问题在于橙色飞机不透明,因为它遮挡了圆柱体的某些部分。

我可以知道如何解决透明度问题吗?我已经阅读了有关同一主题的一些讨论,但毫无用处。我知道我可以使用,pst-solides3d但我想坚持pst-3dplot统一。

如果有帮助的话,我正在使用TeX Live 实用程序版本 1.54。 先感谢您。

答案1

您错过了\DocumentMetadata{}第一行。它允许lualatex透明度:

\DocumentMetadata{}
\documentclass[pstricks]{standalone}
\usepackage{pst-3dplot}
\begin{document}
    
\begin{pspicture*}(-3,-1)(3,3.5)
\parametricplotThreeD[xPlotpoints=20, yPlotpoints=20,  linecolor=cyan!30, linewidth=1pt, 
        plotstyle=curve, algebraic=true, fillstyle=solid, fillcolor=cyan!30, opacity=0.5]
        (0,3)(0, 6.2831853){cos(u) | sin(u) | t}   %% the cylinder x^2 + y^2 = 1
            
\parametricplotThreeD[xPlotpoints=20, yPlotpoints=20,  linecolor=blue, ,linestyle=solid, 
      dash=3pt 2pt, linewidth=1pt, plotstyle=curve, algebraic, fillcolor=cyan!30]
   (0,6.2831853){cos(t) | sin(t) | 3 } 
            
\parametricplotThreeD[xPlotpoints=20, yPlotpoints=20,  linecolor=blue, linestyle=solid, 
      dash=3pt 2pt, linewidth=1pt, plotstyle=curve, algebraic, fillcolor=cyan!30]
  (0,6.2831853){cos(t) | sin(t) | 0 } 
            
%\psplotThreeD[plotstyle=line,algebraic=true, yPlotpoints=200,xPlotpoints=200,
%    linewidth=1pt, linecolor=orange!30, hiddenLine=true, drawStyle=xyLines, fillstyle=solid,  
%    fillcolor=orange!30, opacity=0.5](-2, 2)(-2, 2){  1.5  }  %% the plane z = 1.5
            
\parametricplotThreeD[xPlotpoints=20, yPlotpoints=20,  linecolor=blue, linestyle=dashed, 
     dash=3pt 2pt, linewidth=1pt, plotstyle=curve, algebraic, fillcolor=cyan!30]
  (0,6.2831853){cos(t) | sin(t) | 1.5 } 
            
\pstThreeDCoor[linecolor=black,linewidth=1pt,IIIDxTicksPlane=xz, 
IIIDyTicksPlane=yz,spotX=180,xMin=-2,xMax=2,yMin=-2,yMax=2,zMin=-1,zMax=3.5,nameX=$x$, nameY=$y$, 
nameZ=$z$, labels=none] 

\pstThreeDSquare[linewidth=1pt,linecolor=orange!30,fillstyle=solid,fillcolor=orange!30,opacity=0.5]
    (-2,-2,1.5)(4,0,0)(0,4,0)
\end{pspicture*}
    
\end{document}

在此处输入图片描述

还有一个\pstThreeDCircle...

\DocumentMetadata{}
\documentclass[pstricks]{standalone}
\usepackage{pst-3dplot}
\begin{document}
    
\begin{pspicture*}(-3,-1)(3,3.5)
\parametricplotThreeD[xPlotpoints=200, yPlotpoints=100,  linecolor=cyan!30, linewidth=1pt, 
        plotstyle=curve, algebraic=true, fillstyle=solid, fillcolor=cyan!30, opacity=0.5]
        (0,3)(0, 6.2831853){cos(u) | sin(u) | t}   %% the cylinder x^2 + y^2 = 1
    
\pstThreeDCircle[linewidth=1pt,linecolor=blue](0,0,3)(1,0,0)(0,1,0)     
\pstThreeDCircle[linewidth=1pt,linecolor=blue](0,0,0)(1,0,0)(0,1,0)     
\pstThreeDCircle[linewidth=1pt,linecolor=blue,linestyle=dashed,
    dash=3pt 2pt](0,0,1.5)(1,0,0)(0,1,0)        
                                    
\pstThreeDCoor[linecolor=black,linewidth=1pt,IIIDxTicksPlane=xz, 
   IIIDyTicksPlane=yz,spotX=180,xMin=-2,xMax=2,yMin=-2,yMax=2,
   zMin=-1,zMax=3.5,nameX=$x$, nameY=$y$, nameZ=$z$, labels=none]

\pstThreeDSquare[linewidth=1pt,linecolor=orange!30,fillstyle=solid,fillcolor=orange!30,opacity=0.5]
    (-2,-2,1.5)(4,0,0)(0,4,0)
\end{pspicture*}
    
\end{document}

同样的情况还有pst-solides3d

\DocumentMetadata{}
\documentclass[pstricks]{standalone}
\usepackage{pst-solides3d}
\begin{document}
    
\begin{pspicture}[solidmemory](-5,-4)(5,6)
\psset{Decran=15,viewpoint=10 10 5}
\psSolid[object=cylindrecreux, h=3,r=2, fillcolor=blue!10, 
     mode=4, incolor=green!50, linecolor=black!10,name=A,action=none](0,0,0)
\psSolid[object=plan,definition=equation,args={[0 0 1 -1.5]},base=-3 3 -3 3,
     ngrid=30 30,fillcolor=red!10,linewidth=0pt,name=B,action=none]
\psSolid[object=fusion,base=A B_s,linewidth=0.1pt,action=draw**,opacity=0.9]
\axesIIID(2,2,3)(4,4,4)
\defFunction[algebraic]{Circle}(t){2*cos(t)}{2*sin(t)}{3}
\psSolid[object=courbe,r=0,function=Circle,range=0 6.3,linecolor=red,linewidth=1.5pt,action=draw]
\defFunction[algebraic]{Circle}(t){2*cos(t)}{2*sin(t)}{1.5}
\psSolid[object=courbe,r=0,function=Circle,range=-0.75 2,linecolor=red,
    linewidth=1.5pt,action=draw]
\defFunction[algebraic]{Circle}(t){2*cos(t)}{2*sin(t)}{0}
\psSolid[object=courbe,r=0,function=Circle,range=-0.75 2,linecolor=red,
    linewidth=1.5pt,action=draw]

\end{pspicture}

\end{document}

在此处输入图片描述

相关内容