我不明白如何(origin.220) -- (origin.220|-Destination.north)
在代码中使用该命令,因此我不得不猜测何时要在两个节点之间画一条线。如何确定需要使用什么数字(即 220)来将一条边从父节点的底部放到子节点的顶部而不干扰其他节点?这是我的代码:
\documentclass{article}
\usepackage{tikz}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usetikzlibrary{calc}
\tikzset{
every node/.style={
rounded corners=1mm,
align=center,
font=\sffamily
},
main/.style={
draw,
text width=5cm
}
}
\begin{document}
\centering
\begin{tikzpicture}
% Nodes
\node[main, label=180:(1)] (origen) {¿Se conoce la relacion confiabilidad/edad para esta falla?};
\node[main,anchor=east, label=180:(2)] (dos) at ($(origen.south)+(0,-1.5)$) {¿Es posible aplicar tareas TD?};
\node[main] (tareasTD) at ($(origen.south)+(-4,-3)$) {Especifique tareas TD};
\node[main, label=180:(3)] (tres) at ($(origen.south)+(0,-4.5)$) {¿Es posible aplicar tareas CD?};
\node[main] (tareasCD) at ($(origen.south)+(-3,-6)$) {Especifique tareas CD};
\node[main, text width=6cm, label=180:(4)] (cuatro) at ($(origen.south)+(0,-7.5)$) {¿Es un modo de falla categoria D?};
\node[main, label=180:(5)] (cinco) at ($(origen.south)+(-3,-9)$) {¿Es posible aplicar tareas FF?};
\node[main] (tareasFF) at ($(origen.south)+(-4.5,-10.5)$) {Especifique tareas FF};
\node[main, text width=6cm, label=180:(6)] (efectivas) at ($(origen.south)+(0,-12)$) {¿Las tareas son efectivas?};
\node[main, text width=3.5cm, circle, anchor=west] (circ) at ($(origen.south east)+(0,-1.5)$) {Si esta relacion Puede ser determinada con analisis adicionales entonces asigne ... etc. };
% Edges
\draw (origen.220) -- (origen.220|-dos.north) node[midway, right] {Parcial};
\draw (origen.195) -- (origen.195|-dos.north) node[midway, left] {Sí};
\draw (dos.300) -- (dos.300|-tareasTD.north) node[midway, left] {Sí};
\draw (tareasTD.8) -- (tareasTD.8|-tres.north);
\draw (origen.340) -- (origen.340|-tres.north) node[pos=.2, right] {No};
\draw (dos.350) -- (dos.350|-tres.north) node[midway, right] {No};
\draw (tres.187) -- (tres.187|-tareasCD.north) node[midway, left] {Sí};
\draw (tres.340) -- (tres.340|-cuatro.north) node[midway, right] {No};
\draw (tareasCD.340) -- (tareasCD.340|-cuatro.north);
\draw (cuatro.187) -- (cuatro.187|-cinco.north) node[midway, left] {Sí};
\draw (cinco.195) -- (cinco.195|-tareasFF.north) node[midway, left] {Sí};
\draw (cinco.40) -- (cinco.40|-efectivas.north) node[midway, right] {No};
\draw[dashed] (circ.west) -- (circ.west-|origen.340);
\end{tikzpicture}
\end{document}
我想修复以下问题:
答案1
0 到 180 之间的任何角度都在上方,而 180 到 360 之间的任何角度都在下方,因此,如果您设置像(cinco.40)
或 这样的角度(tareasTD.8)
,则线将从上方开始。
下面是一个 GIF,展示了一个例子(该行从起源):
输出
代码
\documentclass{article}
\usepackage{tikz}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usetikzlibrary{calc}
\tikzset{
every node/.style={
rounded corners=1mm,
align=center,
font=\sffamily
},
main/.style={
draw,
text width=5cm
}
}
\begin{document}
\centering
\begin{tikzpicture}
% Nodes
\node[main, label=180:(1)] (origen) {¿Se conoce la relacion confiabilidad/edad para esta falla?};
\node[main,anchor=east, label=180:(2)] (dos) at ($(origen.south)+(0,-1.5)$) {¿Es posible aplicar tareas TD?};
\node[main] (tareasTD) at ($(origen.south)+(-4,-3)$) {Especifique tareas TD};
\node[main, label=180:(3)] (tres) at ($(origen.south)+(0,-4.5)$) {¿Es posible aplicar tareas CD?};
\node[main] (tareasCD) at ($(origen.south)+(-3,-6)$) {Especifique tareas CD};
\node[main, text width=6cm, label=180:(4)] (cuatro) at ($(origen.south)+(0,-7.5)$) {¿Es un modo de falla categoria D?};
\node[main, label=180:(5)] (cinco) at ($(origen.south)+(-3,-9)$) {¿Es posible aplicar tareas FF?};
\node[main] (tareasFF) at ($(origen.south)+(-4.5,-10.5)$) {Especifique tareas FF};
\node[main, text width=6cm, label=180:(6)] (efectivas) at ($(origen.south)+(0,-12)$) {¿Las tareas son efectivas?};
\node[main, text width=3.5cm, circle, anchor=west] (circ) at ($(origen.south east)+(0,-1.5)$) {Si esta relacion Puede ser determinada con analisis adicionales entonces asigne ... etc. };
% Edges
\draw (origen.220) -- (origen.220|-dos.north) node[midway, right] {Parcial};
\draw (origen.195) -- (origen.195|-dos.north) node[midway, left] {Sí};
\draw (dos.300) -- (dos.300|-tareasTD.north) node[midway, left] {Sí};
\draw (tareasTD.352) -- (tareasTD.352|-tres.north);
\draw (origen.340) -- (origen.340|-tres.north) node[pos=.2, right] {No};
\draw (dos.350) -- (dos.350|-tres.north) node[midway, right] {No};
\draw (tres.187) -- (tres.187|-tareasCD.north) node[midway, left] {Sí};
\draw (tres.340) -- (tres.340|-cuatro.north) node[midway, right] {No};
\draw (tareasCD.340) -- (tareasCD.340|-cuatro.north);
\draw (cuatro.187) -- (cuatro.187|-cinco.north) node[midway, left] {Sí};
\draw (cinco.195) -- (cinco.195|-tareasFF.north) node[midway, left] {Sí};
\draw (cinco.350) -- (cinco.350|-efectivas.north) node[midway, right] {No};
\draw[dashed] (circ.west) -- (circ.west-|origen.340);
\end{tikzpicture}
\end{document}