Drawing a half-full bottle in TikZ












2














I want to fill half of the bottle. I tried these kind of commands:



%filldraw[color=black!100, fill=cyan!30, very thick](-3,-2.4) arc (180:230:2.5) .. controls (-2,-5) and (-1.9,-5.2) .. (-1.8,-5.5) ;



But I failed. Here is the bottle:



documentclass[11pt,a4paper,oneside]{article}
usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
usepackage[utf8x]{inputenc}
usepackage{tikz}

begin{document}
begin{tikzpicture}[xscale=1,yscale=1]

draw[very thick](0,0) arc (0:180:1.5);
draw[very thick] (-3,0) -- (-3,-2.5);
draw[very thick] (0,0) -- (0,-2.5);
draw[color=black!100,very thick](-3,-2.5) arc (180:235:3);
draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
draw[very thick] (-1.25,-4.95) -- (-1.25,-5.2) -- (-1.7,-5.2) -- (-1.7,-4.95);

end{tikzpicture}
end{document}


What I want:



Drawing










share|improve this question
























  • Simply draw the half bottle starting with the neck on the left side and ending with the neck on the right side.
    – AndréC
    1 hour ago
















2














I want to fill half of the bottle. I tried these kind of commands:



%filldraw[color=black!100, fill=cyan!30, very thick](-3,-2.4) arc (180:230:2.5) .. controls (-2,-5) and (-1.9,-5.2) .. (-1.8,-5.5) ;



But I failed. Here is the bottle:



documentclass[11pt,a4paper,oneside]{article}
usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
usepackage[utf8x]{inputenc}
usepackage{tikz}

begin{document}
begin{tikzpicture}[xscale=1,yscale=1]

draw[very thick](0,0) arc (0:180:1.5);
draw[very thick] (-3,0) -- (-3,-2.5);
draw[very thick] (0,0) -- (0,-2.5);
draw[color=black!100,very thick](-3,-2.5) arc (180:235:3);
draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
draw[very thick] (-1.25,-4.95) -- (-1.25,-5.2) -- (-1.7,-5.2) -- (-1.7,-4.95);

end{tikzpicture}
end{document}


What I want:



Drawing










share|improve this question
























  • Simply draw the half bottle starting with the neck on the left side and ending with the neck on the right side.
    – AndréC
    1 hour ago














2












2








2


0





I want to fill half of the bottle. I tried these kind of commands:



%filldraw[color=black!100, fill=cyan!30, very thick](-3,-2.4) arc (180:230:2.5) .. controls (-2,-5) and (-1.9,-5.2) .. (-1.8,-5.5) ;



But I failed. Here is the bottle:



documentclass[11pt,a4paper,oneside]{article}
usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
usepackage[utf8x]{inputenc}
usepackage{tikz}

begin{document}
begin{tikzpicture}[xscale=1,yscale=1]

draw[very thick](0,0) arc (0:180:1.5);
draw[very thick] (-3,0) -- (-3,-2.5);
draw[very thick] (0,0) -- (0,-2.5);
draw[color=black!100,very thick](-3,-2.5) arc (180:235:3);
draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
draw[very thick] (-1.25,-4.95) -- (-1.25,-5.2) -- (-1.7,-5.2) -- (-1.7,-4.95);

end{tikzpicture}
end{document}


What I want:



Drawing










share|improve this question















I want to fill half of the bottle. I tried these kind of commands:



%filldraw[color=black!100, fill=cyan!30, very thick](-3,-2.4) arc (180:230:2.5) .. controls (-2,-5) and (-1.9,-5.2) .. (-1.8,-5.5) ;



But I failed. Here is the bottle:



documentclass[11pt,a4paper,oneside]{article}
usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
usepackage[utf8x]{inputenc}
usepackage{tikz}

begin{document}
begin{tikzpicture}[xscale=1,yscale=1]

draw[very thick](0,0) arc (0:180:1.5);
draw[very thick] (-3,0) -- (-3,-2.5);
draw[very thick] (0,0) -- (0,-2.5);
draw[color=black!100,very thick](-3,-2.5) arc (180:235:3);
draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
draw[very thick] (-1.25,-4.95) -- (-1.25,-5.2) -- (-1.7,-5.2) -- (-1.7,-4.95);

end{tikzpicture}
end{document}


What I want:



Drawing







