填写 tikz 路径

填写 tikz 路径

我有一个由 svg2tikz 生成的 tikz 路径。我想填充此路径内部,但 tikz 仅填充曲线的一部分。

\documentclass{standalone}
\usepackage{tikz}

\begin{document}

    \begin{tikzpicture}[y=0.80pt, x=0.80pt, scale = 0.5, xscale=-1]

    \path[draw=black,fill=red,line join=round,line cap=round,miter limit=10.00,line
    width=1.152pt] (236.1551,372.7024) -- (164.5751,372.1624)(164.5751,372.1624)
    -- (136.8551,371.0224)(-265.0249,319.1824) --
    (-252.4249,319.1824)(358.6151,243.0424) --
    (370.3751,284.6824)(358.6151,243.0424) --
    (358.6151,224.8624)(236.1551,372.7024) --
    (242.9951,372.7024)(242.9951,372.7024) -- (243.5351,372.7024) .. controls
    (256.3591,372.9774) and (264.5721,370.5524) .. (275.4551,363.7024) --
    (276.0551,363.3424) -- (276.5951,362.9824) .. controls (286.7211,356.6404) and
    (298.3241,345.8414) .. (310.6751,345.2224) --
    (311.8151,345.2224)(375.8951,336.8224) --
    (375.8951,332.0224)(-252.4249,338.4424) --
    (69.7151,366.5824)(-270.5449,219.3424) --
    (-270.5449,287.4424)(-248.5249,213.1624) --
    (-264.3649,213.1624)(-226.5049,207.6424) --
    (-248.5249,213.1624)(-226.5049,207.6424) -- (-226.2649,207.0424) --
    (-225.9049,206.4424) -- (-225.4849,205.9024) --
    (-225.0649,205.4224)(-225.0649,205.4224) -- (-224.2849,204.7624) .. controls
    (-222.5349,203.3134) and (-220.2839,202.5944) .. (-218.0449,202.4824) --
    (-217.5649,202.4824)(-209.9449,202.4824) --
    (-217.5649,202.4824)(-42.1849,224.8624) --
    (358.6151,224.8624)(-154.9849,206.0224) -- (-196.9849,203.0224) --
    (-209.9449,202.4824)(375.8951,332.0224) --
    (370.3751,284.6824)(69.7151,366.6424) --
    (136.8551,371.0224)(-154.9849,206.0224) --
    (-42.1849,224.8624)(-265.0249,319.1824) --
    (-270.5449,313.6624)(-252.4249,338.4424) --
    (-252.4249,319.1824)(-270.5449,313.6624) --
    (-270.5449,287.4424)(-264.3649,213.1624) -- (-264.9049,213.1624) .. controls
    (-267.8639,213.4214) and (-270.2949,215.8474) .. (-270.4849,218.8024) --
    (-270.5449,219.3424)(311.8151,345.2224) --
    (311.8151,338.3224)(311.8151,338.3224) --
    (318.6551,338.3224)(318.6551,338.3224) --
    (318.6551,345.2224)(318.6551,345.2224) --
    (367.4951,345.2224)(367.4951,345.2224) -- (368.2751,345.1624) .. controls
    (372.2011,344.8734) and (375.6141,341.4814) .. (375.8351,337.5424) --
    (375.8951,336.8224);

    \end{tikzpicture}

\end{document}

答案1

当您尝试寻找如何指示 svg2tikz 构建唯一路径时,只要有一点耐心,您就可以手动完成。

\documentclass[border=2mm]{standalone}
\usepackage{tikz}

\begin{document}

    \begin{tikzpicture}[y=0.80pt, x=0.80pt, scale = 0.5, xscale=-1]

    \path[draw=black,fill=red,line join=round,line cap=round,miter limit=10.00,line
    width=1.152pt] (236.1551,372.7024) -- 
    (164.5751,372.1624) -- (136.8551,371.0224) -- (69.7151,366.6424) -- (-252.4249,338.4424) -- (-252.4249,319.1824)
-- (-265.0249,319.1824) -- (-270.5449,313.6624) -- (-270.5449,287.4424) -- (-270.5449,219.3424) -- (-270.4849,218.8024) .. controls
    (-270.2949,215.8474) and (-267.8639,213.4214) .. (-264.9049,213.1624) -- (-264.3649,213.1624) -- (-248.5249,213.1624) -- (-226.5049,207.6424) -- (-226.2649,207.0424) -- (-225.9049,206.4424) -- (-225.4849,205.9024) -- (-225.0649,205.4224) -- (-224.2849,204.7624) .. controls
    (-220.2839,202.5944) and (-222.5349,203.3134) .. (-218.0449,202.4824) --
    (-217.5649,202.4824) -- (-209.9449,202.4824) -- (-196.9849,203.0224) --
    (-154.9849,206.0224) -- (-42.1849,224.8624) -- (358.6151,224.8624) --(358.6151,243.0424) -- (370.3751,284.6824) -- (375.8951,332.0224) -- (375.8951,336.8224)
    -- (375.8351,337.5424) .. controls (375.6141,341.4814)
     and (372.2011,344.8734) .. (368.2751,345.1624) --(367.4951,345.2224) -- (318.6551,345.2224) -- (318.6551,338.3224) -- (311.8151,338.3224) -- (311.8151,345.2224)
    -- (310.6751,345.2224) .. controls (298.3241,345.8414) and (286.7211,356.6404) ..
(276.5951,362.9824) -- (276.0551,363.3424) -- (275.4551,363.7024) .. controls
    (264.5721,370.5524) and (256.3591,372.9774) .. (243.5351,372.7024) -- (242.9951,372.7024) -- (236.1551,372.7024) 
    ;
    \end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容