Custom shape shows unwanted extra line












4















documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}
draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) -- (-4.261,2.617) arc (148.44:321.42:5);
end{tikzpicture}
end{document}


This is supposed to be a closed custom shape WITHOUT the straight line!



enter image description here



How can I get rid of this unwanted line?



Putting '-- cycle' at the end makes no difference.










share|improve this question




















  • 2





    You have an extra -- (-4.261,2.617) which draws a straight line to the start point of the path. Remove that and swap the start and end angles of the arc: draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) arc (321.42:148.44:5);.

    – Phelype Oleinik
    Feb 25 at 20:44











  • @PhelypeOleinik Yes, that's the probably best solution here. You should write an answer.

    – marmot
    Feb 25 at 21:46
















4















documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}
draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) -- (-4.261,2.617) arc (148.44:321.42:5);
end{tikzpicture}
end{document}


This is supposed to be a closed custom shape WITHOUT the straight line!



enter image description here



How can I get rid of this unwanted line?



Putting '-- cycle' at the end makes no difference.










share|improve this question




















  • 2





    You have an extra -- (-4.261,2.617) which draws a straight line to the start point of the path. Remove that and swap the start and end angles of the arc: draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) arc (321.42:148.44:5);.

    – Phelype Oleinik
    Feb 25 at 20:44











  • @PhelypeOleinik Yes, that's the probably best solution here. You should write an answer.

    – marmot
    Feb 25 at 21:46














4












4








4


1






documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}
draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) -- (-4.261,2.617) arc (148.44:321.42:5);
end{tikzpicture}
end{document}


This is supposed to be a closed custom shape WITHOUT the straight line!



enter image description here



How can I get rid of this unwanted line?



Putting '-- cycle' at the end makes no difference.










share|improve this question
















documentclass{article}
usepackage{tikz}
begin{document}
begin{tikzpicture}
draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) -- (-4.261,2.617) arc (148.44:321.42:5);
end{tikzpicture}
end{document}


This is supposed to be a closed custom shape WITHOUT the straight line!



enter image description here



How can I get rid of this unwanted line?



Putting '-- cycle' at the end makes no difference.







tikz-pgf shapes






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 25 at 20:35







Petoetje59

















asked Feb 25 at 20:28









Petoetje59Petoetje59

4841616




4841616








  • 2





    You have an extra -- (-4.261,2.617) which draws a straight line to the start point of the path. Remove that and swap the start and end angles of the arc: draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) arc (321.42:148.44:5);.

    – Phelype Oleinik
    Feb 25 at 20:44











  • @PhelypeOleinik Yes, that's the probably best solution here. You should write an answer.

    – marmot
    Feb 25 at 21:46














  • 2





    You have an extra -- (-4.261,2.617) which draws a straight line to the start point of the path. Remove that and swap the start and end angles of the arc: draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) arc (321.42:148.44:5);.

    – Phelype Oleinik
    Feb 25 at 20:44











  • @PhelypeOleinik Yes, that's the probably best solution here. You should write an answer.

    – marmot
    Feb 25 at 21:46








2




2





You have an extra -- (-4.261,2.617) which draws a straight line to the start point of the path. Remove that and swap the start and end angles of the arc: draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) arc (321.42:148.44:5);.

– Phelype Oleinik
Feb 25 at 20:44





You have an extra -- (-4.261,2.617) which draws a straight line to the start point of the path. Remove that and swap the start and end angles of the arc: draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118) arc (321.42:148.44:5);.

– Phelype Oleinik
Feb 25 at 20:44













@PhelypeOleinik Yes, that's the probably best solution here. You should write an answer.

– marmot
Feb 25 at 21:46





@PhelypeOleinik Yes, that's the probably best solution here. You should write an answer.

– marmot
Feb 25 at 21:46










2 Answers
2






active

oldest

votes


















7














I saw Phelype's comment and deleted the post. Now I am undeleting it per request. But I will be happy to delete it again. In any case, full credits go to Phelype Oleinik, who was the first to propose a solution.



