如何在 ncline 内(节点之间)放置“线圈”?,在 PStricks 中

如何在 ncline 内(节点之间)放置“线圈”?,在 PStricks 中

如何在\ncline节点之间放置“线圈”?

如同: 在此处输入图片描述

我已经查看\pscoil和选项为coilarm=0.5,..

但是....在\ncline或类似?怎么样?

例如,我有这个代码

\documentclass[12pt,a4paper,x11names]{article}
\usepackage{pstricks,pst-node,pst-blur,pstricks-add}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[utf8]{inputenc}
\usepackage{eurosym}
\newpsobject{psframegray}{psframe}{fillcolor=lightgray,linestyle=none,shadow,blur}
\definecolor{azultenue}{RGB}{65,170,193}
\definecolor{rojotenue}{RGB}{192,2,3}
\definecolor{naranjatenue}{RGB}{241,101,35}
\definecolor{verdetenue}{RGB}{144,169,61}
\definecolor{gris135}{RGB}{135,135,135}

\begin{document}

\vspace{2.1cm}
 \begin{figure}[h!]
\centering

\resizebox{10cm}{!}{

\psset{framearc=0.2, shadowcolor=black!70, shadowangle=-90, unit=1.0cm,nodesep=0.12cm}
%
\def\pscolhookii{\hskip 1cm}
\def\pscolhookiii{\hskip 1cm}
\begin{psmatrix}[rowsep=0.2, colsep=5.2]% defines the distance between two frames
&
&
\\[2.5cm]
 [name=Inicio]
 \psframegray(-2.5,-2.5)(2.5,2.5)
%
 \rput(0,1.5){\circlenode[fillstyle=solid,fillcolor=azultenue]{p1}{\textcolor{black}{$p_1$}}}

 \rput(-1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c1}{\textcolor{black}{$c_1$}}}
 \rput(-0.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{c2}{\textcolor{black}{$c_2$}}}
 \rput(1.5,-1){\circlenode[fillstyle=solid,fillcolor=naranjatenue]{cl}{\textcolor{black}{$c_\lambda$}}}

 \ncline[arcangle=0]{->}{p1}{c1}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$}}
%
 \ncline[arcangle=0]{->}{p1}{c2}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$} }
%
 \ncline[arcangle=0]{->}{p1}{cl}
 \nbput[nrot=:U,labelsep=0.075cm]{\small{$ \omega_{mut}$} }
\rput(0,-3.0){$\bullet$ Crear $\lambda$ mutantes de $p_1$}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=Conjunto]
\psframegray(-2.5,-2.5)(2.5,2.5)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
&[name=EM]
\psframegray(-2.5,-2.5)(2.5,2.5)
%
%
\end{psmatrix}
%
{\psset{linewidth=3pt, linecolor=red, arrows=->, nodesep=4pt,  linearc=0.25, angleB=180, shortput=nab, npos = 0.4,nodesep=2.6cm}
\ncline{Inicio}{Conjunto}
\ncline{Conjunto}{EM}
}

}
%\vspace{3.85cm}
\vspace{2.85cm}
\caption{Esquema $(1 + \lambda)$}\label{1maslambda-ilustracion}
\end{figure}

\vspace{1cm}

\end{document} 

答案1

可以将同一个节点用作一条线。可以通过设置nodesep和 来实现不同的坐标offset。一切都参考节点的中心,Inicio即框架的中心:

[ ... ]
\ncline{Conjunto}{EM}
\pccoil[arm=10mm,linewidth=2pt,coilwidth=5mm]{<-}%
  ([nodesep=1cm,offset=-2cm]Inicio)([nodesep=4cm,offset=6cm]Inicio)
[ ... ]

在此处输入图片描述

答案2

在此处输入图片描述使用 Manuels 包 pst-ressort(您可以在这里获取: tex 文件, 这样式文件文档

\documentclass[pstricks,border=10pt]{standalone}

\usepackage{pst-node,pst-ressort,pstricks-add}

\begin{document}

\begin{pspicture}[showgrid=true](-1,-3)(10,3.2)
\pnode(1,-2){A}
\pnode(8,2){B}

\ncline[linecolor=orange,offset=1.5]{->}{A}{B}
\ncput*[framesep=0pt,nrot=:U]{%
\begin{pspicture}(-2,-0.1)(1.88,0.1)
\psRessort[linecolor=magenta,N=15,li=1,R=0.4,alpha=20,dl=0]{-}(-2,0)(2,0)%
\end{pspicture}
}

\pcline[linecolor=red]{->}(A)(B)
\ncput*[framesep=0pt,nrot=:U]{%
\begin{pspicture}(-1,-0.1)(0.88,0.1)
\psRessort[linecolor=cyan,N=3,li=1,R=0.5,alpha=-25,dl=0]{-}(-1,0)(1,0)%
\end{pspicture}
}

\ncline[linecolor=blue,offset=-1.5]{->}{A}{B}
\ncput*[framesep=0pt,nrot=:U]{%
\begin{pspicture}(-3,-0.1)(2.88,0.1)
\psRessort[linecolor=green,N=25,li=1,R=0.25,alpha=-15,dl=0]{-}(-3,0)(3,0)%
\end{pspicture}
}

\end{pspicture}
\end{document}

相关内容