省略绘制部分图纸轮廓

省略绘制部分图纸轮廓

从答案到这个问题,我使用以下代码绘制了一个十字形的象限:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{}
\includegraphics[width=6.6cm,keepaspectratio]{./cross_coptic.jpg}
\vskip -6.5cm
\hskip .04cm
\begin{tikzpicture}[scale=.9, transform shape]
\node [red] at (0,0) (o){\bf .}%do not insert empty lines inbetween
([shift={(90.:3.4cm)}]o.center) node [red] (t){\bf .}%topmost
([shift={(180.:3.38cm)}]o.center) node [red] (ol){\bf .}
([shift={(90.:.6cm)}]o.center) node [red] (oua){\bf .}%up 1 level
([shift={(180.:.6cm)}]oua.center) node [red] (oual){\bf .}
([shift={(90.:2.1cm)}]o.center) node [red] (ouaaa){\bf .}%up 3 levels
([shift={(180.:1.6cm)}]ouaaa.center) node [red] (ouaaal){\bf .}
([shift={(90.:2.45cm)}]o.center) node [red] (ouaaaa){\bf .}%up 4 levels
([shift={(180.:.6cm)}]ouaaaa.center) node [red] (ouaaaal){\bf .}
;
\draw[line width=.1cm,red, fill=red!20!white] (oual.center)
 to [out=90,in=-20, looseness=1.] (ouaaal.center)
 to [out=50,in=180, looseness=1.] (ouaaaal.center)
 to [out=90,in=-150, looseness=1.] (t.center)
 to [out=-90,in=90, looseness=1.] (o.center)
 to [out=180,in=0, looseness=1.] ([shift={(-90:.6)}]oual.center)
 -- cycle
;
\end{tikzpicture}
\end{frame}
\end{document}

在此处输入图片描述

在此处输入图片描述

是否可以省略绘制十字架内的轮廓(连接节点 t -- o -- shift={(-90:.6)}]oual -- oual),继续填充象限?

答案1

\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{spath3}
\begin{document}
\begin{tikzpicture}
\path[spath/save=apath] (-1,1) -- (-1,2) to[out=100, in=-20] (-2.6,3.4) to[out=45, in=180] (-1,4.2) to[out=90, in=210] (0,5.6);
\draw[line width=6pt] 
[spath/use={apath}]
[spath/use={apath, move, weld, transform={xscale=-1, rotate=0}, reverse}]
[spath/use={apath, move, weld, transform={scale=-1, rotate=90}}]
[spath/use={apath, move, weld, transform={xscale=-1, rotate=90}, reverse}]
[spath/use={apath, move, weld, transform={scale=-1, rotate=0}}]
[spath/use={apath, move, weld, transform={yscale=-1, rotate=0}, reverse}]
[spath/use={apath, move, weld, transform={scale=-1, rotate=-90}}]
[spath/use={apath, move, weld, transform={xscale=-1, rotate=-90}, reverse}]
-- cycle;
\fill[red!20] (0,0) -- (-1,0) [spath/use={apath, weld}] --cycle;
\draw[red, line width=6pt] [spath/use={apath}];
\end{tikzpicture}
\end{document}

带有四分之一粉红色的十字符号

答案2

请注意,您肯定想做什么,但您可以通过替换\draw来删除绘制的线条,同时保留背景填充\fill,如下所示:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\usepackage{verbatim}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{}
%\includegraphics[width=6.6cm,keepaspectratio]{./cross_coptic.jpg}
%\vskip -6.5cm
%\hskip .04cm
\begin{tikzpicture}[scale=.9, transform shape]
\node at (0,0) (o){}%do not insert empty lines inbetween
([shift={(90.:3.4cm)}]o.center) node (t){}%topmost
([shift={(180.:3.38cm)}]o.center) node (ol){}
([shift={(90.:.6cm)}]o.center) node (oua){}%up 1 level
([shift={(180.:.6cm)}]oua.center) node  (oual){}
([shift={(90.:2.1cm)}]o.center) node (ouaaa){}%up 3 levels
([shift={(180.:1.6cm)}]ouaaa.center) node (ouaaal){}
([shift={(90.:2.45cm)}]o.center) node (ouaaaa){}%up 4 levels
([shift={(180.:.6cm)}]ouaaaa.center) node (ouaaaal){}
;
\fill[red!20!white] (oual.center)
 to [out=90,in=-20, looseness=1.] (ouaaal.center)
 to [out=50,in=180, looseness=1.] (ouaaaal.center)
 to [out=90,in=-150, looseness=1.] (t.center)
 to [out=-90,in=90, looseness=1.] (o.center)
 to [out=180,in=0, looseness=1.] ([shift={(-90:.6)}]oual.center)
 -- cycle
;

\end{tikzpicture}
\end{frame}
\end{document}

请注意,由于我没有,我注释掉了包含的图cross_coptic.jpg。您可以取消注释第 8 行至第 10 行。

相关内容