매듭 패키지: 교차점이 다시 손실됨

매듭 패키지: 교차점이 다시 손실됨

기본적으로 나는 질문에 다른 사람과 같은 문제가 있습니다TikZ를 사용하여 그린 작은 매듭에 교차점이 나타나지 않음.

매듭을 더 작게 만들고 선을 더 두껍게(굵게 또는 매우 두껍게) 만들고 싶었습니다. 결과는 그림 왼쪽에 표시됩니다. 오른쪽의 건널목은 정상이며 그래야 합니다. 나는 end tolerance=1ptand 를 가지고 놀았 ignore endpoint intersections=false지만 지금까지는 작동하지 않습니다.

\documentclass[12pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes,decorations.markings,knots}
\begin{document}
\begin{tikzpicture}
\path (-1.2,-2.2)--(1.7,2.2);
\begin{knot}[
scale=0.8,
draft mode=crossings,
consider self intersections=true,
clip  width=1,
flip crossing=6,
flip crossing=4,
flip crossing=7,
flip crossing=2,
line width=2pt,
onlywhenrendering/.style={
    draw=white,
    double=black,
    doubledistance=6pt,
    linecap=round,
},
]
\strand
(-1,0) to[out=90,in=180,looseness=1]
(0,0.5) to[out=0,in=90,looseness=1]
(1.5,-0.5) to[out=-90,in=0,looseness=1] 
(1,-1) --
(-1,-1) to [out=180,in=180,looseness=1]
(-1,1.5) to [out=0,in=90,looseness=1]
(0.5,0.5) --(0.5,-1) to[out=-90,in=-90,looseness=2.9]
(-0.5,-1)--(-0.5,0.5) to[out=90,in=180,looseness=1]
(1,1.5)to[out=0,in=90,looseness=1]
(1.5,0.5)to[out=-90,in=0,looseness=1]
(0,-0.5) to[out=180,in=-90,looseness=1]
(-1,0)
;
\end{knot}
\draw (0,-2.4) node{$8_{17}$};
\begin{scope}[xshift=4cm]
\begin{knot}[
consider self intersections=true,
clip  width=2,
flip crossing=1,
flip crossing=3,
flip crossing=5,
flip crossing=8,
]
\strand
(-1,0) to[out=90,in=180,looseness=1]
(0,0.5) to[out=0,in=90,looseness=1]
(1.5,-0.5) to[out=-90,in=0,looseness=1] 
(1,-1.5) --
(-1,-1.5) to [out=180,in=180,looseness=1]
(-1,2) to [out=0,in=90,looseness=1]
(0.5,1) --(0.5,-1) to[out=-90,in=-90,looseness=2.9]
(-0.5,-1)--(-0.5,1) to[out=90,in=180,looseness=1]
(1,2)to[out=0,in=90,looseness=1]
(1.5,0.5)to[out=-90,in=0,looseness=1]
(0,-0.5) to[out=180,in=-90,looseness=1]
(-1,0)
;
\end{knot}
\draw (0,-2.4) node{Mirror image of $8_{17}$};
\end{scope}
\end{tikzpicture}


\end{document}

답변1

이것이 여전히 관련된 질문인지는 모르겠지만 어쨌든 여기에 답변이 있습니다. 이전에 이 질문을 발견하지 못해 죄송합니다. (저는 예전처럼 여기에서 활동하지 않습니다.)

어쨌든 코드에 몇 가지 문제가 있습니다. 하나는 공백을 무시하는 것입니다! 그것들은 매우 중요합니다. 그래서 나는 그것들을 고쳤습니다.

그런 다음 line cap=round. 이것은 매듭의 시작 끝점에서 이상한 일을 하고 있었습니다. 그래서 그것도 없어졌습니다.

가장 중요한 것은 모든 교차점이 가닥의 세그먼트 끝점에 매우 가깝다는 것입니다. 그래서 당신은 필요했습니다 ignore endpoint intersections=false. 키 end tolerance가 사진에 차이를 만들지 않는 것 같지만 교차점이 서로 매우 가깝기 때문에 클립 반경과 클립 너비를 신중하게 설정해야 합니다.

숫자를 가지고 약간의 놀이를 한 후에 제가 결론을 내린 것은 다음과 같습니다.

\documentclass[12pt]{standalone}
%\url{http://tex.stackexchange.com/q/241258/86}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,decorations.pathreplacing,decorations.shapes,decorations.markings,knots}

\begin{document}
\begin{tikzpicture}
\path (-1.2,-2.2)--(1.7,2.2);
\begin{knot}[
scale=0.8,
%draft mode=crossings,
  consider self intersections=true,
  ignore endpoint intersections=false,
%end tolerance=1pt,
clip radius=8pt,
clip width=1,
flip crossing=6,
flip crossing=4,
flip crossing=7,
flip crossing=2,
line width=2pt,
only when rendering/.style={
  white,
  double=black,
  double distance=6pt,
},
]
\strand
(-1,0) to[out=90,in=180,looseness=1]
(0,0.5) to[out=0,in=90,looseness=1]
(1.5,-0.5) to[out=-90,in=0,looseness=1] 
(1,-1) --
(-1,-1) to [out=180,in=180,looseness=1]
(-1,1.5) to [out=0,in=90,looseness=1]
(0.5,0.5) --(0.5,-1) to[out=-90,in=-90,looseness=2.9]
(-0.5,-1)--(-0.5,0.5) to[out=90,in=180,looseness=1]
(1,1.5)to[out=0,in=90,looseness=1]
(1.5,0.5)to[out=-90,in=0,looseness=1]
(0,-0.5) to[out=180,in=-90,looseness=1]
(-1,0)
;
\end{knot}
\draw (0,-2.4) node{$8_{17}$};
\begin{scope}[xshift=4cm]
\begin{knot}[
consider self intersections=true,
clip width=2,
flip crossing=1,
flip crossing=3,
flip crossing=5,
flip crossing=8,
]
\strand
(-1,0) to[out=90,in=180,looseness=1]
(0,0.5) to[out=0,in=90,looseness=1]
(1.5,-0.5) to[out=-90,in=0,looseness=1] 
(1,-1.5) --
(-1,-1.5) to [out=180,in=180,looseness=1]
(-1,2) to [out=0,in=90,looseness=1]
(0.5,1) --(0.5,-1) to[out=-90,in=-90,looseness=2.9]
(-0.5,-1)--(-0.5,1) to[out=90,in=180,looseness=1]
(1,2)to[out=0,in=90,looseness=1]
(1.5,0.5)to[out=-90,in=0,looseness=1]
(0,-0.5) to[out=180,in=-90,looseness=1]
(-1,0)
;
\end{knot}
\draw (0,-2.4) node{Mirror image of $8_{17}$};
\end{scope}
\end{tikzpicture}


\end{document}

매듭

관련 정보