tikz-pgf draw fill






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









chrisma

904416




904416










asked 1 hour ago









Rageful

496




496












  • Simply draw the half bottle starting with the neck on the left side and ending with the neck on the right side.
    – AndréC
    1 hour ago


















  • Simply draw the half bottle starting with the neck on the left side and ending with the neck on the right side.
    – AndréC
    1 hour ago
















Simply draw the half bottle starting with the neck on the left side and ending with the neck on the right side.
– AndréC
1 hour ago




Simply draw the half bottle starting with the neck on the left side and ending with the neck on the right side.
– AndréC
1 hour ago










2 Answers
2






active

oldest

votes


















3














documentclass[border=5pt,tikz]{standalone}

begin{document}
begin{tikzpicture}[xscale=1,yscale=1]
fill[blue!20] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);

fill[white] (0,0) arc(0:180:1.5) --+ (0,-2) -| cycle;

draw[very thick] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);
end{tikzpicture}
end{document}


Output:



Screenshot






share|improve this answer































    1














    documentclass[11pt,a4paper,oneside]{article}
    usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
    usepackage[utf8x]{inputenc}
    usepackage{tikz}

    begin{document}
    begin{tikzpicture}[xscale=1,yscale=1]

    draw[very thick](0,0) arc (0:180:1.5);
    draw[very thick] (-3,0) -- (-3,-2.5);
    draw[very thick] (0,0) -- (0,-2.5);
    draw[color=black!100,very thick](-3,-2.5)coordinate(A) arc (180:235:3);
    draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
    draw[very thick] (-1.25,-4.95)coordinate(E) -- (-1.25,-5.2)coordinate(F) -- (-1.7,-5.2)coordinate(G) -- (-1.7,-4.95)coordinate(H);
    begin{scope}
    shade[right color=orange,left color=orange,opacity=0.35]
    (A) -- (A) arc (180:235:3)--(H)--(G)--(F)--(E)--(E) arc (-55:0:3);
    end{scope}
    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%2f468012%2fdrawing-a-half-full-bottle-in-tikz%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









      3














      documentclass[border=5pt,tikz]{standalone}

      begin{document}
      begin{tikzpicture}[xscale=1,yscale=1]
      fill[blue!20] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);

      fill[white] (0,0) arc(0:180:1.5) --+ (0,-2) -| cycle;

      draw[very thick] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);
      end{tikzpicture}
      end{document}


      Output:



      Screenshot






      share|improve this answer




























        3














        documentclass[border=5pt,tikz]{standalone}

        begin{document}
        begin{tikzpicture}[xscale=1,yscale=1]
        fill[blue!20] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);

        fill[white] (0,0) arc(0:180:1.5) --+ (0,-2) -| cycle;

        draw[very thick] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);
        end{tikzpicture}
        end{document}


        Output:



        Screenshot






        share|improve this answer


























          3












          3








          3






          documentclass[border=5pt,tikz]{standalone}

          begin{document}
          begin{tikzpicture}[xscale=1,yscale=1]
          fill[blue!20] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);

          fill[white] (0,0) arc(0:180:1.5) --+ (0,-2) -| cycle;

          draw[very thick] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);
          end{tikzpicture}
          end{document}


          Output:



          Screenshot






          share|improve this answer














          documentclass[border=5pt,tikz]{standalone}

          begin{document}
          begin{tikzpicture}[xscale=1,yscale=1]
          fill[blue!20] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);

          fill[white] (0,0) arc(0:180:1.5) --+ (0,-2) -| cycle;

          draw[very thick] (0,-2.5) --+ (0,2.5) arc (0:180:1.5) -- (-3,-2.5) arc (180:235:3) --+ (0,-.25) --+ (.45,-.25) --+ (.45,.015) (0,-2.5) arc (0:-55:3);
          end{tikzpicture}
          end{document}


          Output:



          Screenshot







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 1 hour ago

























          answered 1 hour ago









          current_user

          3,2001436




          3,2001436























              1














              documentclass[11pt,a4paper,oneside]{article}
              usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
              usepackage[utf8x]{inputenc}
              usepackage{tikz}

              begin{document}
              begin{tikzpicture}[xscale=1,yscale=1]

              draw[very thick](0,0) arc (0:180:1.5);
              draw[very thick] (-3,0) -- (-3,-2.5);
              draw[very thick] (0,0) -- (0,-2.5);
              draw[color=black!100,very thick](-3,-2.5)coordinate(A) arc (180:235:3);
              draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
              draw[very thick] (-1.25,-4.95)coordinate(E) -- (-1.25,-5.2)coordinate(F) -- (-1.7,-5.2)coordinate(G) -- (-1.7,-4.95)coordinate(H);
              begin{scope}
              shade[right color=orange,left color=orange,opacity=0.35]
              (A) -- (A) arc (180:235:3)--(H)--(G)--(F)--(E)--(E) arc (-55:0:3);
              end{scope}
              end{tikzpicture}
              end{document}


              enter image description here






              share|improve this answer




























                1














                documentclass[11pt,a4paper,oneside]{article}
                usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
                usepackage[utf8x]{inputenc}
                usepackage{tikz}

                begin{document}
                begin{tikzpicture}[xscale=1,yscale=1]

                draw[very thick](0,0) arc (0:180:1.5);
                draw[very thick] (-3,0) -- (-3,-2.5);
                draw[very thick] (0,0) -- (0,-2.5);
                draw[color=black!100,very thick](-3,-2.5)coordinate(A) arc (180:235:3);
                draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
                draw[very thick] (-1.25,-4.95)coordinate(E) -- (-1.25,-5.2)coordinate(F) -- (-1.7,-5.2)coordinate(G) -- (-1.7,-4.95)coordinate(H);
                begin{scope}
                shade[right color=orange,left color=orange,opacity=0.35]
                (A) -- (A) arc (180:235:3)--(H)--(G)--(F)--(E)--(E) arc (-55:0:3);
                end{scope}
                end{tikzpicture}
                end{document}


                enter image description here






                share|improve this answer


























                  1












                  1








                  1






                  documentclass[11pt,a4paper,oneside]{article}
                  usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
                  usepackage[utf8x]{inputenc}
                  usepackage{tikz}

                  begin{document}
                  begin{tikzpicture}[xscale=1,yscale=1]

                  draw[very thick](0,0) arc (0:180:1.5);
                  draw[very thick] (-3,0) -- (-3,-2.5);
                  draw[very thick] (0,0) -- (0,-2.5);
                  draw[color=black!100,very thick](-3,-2.5)coordinate(A) arc (180:235:3);
                  draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
                  draw[very thick] (-1.25,-4.95)coordinate(E) -- (-1.25,-5.2)coordinate(F) -- (-1.7,-5.2)coordinate(G) -- (-1.7,-4.95)coordinate(H);
                  begin{scope}
                  shade[right color=orange,left color=orange,opacity=0.35]
                  (A) -- (A) arc (180:235:3)--(H)--(G)--(F)--(E)--(E) arc (-55:0:3);
                  end{scope}
                  end{tikzpicture}
                  end{document}


                  enter image description here






                  share|improve this answer














                  documentclass[11pt,a4paper,oneside]{article}
                  usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
                  usepackage[utf8x]{inputenc}
                  usepackage{tikz}

                  begin{document}
                  begin{tikzpicture}[xscale=1,yscale=1]

                  draw[very thick](0,0) arc (0:180:1.5);
                  draw[very thick] (-3,0) -- (-3,-2.5);
                  draw[very thick] (0,0) -- (0,-2.5);
                  draw[color=black!100,very thick](-3,-2.5)coordinate(A) arc (180:235:3);
                  draw[color=black!100,very thick](0,-2.5) arc (0:-55:3);
                  draw[very thick] (-1.25,-4.95)coordinate(E) -- (-1.25,-5.2)coordinate(F) -- (-1.7,-5.2)coordinate(G) -- (-1.7,-4.95)coordinate(H);
                  begin{scope}
                  shade[right color=orange,left color=orange,opacity=0.35]
                  (A) -- (A) arc (180:235:3)--(H)--(G)--(F)--(E)--(E) arc (-55:0:3);
                  end{scope}
                  end{tikzpicture}
                  end{document}


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 6 mins ago

























                  answered 51 mins ago









                  ferahfeza

                  5,25411830




                  5,25411830






























                      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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2f468012%2fdrawing-a-half-full-bottle-in-tikz%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

                      Le Mesnil-Réaume

                      Ida-Boy-Ed-Garten

                      web3.py web3.isConnected() returns false always