Tikz - 在两条线之间绘制部分圆圈

Tikz - 在两条线之间绘制部分圆圈

因此,我尝试绘制一个三角形外圆,但我不需要圆心点以外的额外圆。如何绘制部分圆?有没有办法切断这些部分?

这是我目前的绘图代码

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{through,calc,intersections}

\usepackage{xparse}
\NewDocumentCommand{\bissectrice}{%
    O{}     % drawing options
    mmm     % bissector of mmm
    m       % intersection point between base and bissector
    O{1}O{1}% extended drawing of the bissector
    }{%
    \path[name path=Bis#2#3#4] let
        \p1 = ($(#2) - (#3)$),
        \p2 = ($(#4) - (#3)$),
        \n1 = {veclen(\x1,\y1)/2} ,
        \n2 = {veclen(\x2,\y2)/2} ,
        \n3 = {max(\n1,\n2)},
        \p1 = ($(#3)!\n3!(#2)$),
        \p2 = ($(#3)!\n3!(#4)$),
        \p3 = ($(\p1) + (\p2) - (#3)$)
    in
        (#3) -- (\p3) ;

    \path[name path = foo] (#2)--(#4) ;

    \path[name intersections={of=foo and Bis#2#3#4, by=#5}] ;

    \path[#1] ($(#3)!#6!(#5)$) -- ($(#5)!#7!(#3)$) ;
    }
\begin{document}
\begin{tikzpicture}[scale=0.3]
\coordinate (A) at (0,0);
\coordinate (A2) at (-3,0);
\coordinate (A1) at (-4,-5);
\coordinate (B) at (4,5);
\coordinate (B1) at (8,10);
\coordinate (B2) at (1,10);
\coordinate (C) at (7,0);
\coordinate (C1) at (10,0);
\coordinate (C2) at (10, -5);
\draw (A)--(B)--(C)--(A);
\draw (A1)--(B1) (B2)--(C2) (C1)--(A2);
\bissectrice {B}{A}{C}{A5};
\bissectrice {A}{B}{C}{B5};
\bissectrice {A}{C}{B}{C5};
\bissectrice {A1}{A}{C}{A3};
\bissectrice {A2}{A}{B}{A4};
\bissectrice {A}{C}{C2}{C3};
\bissectrice {C1}{C}{B}{C4};
\bissectrice {B1}{B}{C}{B3};
\bissectrice {B2}{B}{A}{B4};
\coordinate[label=0:$O_a$] (Oa) at (intersection 1 of A--A3 and C--C3);
\node [draw=black] at (Oa) [circle through={($(A)!(Oa)!(C)$)}]{};
\coordinate[label=-135:$O_b$] (Ob) at (intersection 1 of A--A4 and B4--B);
\node [draw=black] at (Ob) [circle through={($(A)!(Ob)!(B)$)}]{};
\coordinate[label=45:$O_c$] (Oc) at (intersection 1 of B3--B and C--C4);
\node [draw=black] at (Oc) [circle through={($(B)!(Oc)!(C)$)}]{};
\draw (Oa)--node[label=0:$r_a$]{}($(A)!(Oa)!(C)$) (Ob)--node[label=45:$r_b$]{}($(A)!(Ob)!(B)$) (Oc)--node[label=90:$r_c$]{}($(B)!(Oc)!(C)$);
\coordinate (O) at (intersection 1 of A5--A and B5--B);
\draw (O)-- node[label=right:$r$]{}($(A)!(O)!(C)$);
\node [draw=black] at (O) [circle through={($(A)!(O)!(C)$)}]{};
\end{tikzpicture}
\end{document}

我有的图纸:

当前绘图

我想要的图纸:

在此处输入图片描述

答案1

正如 Torbjørn 所建议的,你可以绘制clip整个图表。我用一个矩形作为底面,A1并以 和为基础绘制了整个图表B1

\clip ([shift={(-2,-2)}]A1) rectangle ([shift={(3,-2)}]B1);

但您可以选择另一个剪切路径。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{through,calc,intersections}

\usepackage{xparse}
\NewDocumentCommand{\bissectrice}{%
    O{}     % drawing options
    mmm     % bissector of mmm
    m       % intersection point between base and bissector
    O{1}O{1}% extended drawing of the bissector
    }{%
    \path[name path=Bis#2#3#4] let
        \p1 = ($(#2) - (#3)$),
        \p2 = ($(#4) - (#3)$),
        \n1 = {veclen(\x1,\y1)/2} ,
        \n2 = {veclen(\x2,\y2)/2} ,
        \n3 = {max(\n1,\n2)},
        \p1 = ($(#3)!\n3!(#2)$),
        \p2 = ($(#3)!\n3!(#4)$),
        \p3 = ($(\p1) + (\p2) - (#3)$)
    in
        (#3) -- (\p3) ;

    \path[name path = foo] (#2)--(#4) ;

    \path[name intersections={of=foo and Bis#2#3#4, by=#5}] ;

    \path[#1] ($(#3)!#6!(#5)$) -- ($(#5)!#7!(#3)$) ;
    }
\begin{document}
\begin{tikzpicture}[scale=0.3]
\coordinate (A) at (0,0);
\coordinate (A2) at (-3,0);
\coordinate (A1) at (-4,-5);
\coordinate (B) at (4,5);
\coordinate (B1) at (8,10);
\coordinate (B2) at (1,10);
\coordinate (C) at (7,0);
\coordinate (C1) at (10,0);
\coordinate (C2) at (10, -5);
\clip ([shift={(-2,-2)}]A1) rectangle ([shift={(3,-2)}]B1);
\draw (A)--(B)--(C)--(A);
\draw (A1)--(B1) (B2)--(C2) (C1)--(A2);
\bissectrice {B}{A}{C}{A5};
\bissectrice {A}{B}{C}{B5};
\bissectrice {A}{C}{B}{C5};
\bissectrice {A1}{A}{C}{A3};
\bissectrice {A2}{A}{B}{A4};
\bissectrice {A}{C}{C2}{C3};
\bissectrice {C1}{C}{B}{C4};
\bissectrice {B1}{B}{C}{B3};
\bissectrice {B2}{B}{A}{B4};
\coordinate[label=0:$O_a$] (Oa) at (intersection 1 of A--A3 and C--C3);
\node [draw=black] at (Oa) [circle through={($(A)!(Oa)!(C)$)}]{};
\coordinate[label=-135:$O_b$] (Ob) at (intersection 1 of A--A4 and B4--B);
\node [draw=black] at (Ob) [circle through={($(A)!(Ob)!(B)$)}]{};
\coordinate[label=45:$O_c$] (Oc) at (intersection 1 of B3--B and C--C4);
\node [draw=black] at (Oc) [circle through={($(B)!(Oc)!(C)$)}]{};
\draw (Oa)--node[label=0:$r_a$]{}($(A)!(Oa)!(C)$) (Ob)--node[label=45:$r_b$]{}($(A)!(Ob)!(B)$) (Oc)--node[label=90:$r_c$]{}($(B)!(Oc)!(C)$);
\coordinate (O) at (intersection 1 of A5--A and B5--B);
\draw (O)-- node[label=right:$r$]{}($(A)!(O)!(C)$);
\node [draw=black] at (O) [circle through={($(A)!(O)!(C)$)}]{};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容