如何使用绘制的圆弧作为边框?

如何使用绘制的圆弧作为边框?

问题写在标题中,我得到了灰色填充部分,它必须适合弧线。我手动完成了,但我想不出更好的解决方案。提前谢谢你,Leo。

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{3D, calc, matrix}
\usepackage{tikz}
\usepackage{mathcomp}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{caption}
\begin{document}
    \begin{figure}
        \centering
        \begin{tikzpicture}


        %3D-Koordinatensystem:
        \draw[->, >=latex] (-5,0,0) -- (5,0,0) node[below]{$a$};
        \draw[->, >=latex] (0,-4,0) -- (0,5,0) node[left]{$b$}; 
        \draw[->, >=latex] (0,0,-8) -- (0,0,8) node[left]{$c$};
        %\draw[dotted, ->, >=latex] (0,0,-8) -- (0,0,8) node[left]{};
        %\draw[->, >=latex] (0,0,4.7) -- (0,0,8) node[left]{$c$};


    \filldraw [color=gray, rotate=109] (-1.2,-3.50) arc (190:340:0.8cm and 0.15cm) -- (0,0) -- cycle;
    \draw [thick, rotate=123.6] (-2,-3) arc (177:360:2cm and 0.5cm) -- (0,0) -- cycle;
    \draw [rotate=124] [dashed] (-2,-3) arc (180:0:2cm and 0.5cm);


    \filldraw [color=gray, rotate=-70] (-1.23,-3.44) arc (188:340:0.9cm and 0.17cm) -- (0,0) -- cycle;
    \draw [thick, rotate=-56] (-2,-3) arc (180:0:2cm and 0.5cm) -- (0,0) -- cycle;
    \draw [thick, rotate=-56] (-2,-3) arc (180:360:2cm and 0.5cm);


        \end{tikzpicture}
%   \caption {$Variety \big\{ (a,b,c) \in \protect\mathbb{R}^3;det$ $\begin{bmatrix} a & b\\ b & c\\
%   \end{bmatrix}$ $=0$ $\big\}$}
%   \label {Figure 5.1:}    

    \end{figure}
\end{document}

在此处输入图片描述

答案1

描述了两种保存和重用路径的方法这里。第二种方法是下列代码片段的基础。

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, matrix,intersections,backgrounds}
\usepackage{mathcomp}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{caption}
% from https://tex.stackexchange.com/a/127045/121799
\tikzset{
  saveuse path/.code 2 args={
    \pgfkeysalso{#1/.estyle={insert path={#2}}}%
    \global\expandafter\let\csname pgfk@\pgfkeyscurrentpath/.@cmd\expandafter\endcsname % not optimal as it is now global through out the document
                           \csname pgfk@\pgfkeyscurrentpath/.@cmd\endcsname
    \pgfkeysalso{#1}%
  }
}

\begin{document}
        \begin{tikzpicture}


        %3D-Koordinatensystem:
        \draw[->, >=latex] (-5,0,0) -- (5,0,0) node[below]{$a$};
        \draw[->, >=latex] (0,-4,0) -- (0,5,0) node[left]{$b$}; 
        \draw[->, >=latex] (0,0,-8) -- (0,0,8) node[left]{$c$};
        %\draw[dotted, ->, >=latex] (0,0,-8) -- (0,0,8) node[left]{};
        %\draw[->, >=latex] (0,0,4.7) -- (0,0,8) node[left]{$c$};

    \begin{scope}[rotate=123.6]
    \draw [thick ,saveuse path={pathA}{(-2,-3) arc (177:360:2cm and
    0.5cm) -- (0,0) -- cycle}];
    \draw  [dashed] (-2,-3) arc (180:0:2cm and 0.5cm);
     \begin{scope}[on background layer]
     \clip (0,0) --(-2,-3) --(-1.2,-5)--cycle;
     \fill[gray][pathA];
     \end{scope}
    \end{scope}

    \begin{scope}[rotate=-56]
    \draw [thick, saveuse path={pathB}{ (-2,-3) arc (180:360:2cm and
    0.5cm) -- (0,0) -- cycle}];
     \begin{scope}
    \clip (0,0) --(-2,-3) --(-1.2,-5)--cycle;
    \fill[gray][pathB];
     \end{scope}
    \draw [thick] (-2,-3) arc (180:0:2cm and 0.5cm);
    \end{scope}

    \end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容