How to get trace to get a cylinder when I rotate a rectangle?Is it possible to draw a 3d cylinder using TikZ-3dplot?How draw a cylinder with 3 balls?how I can draw an skew cylinder (rotate around x axis) and fill it (in 3D tikz)?How to rotate a circle around two axes?How can I draw cylinder inside a sphere like this picture with Tikz?How can I draw this cylinder with 3D?How to draw a cylinder in prism?How to draw a square on cylinder?
MagSafe: Where is the charger ID stored?
 
 Thought experiment and possible contradiction between electromagnetism and special relativity
 
 Expanding powers of expressions of the form ax+b
 
 Higman's lemma and a manuscript of Erdős and Rado
 
 Adoption records in 1871 based on census info
 
 Do clerics commit a sin if they do not recite the liturgy of the hours?
 
 Discussing work with supervisor in an invited dinner with his family
 
 How does the OS tell whether an "Address is already in use"?
 
 How to get trace to get a cylinder when I rotate a rectangle?
 
 How to check whether a sublist exist in a huge database lists in a fast way?
 
 Was the Boeing 2707 design flawed?
 
 What is Spectral Subtraction for noise reduction?
 
 Why should a self-financing strategy be previsible?
 
 using resizegather inside tabular: how to remove extra vertical space above and below the equation?
 
 Talk interpreter
 
 Unlock your Lock
 
 Is this password scheme legit?
 
 Is first Ubuntu user root?
 
 Expressing the act of drawing
 
 Convergence of series of normally distributed random variables
 
 about to retire but not retired yet, employed but not working any more
 
 To what extent are we obligated to continue to procreate beyond having two kids?
 
 Changing JPEG to RAW to use on Lightroom?
 
 Retroactively modifying humans for Earth?
