下图说明了问题所在,被放大的角应该是平滑的(不是数学定义的平滑)。
我已从 改为liftpen
,0
但2
问题仍然存在。
如何使边角变得圆滑?
\documentclass{article}
\usepackage{pstricks-add}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=15pt
\psset{unit=1.5cm}
\begin{document}
\begin{pspicture}[showgrid=false](-7,-5)(7,5)
\psellipse[fillstyle=solid,opacity=0.75,fillcolor=yellow](0,0)(7.0,4.3)
\psellipse[linewidth=0.5,dimen=middle](0,0)(6.5,3.8)
\def\left{
\pscustom*[fillstyle=solid,linewidth=0.1]{
\psline(0,2.7)(0.5,2.7)(1,3.25)
\psbezier(1.2,1.3)(1.3,1.0)(2.0,1.0)
\psbezier(3.0,1.0)(3.0,2.2)(2,3.1)
% How to smooth the corner between the previous path and the next path?
\psellipticarcn(0,0)(6.0,3.3){!3.1 2 atan}{!-2.8 3.2 atan}
\psbezier(4,-2)(4,0)(2.2,-1.8)
\psbezier(1.5,-1)(1,-1)(0,-3.2)
}}\left
\psscalebox{-1 1}{\left}
\end{pspicture}
\end{document}
答案1
一种方法是将直线和曲线组合在一个\pscustom
命令中:现在所有部分都形成一条独特的线。例如
\documentclass{standalone}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(0,0)(2,2)
\psline[linecolor=red](0,0.5)(1,1.5)
\psline[linecolor=red](1,1.5)(0,1.5)
\pscustom{
\psline(0,0)(1,1)
\psline(1,1)(0,1)
}
\end{pspicture}
\end{document
结果是
答案2
(我认为)的剪切路径\psellipticarc[n]
与前面的构造没有正确连接。否则,包括linejoin=1
作为选项的一部分\pscustom
(请参阅L.8 线路连接,第 304 页pstricks
文档)。在这里,我只是将 扩展到\psbezier
与 better 对齐\psellipticarcn
,从而造成它起作用的假象。我相信 Herbert 能够找出实际问题所在:
\documentclass{article}
\usepackage{pstricks-add}% http://ctan.org/pkg/pstricks-add
\usepackage[active,tightpage]{preview}% http://ctan.org/pkg/preview
\PreviewEnvironment{pspicture}
\PreviewBorder=15pt
\psset{unit=1.5cm}
\begin{document}
\begin{pspicture}[showgrid=false](-7,-5)(7,5)
\psellipse[fillstyle=solid,opacity=0.75,fillcolor=yellow](0,0)(7.0,4.3)
\psellipse[linewidth=0.5,dimen=middle](0,0)(6.5,3.8)
\def\left{%
\pscustom*[fillstyle=solid,linewidth=0.1]{%
\psline(0,2.7)(0.5,2.7)(1,3.25)
\psbezier(1.2,1.3)(1.3,1.0)(2.0,1.0)
\psbezier(3.0,1.0)(3.0,2.2)(2,3.1112)% Modified last coordinate from (2,3.1)
\psellipticarcn(0,0)(6.0,3.3){!3.1 2 atan}{!-2.8 3.2 atan}
\psbezier(4,-2)(4,0)(2.2,-1.8)
\psbezier(1.5,-1)(1,-1)(0,-3.2)
}%
}%
\left
\psscalebox{-1 1}{\left}% right
\end{pspicture}
\end{document}
答案3
根据 Herbert 在多处的评论,解决方案如下:
correctAngle=false,dimen=middle
将选项传递给\psellipticarcn
并使贝塞尔的最后一个点与椭圆弧的第一个点重合。
\documentclass{article}
\usepackage{pstricks-add}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=15pt
\begin{document}
\begin{pspicture}[showgrid=false](-7,-5)(7,5)
\psellipse[fillstyle=solid,opacity=0.75,fillcolor=yellow](0,0)(7.0,4.3)
\psellipse[linewidth=0.5,dimen=middle](0,0)(6.5,3.8)
\def\left{
\pscustom[fillstyle=solid,linewidth=2pt,linecolor=red,fillcolor=black]{
\psline(0,2.7)(0.5,2.7)(1,3.25)
\psbezier(1.2,1.3)(1.3,1.0)(2.0,1.0)
\psbezier(3.0,1.0)(3.0,2.2)(!76 cos 6 mul 76 sin 3.3 mul)
\psellipticarcn[correctAngle=false,dimen=middle](0,0)(6.0,3.3){76}{-76}
\psbezier(4,-2)(4,0)(2.2,-1.8)
\psbezier(1.5,-1)(1,-1)(0,-3.2)
}}\left
\psscalebox{-1 1}{\left}
\end{pspicture}
\end{document}