중간선을 없애려고 합니다. 내가 어떤 변화를 가하더라도 그것은 상황을 더욱 악화시키는 것 같습니다. 혹시 이 코보르디즘을 제대로 그리는 방법을 알려주시면 감사하겠습니다.
\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}
4점을 사용한다면 별 필요가 없습니다 \psline
.하나 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}