In fact, I like Phelype's proposal better than "just removing the line". Here is why:



documentclass{article}
usepackage{tikz}
begin{document}
Reversing the arc:
begin{tikzpicture}
draw[fill=blue] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
arc (321.42:148.44:5);
end{tikzpicture}

Just removing the line:
begin{tikzpicture}
draw[fill=red] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
(-4.261,2.617) arc (148.44:321.42:5);
end{tikzpicture}
end{document}


enter image description here



The blue corresponds to what I would suggest, namely reversing the arc, and the red one "removing the line", which works at the level of the contour but does not yield a continuous path.



And here is a second reason why I like Phelype's method better.



documentclass[border=1cm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}
draw [line width=1mm,line join=round]
(-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
arc (321.42:148.44:5) -- cycle;
end{tikzpicture}
%
begin{tikzpicture}
draw [line width=1mm,line join=round]
(-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
(-4.261,2.617) arc (148.44:321.42:5);
draw[red] (-4.261,2.617) circle[radius=3mm]
(3.908,-3.118) circle[radius=3mm];
end{tikzpicture}
%

end{document}


enter image description here






share|improve this answer

































    7














    I didn't know that the path has to be filled. So I update my answer as follows:




    1. remove -- from the path and

    2. pass the option even odd rule if the filling is needed.


    Answer updated to add a hole in the fill



    documentclass[border=1cm]{standalone}
    usepackage{tikz}
    begin{document}
    begin{tikzpicture}
    draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
    (-4.261,2.617) arc (148.44:321.42:5);
    end{tikzpicture}
    %
    begin{tikzpicture}
    draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
    (-4.261,2.617) arc (148.44:321.42:5) (-2,-2)circle[radius=1];
    end{tikzpicture}
    %
    begin{tikzpicture}
    draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
    (-4.261,2.617) arc (148.44:321.42:5);
    end{tikzpicture}

    end{document}


    enter image description here






    share|improve this answer


























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "85"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476653%2fcustom-shape-shows-unwanted-extra-line%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      7














      I saw Phelype's comment and deleted the post. Now I am undeleting it per request. But I will be happy to delete it again. In any case, full credits go to Phelype Oleinik, who was the first to propose a solution.



      In fact, I like Phelype's proposal better than "just removing the line". Here is why:



      documentclass{article}
      usepackage{tikz}
      begin{document}
      Reversing the arc:
      begin{tikzpicture}
      draw[fill=blue] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
      arc (321.42:148.44:5);
      end{tikzpicture}

      Just removing the line:
      begin{tikzpicture}
      draw[fill=red] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
      (-4.261,2.617) arc (148.44:321.42:5);
      end{tikzpicture}
      end{document}


      enter image description here



      The blue corresponds to what I would suggest, namely reversing the arc, and the red one "removing the line", which works at the level of the contour but does not yield a continuous path.



      And here is a second reason why I like Phelype's method better.



      documentclass[border=1cm]{standalone}
      usepackage{tikz}
      begin{document}
      begin{tikzpicture}
      draw [line width=1mm,line join=round]
      (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
      arc (321.42:148.44:5) -- cycle;
      end{tikzpicture}
      %
      begin{tikzpicture}
      draw [line width=1mm,line join=round]
      (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
      (-4.261,2.617) arc (148.44:321.42:5);
      draw[red] (-4.261,2.617) circle[radius=3mm]
      (3.908,-3.118) circle[radius=3mm];
      end{tikzpicture}
      %

      end{document}


      enter image description here






      share|improve this answer






























        7














        I saw Phelype's comment and deleted the post. Now I am undeleting it per request. But I will be happy to delete it again. In any case, full credits go to Phelype Oleinik, who was the first to propose a solution.



        In fact, I like Phelype's proposal better than "just removing the line". Here is why:



        documentclass{article}
        usepackage{tikz}
        begin{document}
        Reversing the arc:
        begin{tikzpicture}
        draw[fill=blue] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
        arc (321.42:148.44:5);
        end{tikzpicture}

        Just removing the line:
        begin{tikzpicture}
        draw[fill=red] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
        (-4.261,2.617) arc (148.44:321.42:5);
        end{tikzpicture}
        end{document}


        enter image description here



        The blue corresponds to what I would suggest, namely reversing the arc, and the red one "removing the line", which works at the level of the contour but does not yield a continuous path.



        And here is a second reason why I like Phelype's method better.



        documentclass[border=1cm]{standalone}
        usepackage{tikz}
        begin{document}
        begin{tikzpicture}
        draw [line width=1mm,line join=round]
        (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
        arc (321.42:148.44:5) -- cycle;
        end{tikzpicture}
        %
        begin{tikzpicture}
        draw [line width=1mm,line join=round]
        (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
        (-4.261,2.617) arc (148.44:321.42:5);
        draw[red] (-4.261,2.617) circle[radius=3mm]
        (3.908,-3.118) circle[radius=3mm];
        end{tikzpicture}
        %

        end{document}


        enter image description here






        share|improve this answer




























          7












          7








          7







          I saw Phelype's comment and deleted the post. Now I am undeleting it per request. But I will be happy to delete it again. In any case, full credits go to Phelype Oleinik, who was the first to propose a solution.



          In fact, I like Phelype's proposal better than "just removing the line". Here is why:



          documentclass{article}
          usepackage{tikz}
          begin{document}
          Reversing the arc:
          begin{tikzpicture}
          draw[fill=blue] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
          arc (321.42:148.44:5);
          end{tikzpicture}

          Just removing the line:
          begin{tikzpicture}
          draw[fill=red] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
          (-4.261,2.617) arc (148.44:321.42:5);
          end{tikzpicture}
          end{document}


          enter image description here



          The blue corresponds to what I would suggest, namely reversing the arc, and the red one "removing the line", which works at the level of the contour but does not yield a continuous path.



          And here is a second reason why I like Phelype's method better.



          documentclass[border=1cm]{standalone}
          usepackage{tikz}
          begin{document}
          begin{tikzpicture}
          draw [line width=1mm,line join=round]
          (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
          arc (321.42:148.44:5) -- cycle;
          end{tikzpicture}
          %
          begin{tikzpicture}
          draw [line width=1mm,line join=round]
          (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
          (-4.261,2.617) arc (148.44:321.42:5);
          draw[red] (-4.261,2.617) circle[radius=3mm]
          (3.908,-3.118) circle[radius=3mm];
          end{tikzpicture}
          %

          end{document}


          enter image description here






          share|improve this answer















          I saw Phelype's comment and deleted the post. Now I am undeleting it per request. But I will be happy to delete it again. In any case, full credits go to Phelype Oleinik, who was the first to propose a solution.



          In fact, I like Phelype's proposal better than "just removing the line". Here is why:



          documentclass{article}
          usepackage{tikz}
          begin{document}
          Reversing the arc:
          begin{tikzpicture}
          draw[fill=blue] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
          arc (321.42:148.44:5);
          end{tikzpicture}

          Just removing the line:
          begin{tikzpicture}
          draw[fill=red] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
          (-4.261,2.617) arc (148.44:321.42:5);
          end{tikzpicture}
          end{document}


          enter image description here



          The blue corresponds to what I would suggest, namely reversing the arc, and the red one "removing the line", which works at the level of the contour but does not yield a continuous path.



          And here is a second reason why I like Phelype's method better.



          documentclass[border=1cm]{standalone}
          usepackage{tikz}
          begin{document}
          begin{tikzpicture}
          draw [line width=1mm,line join=round]
          (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
          arc (321.42:148.44:5) -- cycle;
          end{tikzpicture}
          %
          begin{tikzpicture}
          draw [line width=1mm,line join=round]
          (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
          (-4.261,2.617) arc (148.44:321.42:5);
          draw[red] (-4.261,2.617) circle[radius=3mm]
          (3.908,-3.118) circle[radius=3mm];
          end{tikzpicture}
          %

          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 26 at 16:07

























          answered Feb 25 at 21:23









          marmotmarmot

          113k5145274




          113k5145274























              7














              I didn't know that the path has to be filled. So I update my answer as follows:




              1. remove -- from the path and

              2. pass the option even odd rule if the filling is needed.


              Answer updated to add a hole in the fill



              documentclass[border=1cm]{standalone}
              usepackage{tikz}
              begin{document}
              begin{tikzpicture}
              draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
              (-4.261,2.617) arc (148.44:321.42:5);
              end{tikzpicture}
              %
              begin{tikzpicture}
              draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
              (-4.261,2.617) arc (148.44:321.42:5) (-2,-2)circle[radius=1];
              end{tikzpicture}
              %
              begin{tikzpicture}
              draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
              (-4.261,2.617) arc (148.44:321.42:5);
              end{tikzpicture}

              end{document}


              enter image description here






              share|improve this answer






























                7














                I didn't know that the path has to be filled. So I update my answer as follows:




                1. remove -- from the path and

                2. pass the option even odd rule if the filling is needed.


                Answer updated to add a hole in the fill



                documentclass[border=1cm]{standalone}
                usepackage{tikz}
                begin{document}
                begin{tikzpicture}
                draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                (-4.261,2.617) arc (148.44:321.42:5);
                end{tikzpicture}
                %
                begin{tikzpicture}
                draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                (-4.261,2.617) arc (148.44:321.42:5) (-2,-2)circle[radius=1];
                end{tikzpicture}
                %
                begin{tikzpicture}
                draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                (-4.261,2.617) arc (148.44:321.42:5);
                end{tikzpicture}

                end{document}


                enter image description here






                share|improve this answer




























                  7












                  7








                  7







                  I didn't know that the path has to be filled. So I update my answer as follows:




                  1. remove -- from the path and

                  2. pass the option even odd rule if the filling is needed.


                  Answer updated to add a hole in the fill



                  documentclass[border=1cm]{standalone}
                  usepackage{tikz}
                  begin{document}
                  begin{tikzpicture}
                  draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                  (-4.261,2.617) arc (148.44:321.42:5);
                  end{tikzpicture}
                  %
                  begin{tikzpicture}
                  draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                  (-4.261,2.617) arc (148.44:321.42:5) (-2,-2)circle[radius=1];
                  end{tikzpicture}
                  %
                  begin{tikzpicture}
                  draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                  (-4.261,2.617) arc (148.44:321.42:5);
                  end{tikzpicture}

                  end{document}


                  enter image description here






                  share|improve this answer















                  I didn't know that the path has to be filled. So I update my answer as follows:




                  1. remove -- from the path and

                  2. pass the option even odd rule if the filling is needed.


                  Answer updated to add a hole in the fill



                  documentclass[border=1cm]{standalone}
                  usepackage{tikz}
                  begin{document}
                  begin{tikzpicture}
                  draw (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                  (-4.261,2.617) arc (148.44:321.42:5);
                  end{tikzpicture}
                  %
                  begin{tikzpicture}
                  draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                  (-4.261,2.617) arc (148.44:321.42:5) (-2,-2)circle[radius=1];
                  end{tikzpicture}
                  %
                  begin{tikzpicture}
                  draw[red,fill,even odd rule] (-4.261,2.617)..controls (2.5,1.5) and (-4.5,-3)..(3.908,-3.118)
                  (-4.261,2.617) arc (148.44:321.42:5);
                  end{tikzpicture}

                  end{document}


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 26 at 15:40

























                  answered Feb 25 at 20:51









                  Hafid BoukhouldaHafid Boukhoulda

                  4,6341625




                  4,6341625






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476653%2fcustom-shape-shows-unwanted-extra-line%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Index of /

                      Tribalistas

                      Listed building