General ⇒ How can I draw this cylinder
-
- Posts: 23
- Joined: Sat Oct 28, 2017 1:18 am
How can I draw this cylinder
- Attachments
-
- ScreenHunter 33.png (25.48 KiB) Viewed 89437 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
How can I draw this cylinder
can you post the code here, that you already have?
If it's just the points, we don't have to work on drawing a cylinder etc. if you might have that already, that's why I ask for the code.Tran Van Toan wrote:how can I make points on two circles of cylinder
Stefan
-
- Posts: 23
- Joined: Sat Oct 28, 2017 1:18 am
How can I draw this cylinder
Code: Select all
\documentclass[border=5]{standalone}\usepackage{tikz}\usepackage{tkz-euclide}\usetkzobj{all}\usetikzlibrary{shadings}\begin{document}\begin{tikzpicture}\def\R{2}\fill[top color = gray!50!black,bottom color = gray!10,middle color = gray,shading = axis,opacity = 0.25](0,0) circle (\R cm and 0.5cm);\fill[left color = gray!50!black,right color = gray!50!black,middle color = gray!50,shading = axis,opacity = 0.25](\R,0) -- (\R,2*\R) arc (360:180:\R cm and 0.5cm)-- (-\R,0) arc (180:360:\R cm and 0.5cm);\fill[top color = gray!90!,bottom color = gray!2,middle color = gray!30,shading = axis,opacity = 0.25](0,2*\R) circle (\R cm and 0.5cm);\draw (-\R,2*\R) -- (-\R,0) arc (180:360:\R cm and 0.5cm)-- (\R,2*\R) ++ (-\R,0) circle (\R cm and 0.5cm);\draw[densely dashed] (-\R,0) arc (180:0:\R cm and 0.5cm);\end{tikzpicture}\end{document}
-
- Posts: 23
- Joined: Sat Oct 28, 2017 1:18 am
How can I draw this cylinder
Code: Select all
\documentclass[border=5]{standalone}\usepackage{tikz}\usepackage{tkz-euclide}\usetkzobj{all}\usetikzlibrary{shadings}\begin{document}\begin{tikzpicture}\def\R{2}\def\a{1}\def\z{1}\def\h{2*\R}\fill[top color = gray!50!black,bottom color = gray!10,middle color = gray,shading = axis,opacity = 0.25](0,0) circle (\R cm and \a cm);\fill[left color = gray!50!black,right color = gray!50!black,middle color = gray!50,shading = axis,opacity = 0.25](\R,0) -- (\R,\h) arc (360:180:\R cm and \a cm)-- (-\R,0) arc (180:360:\R cm and \a cm);\fill[top color = gray!90!,bottom color = gray!2,middle color = gray!30,shading = axis,opacity = 0.25](0,\h) circle (\R cm and \a cm);\draw (-\R,\h) -- (-\R,0) arc (180:360:\R cm and \a cm)-- (\R,\h) ++ (-\R,0) circle (\R cm and \a cm);\draw[densely dashed] (-\R,0) arc (180:0:\R cm and \a cm);\coordinate (B) at (0,0);\coordinate (A) at ($(B)+(0,\h)$);\coordinate (E) at (-\R,\h);\coordinate (F) at (\R,\h);\coordinate (G) at (-\R,0);\coordinate (H) at (\R,0);\coordinate (C) at ($(B) + (225:{\R} and {\a})$);\coordinate (D) at ($(C)+(0,\h)$);
- Attachments
-
- ScreenHunter 37.png (87.69 KiB) Viewed 89418 times
-
- Posts: 23
- Joined: Sat Oct 28, 2017 1:18 am
How can I draw this cylinder
- Attachments
-
- ScreenHunter 36.png (3.03 KiB) Viewed 89418 times
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
How can I draw this cylinder
\tkzDrawSegments[](A,D D,C E,G F,H)
to that one, removing the unnecessary two last segments:
\tkzDrawSegments[](A,D D,C)
Stefan
-
- Posts: 23
- Joined: Sat Oct 28, 2017 1:18 am