How to get trace to get a cylinder when I rotate a rectangle?
Is it possible to draw a 3d cylinder using TikZ-3dplot?How draw a cylinder with 3 balls?how I can draw an skew cylinder (rotate around x axis) and fill it (in 3D tikz)?How to rotate a circle around two axes?How can I draw cylinder inside a sphere like this picture with Tikz?How can I draw this cylinder with 3D?How to draw a cylinder in prism?How to draw a square on cylinder?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to rotate a rectangle to make trace and get a cylinder. My code
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 foreach X in 10,20,...,350 
 tdplotsetmaincoords70X
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 beginscope[canvas is xy plane at z=0]
 coordinate (O) at (0,0);
 coordinate (A) at (0,myr);
 endscope
 beginscope[canvas is xy plane at z=h]
 coordinate (O') at (0,0);
 coordinate (B) at (0,myr);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above draw[draw =black, fill=black] (v) circle (1pt) node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A) -- (B) -- (O') -- cycle; 
 endtikzpicture
enddocument 
How to get the result?

3d tikz-3dplot
add a comment |
I am trying to rotate a rectangle to make trace and get a cylinder. My code
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 foreach X in 10,20,...,350 
 tdplotsetmaincoords70X
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 beginscope[canvas is xy plane at z=0]
 coordinate (O) at (0,0);
 coordinate (A) at (0,myr);
 endscope
 beginscope[canvas is xy plane at z=h]
 coordinate (O') at (0,0);
 coordinate (B) at (0,myr);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above draw[draw =black, fill=black] (v) circle (1pt) node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A) -- (B) -- (O') -- cycle; 
 endtikzpicture
enddocument 
How to get the result?

3d tikz-3dplot
1
Is this your result?
– minhthien_2016
7 hours ago
1
Yes. Thank you very much.
– Thuy Nguyen
1 hour ago
add a comment |
I am trying to rotate a rectangle to make trace and get a cylinder. My code
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 foreach X in 10,20,...,350 
 tdplotsetmaincoords70X
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 beginscope[canvas is xy plane at z=0]
 coordinate (O) at (0,0);
 coordinate (A) at (0,myr);
 endscope
 beginscope[canvas is xy plane at z=h]
 coordinate (O') at (0,0);
 coordinate (B) at (0,myr);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above draw[draw =black, fill=black] (v) circle (1pt) node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A) -- (B) -- (O') -- cycle; 
 endtikzpicture
enddocument 
How to get the result?

3d tikz-3dplot
I am trying to rotate a rectangle to make trace and get a cylinder. My code
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 foreach X in 10,20,...,350 
 tdplotsetmaincoords70X
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 beginscope[canvas is xy plane at z=0]
 coordinate (O) at (0,0);
 coordinate (A) at (0,myr);
 endscope
 beginscope[canvas is xy plane at z=h]
 coordinate (O') at (0,0);
 coordinate (B) at (0,myr);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above draw[draw =black, fill=black] (v) circle (1pt) node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A) -- (B) -- (O') -- cycle; 
 endtikzpicture
enddocument 
How to get the result?

3d tikz-3dplot
3d tikz-3dplot
edited 7 hours ago
minhthien_2016
2,0781 gold badge12 silver badges19 bronze badges
2,0781 gold badge12 silver badges19 bronze badges
asked 9 hours ago
Thuy NguyenThuy Nguyen
1245 bronze badges
1245 bronze badges
1
Is this your result?
– minhthien_2016
7 hours ago
1
Yes. Thank you very much.
– Thuy Nguyen
1 hour ago
add a comment |
1
Is this your result?
– minhthien_2016
7 hours ago
1
Yes. Thank you very much.
– Thuy Nguyen
1 hour ago
1
1
Is this your result?
– minhthien_2016
7 hours ago
Is this your result?
– minhthien_2016
7 hours ago
1
1
Yes. Thank you very much.
– Thuy Nguyen
1 hour ago
Yes. Thank you very much.
– Thuy Nguyen
1 hour ago
add a comment |
 1 Answer
 1
 
active
oldest
votes
This exploits that coordinates are global. Even though we draw a new picture in each frame, the coordinates A-Z and B-Z are still known. And it is arguably simpler to draw the rectangle in the yz plane, and to use rotated coordinates.
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 tdplotsetmaincoords700
 foreach X [count=Z] in 0,10,...,360 
 
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 path[tdplot_screen_coords,use as bounding box] (-1.2*myr,-2) rectangle (1.2*myr,1.25*h);
 tdplotsetrotatedcoordsX00
 beginscope[tdplot_rotated_coords,canvas is yz plane at x=0]
 path (0,0) coordinate (O) 
 (myr,0) coordinate (A-Z)(myr,0) coordinate (A)
 (0,h) coordinate (O') 
 (myr,h) coordinate (B-Z) (myr,h) coordinate (B);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above 
 draw[draw =black, fill=black] (v) circle (1pt) 
 node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A-Z) -- (B-Z) -- (O') -- cycle; 
 ifnumZ>1
 draw plot[smooth,samples at=1,...,Z] (B-x); 
 ifnumZ>8
 ifnumZ>27
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw[dashed] plot[smooth,samples at=28,...,Z] (A-x); 
 draw plot[smooth,samples at=9,...,28] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 draw (myr,0,0) -- (myr,0,h);
 else
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw plot[smooth,samples at=9,...,Z] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 fi
 else
 draw plot[smooth,samples at=1,...,Z] (A-x); 
 fi
 fi
 endtikzpicture
enddocument 

+1 Very cool ...
– chishjmutoji 2
2 hours ago
Can we make trace of every points on the rectangleOABO'?
– minhthien_2016
1 hour ago
add a comment |
 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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f505731%2fhow-to-get-trace-to-get-a-cylinder-when-i-rotate-a-rectangle%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
 1 Answer
 1
 
active
oldest
votes
 1 Answer
 1
 
active
oldest
votes
active
oldest
votes
active
oldest
votes
This exploits that coordinates are global. Even though we draw a new picture in each frame, the coordinates A-Z and B-Z are still known. And it is arguably simpler to draw the rectangle in the yz plane, and to use rotated coordinates.
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 tdplotsetmaincoords700
 foreach X [count=Z] in 0,10,...,360 
 
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 path[tdplot_screen_coords,use as bounding box] (-1.2*myr,-2) rectangle (1.2*myr,1.25*h);
 tdplotsetrotatedcoordsX00
 beginscope[tdplot_rotated_coords,canvas is yz plane at x=0]
 path (0,0) coordinate (O) 
 (myr,0) coordinate (A-Z)(myr,0) coordinate (A)
 (0,h) coordinate (O') 
 (myr,h) coordinate (B-Z) (myr,h) coordinate (B);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above 
 draw[draw =black, fill=black] (v) circle (1pt) 
 node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A-Z) -- (B-Z) -- (O') -- cycle; 
 ifnumZ>1
 draw plot[smooth,samples at=1,...,Z] (B-x); 
 ifnumZ>8
 ifnumZ>27
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw[dashed] plot[smooth,samples at=28,...,Z] (A-x); 
 draw plot[smooth,samples at=9,...,28] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 draw (myr,0,0) -- (myr,0,h);
 else
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw plot[smooth,samples at=9,...,Z] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 fi
 else
 draw plot[smooth,samples at=1,...,Z] (A-x); 
 fi
 fi
 endtikzpicture
enddocument 

+1 Very cool ...
– chishjmutoji 2
2 hours ago
Can we make trace of every points on the rectangleOABO'?
– minhthien_2016
1 hour ago
add a comment |
This exploits that coordinates are global. Even though we draw a new picture in each frame, the coordinates A-Z and B-Z are still known. And it is arguably simpler to draw the rectangle in the yz plane, and to use rotated coordinates.
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 tdplotsetmaincoords700
 foreach X [count=Z] in 0,10,...,360 
 
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 path[tdplot_screen_coords,use as bounding box] (-1.2*myr,-2) rectangle (1.2*myr,1.25*h);
 tdplotsetrotatedcoordsX00
 beginscope[tdplot_rotated_coords,canvas is yz plane at x=0]
 path (0,0) coordinate (O) 
 (myr,0) coordinate (A-Z)(myr,0) coordinate (A)
 (0,h) coordinate (O') 
 (myr,h) coordinate (B-Z) (myr,h) coordinate (B);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above 
 draw[draw =black, fill=black] (v) circle (1pt) 
 node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A-Z) -- (B-Z) -- (O') -- cycle; 
 ifnumZ>1
 draw plot[smooth,samples at=1,...,Z] (B-x); 
 ifnumZ>8
 ifnumZ>27
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw[dashed] plot[smooth,samples at=28,...,Z] (A-x); 
 draw plot[smooth,samples at=9,...,28] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 draw (myr,0,0) -- (myr,0,h);
 else
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw plot[smooth,samples at=9,...,Z] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 fi
 else
 draw plot[smooth,samples at=1,...,Z] (A-x); 
 fi
 fi
 endtikzpicture
enddocument 

+1 Very cool ...
– chishjmutoji 2
2 hours ago
Can we make trace of every points on the rectangleOABO'?
– minhthien_2016
1 hour ago
add a comment |
This exploits that coordinates are global. Even though we draw a new picture in each frame, the coordinates A-Z and B-Z are still known. And it is arguably simpler to draw the rectangle in the yz plane, and to use rotated coordinates.
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 tdplotsetmaincoords700
 foreach X [count=Z] in 0,10,...,360 
 
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 path[tdplot_screen_coords,use as bounding box] (-1.2*myr,-2) rectangle (1.2*myr,1.25*h);
 tdplotsetrotatedcoordsX00
 beginscope[tdplot_rotated_coords,canvas is yz plane at x=0]
 path (0,0) coordinate (O) 
 (myr,0) coordinate (A-Z)(myr,0) coordinate (A)
 (0,h) coordinate (O') 
 (myr,h) coordinate (B-Z) (myr,h) coordinate (B);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above 
 draw[draw =black, fill=black] (v) circle (1pt) 
 node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A-Z) -- (B-Z) -- (O') -- cycle; 
 ifnumZ>1
 draw plot[smooth,samples at=1,...,Z] (B-x); 
 ifnumZ>8
 ifnumZ>27
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw[dashed] plot[smooth,samples at=28,...,Z] (A-x); 
 draw plot[smooth,samples at=9,...,28] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 draw (myr,0,0) -- (myr,0,h);
 else
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw plot[smooth,samples at=9,...,Z] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 fi
 else
 draw plot[smooth,samples at=1,...,Z] (A-x); 
 fi
 fi
 endtikzpicture
enddocument 

This exploits that coordinates are global. Even though we draw a new picture in each frame, the coordinates A-Z and B-Z are still known. And it is arguably simpler to draw the rectangle in the yz plane, and to use rotated coordinates.
documentclass[border=2mm,12pt,tikz]standalone
usepackagetikz-3dplot 
begindocument
 pgfmathsetmacromyr3
 pgfmathsetmacroh4
 tdplotsetmaincoords700
 foreach X [count=Z] in 0,10,...,360 
 
 begintikzpicture[tdplot_main_coords,scale=1,line cap=butt,line join=round]
 path[tdplot_screen_coords,use as bounding box] (-1.2*myr,-2) rectangle (1.2*myr,1.25*h);
 tdplotsetrotatedcoordsX00
 beginscope[tdplot_rotated_coords,canvas is yz plane at x=0]
 path (0,0) coordinate (O) 
 (myr,0) coordinate (A-Z)(myr,0) coordinate (A)
 (0,h) coordinate (O') 
 (myr,h) coordinate (B-Z) (myr,h) coordinate (B);
 endscope
 foreach v/position in B/below,O/below,A/below,O'/above 
 draw[draw =black, fill=black] (v) circle (1pt) 
 node [position=0.2mm] $v$;
 
 draw[thick] (O) -- (A-Z) -- (B-Z) -- (O') -- cycle; 
 ifnumZ>1
 draw plot[smooth,samples at=1,...,Z] (B-x); 
 ifnumZ>8
 ifnumZ>27
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw[dashed] plot[smooth,samples at=28,...,Z] (A-x); 
 draw plot[smooth,samples at=9,...,28] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 draw (myr,0,0) -- (myr,0,h);
 else
 draw[dashed] plot[smooth,samples at=1,...,9] (A-x); 
 draw plot[smooth,samples at=9,...,Z] (A-x); 
 draw (-myr,0,0) -- (-myr,0,h);
 fi
 else
 draw plot[smooth,samples at=1,...,Z] (A-x); 
 fi
 fi
 endtikzpicture
enddocument 

edited 2 hours ago
answered 2 hours ago
Schrödinger's catSchrödinger's cat
2,5813 silver badges10 bronze badges
2,5813 silver badges10 bronze badges
+1 Very cool ...
– chishjmutoji 2
2 hours ago
Can we make trace of every points on the rectangleOABO'?
– minhthien_2016
1 hour ago
add a comment |
+1 Very cool ...
– chishjmutoji 2
2 hours ago
Can we make trace of every points on the rectangleOABO'?
– minhthien_2016
1 hour ago
+1 Very cool ...
– chishjmutoji 2
2 hours ago
+1 Very cool ...
– chishjmutoji 2
2 hours ago
Can we make trace of every points on the rectangle
OABO'?– minhthien_2016
1 hour ago
Can we make trace of every points on the rectangle
OABO'?– minhthien_2016
1 hour ago
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f505731%2fhow-to-get-trace-to-get-a-cylinder-when-i-rotate-a-rectangle%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Is this your result?
– minhthien_2016
7 hours ago
1
Yes. Thank you very much.
– Thuy Nguyen
1 hour ago