真ん中の線をなくそうとしています。どんな変更を加えても、悪化してしまうようです。このコボルディズムを適切に描く方法を教えていただけるとありがたいです。
\begin{pspicture}
\pscustom{
\psbezier[showpoints=true](1.5,2.5)(1.5,1.1)(.4,1.6)(.5,0)
\psline(-0.5,0)
\psbezier[showpoints=true](-0.5,0)(-.4,1.6)(-1.5,1.1)(-1.5,2.5)
\psline(-.5,2.5)
\psbezier[showpoints=true](-.5,2.5)(-.6,1.5)(0.6,1.5)(.5,2.5)
\psline(1.5,2.5)}
\end{pspicture}
答え1
通常の方法
\documentclass[pstricks,border=12pt]{standalone}
\begin{document}
\begin{pspicture}[showgrid=true](-2,-1)(2,3)
\pscustom
{
\psset{showpoints}
\psbezier(1.5,2.5)(1.5,1.1)(.4,1.6)(.5,0)
\psbezier(-.5,0)(-.4,1.6)(-1.5,1.1)(-1.5,2.5)
\psbezier[liftpen=1](-.5,2.5)(-.6,1.5)(.6,1.5)(.5,2.5)
\closepath
}
\end{pspicture}
\end{document}
異常な方法
\reversepath
対称性は、\scale
、 などで考慮されます。残念ながら\nodexn
、(!N-<nodename>.x N-<nodename>.y)
と をここで一緒に使用することはできないため、コードが複雑になりすぎます。
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-eucl}
\psset{saveNodeCoors}
\begin{document}
\begin{pspicture}[showgrid=true](-2,-1)(2,3)
\pstGeonode[PointName=none,PointSymbol=none]
(.5,2.5){A}
(.6,1.5){B}
(-.6,1.5){C}
(-.5,2.5){D}
% P = (A + B)/2
(!N-A.x N-B.x add 2 div N-A.y N-B.y add 2 div){P}
% Q = ((A + C)/2 + B)/2
(!N-A.x N-C.x add 2 div N-A.y N-C.y add 2 div N-B.y add 2 div exch N-B.x add 2 div exch){Q}
% R = (A + D + 3(B + C))/8
(!N-A.x N-D.x add N-B.x N-C.x add 3 mul add 8 div N-A.y N-D.y add N-B.y N-C.y add 3 mul add 8 div){R}
\def\path
{
\psbezier(.5,0)(.4,1.6)(1.5,1.1)(1.5,2.5)
\psbezier[liftpen=1](!N-A.x N-A.y)(!N-P.x N-P.y)(!N-Q.x N-Q.y)(!N-R.x N-R.y)
}%
\pscustom
{
\psset{showpoints}
\path
\reversepath
\scale{-1 1}
\path
\closepath
}
\end{pspicture}
\end{document}
警告!
(<nodename>)
(!\pstGetNodeCenter{<nodename>} <nodename>.x <nodename>.y)
で拡大縮小することはできません。\scale{}
そのため、(!N-<nodename>.x N-<nodename>.y)
ここでは を使用します。
答え2
内部\pscustom
のみ初め \psbezier
には 4 つの点があり、その他すべてでは現在の点が最初のベジェ点でもあります。
\documentclass[border=5mm]{standalone}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}(-2,0)(2,2.5)
\pscustom{
\psbezier[showpoints](1.5,2.5)(1.5,1.1)(.4,1.6)(.5,0)% 4 points
\psline(-0.5,0)%% is also the first bezier point for the next \psbezier
\psbezier[showpoints](-.4,1.6)(-1.5,1.1)(-1.5,2.5)% three
\psline(-.5,2.5)
\psbezier[showpoints](-.6,1.5)(0.6,1.5)(.5,2.5)% three
\closepath
}
\end{pspicture}
\end{document}
\psline
4ポイントを使用する場合は、しかしは必要ありません1つ liftpen
オプション:
\documentclass[border=5mm]{standalone}
\usepackage{pstricks}
\begin{document}
\begin{pspicture}(-2,0)(2,2.5)
\pscustom{
\psbezier[showpoints](1.5,2.5)(1.5,1.1)(.4,1.6)(.5,0)
\psbezier[showpoints](-0.5,0)(-.4,1.6)(-1.5,1.1)(-1.5,2.5)
\psbezier[showpoints,liftpen=1](-.5,2.5)(-.6,1.5)(0.6,1.5)(.5,2.5)
\closepath
}
\end{pspicture}
\end{document}