I want to draw cubes stacked on top of each other. Help?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I know my code for the 2 by 2 by 2 cube is correct. However for the rest they are being housed on the same plane as the 2 by 2 by 2. Does anyone have suggestions on how to get the 1.8 by 1.8 by 1.8 cube to show stacked on top of the 2 by 2 by 2 and so on?
begintikzpicture
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endtikzpicture
tikz-pgf
New contributor
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
2
down vote
favorite
I know my code for the 2 by 2 by 2 cube is correct. However for the rest they are being housed on the same plane as the 2 by 2 by 2. Does anyone have suggestions on how to get the 1.8 by 1.8 by 1.8 cube to show stacked on top of the 2 by 2 by 2 and so on?
begintikzpicture
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endtikzpicture
tikz-pgf
New contributor
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
You draw all of them starting at same coordinate(0,0,0)
, and as youfill=white
all sides, only the largest and last cube is seen.
– Ignasi
1 hour ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I know my code for the 2 by 2 by 2 cube is correct. However for the rest they are being housed on the same plane as the 2 by 2 by 2. Does anyone have suggestions on how to get the 1.8 by 1.8 by 1.8 cube to show stacked on top of the 2 by 2 by 2 and so on?
begintikzpicture
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endtikzpicture
tikz-pgf
New contributor
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I know my code for the 2 by 2 by 2 cube is correct. However for the rest they are being housed on the same plane as the 2 by 2 by 2. Does anyone have suggestions on how to get the 1.8 by 1.8 by 1.8 cube to show stacked on top of the 2 by 2 by 2 and so on?
begintikzpicture
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endtikzpicture
tikz-pgf
tikz-pgf
New contributor
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 3 hours ago
Stefan Pinnow
19.1k83172
19.1k83172
New contributor
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 3 hours ago
Szcur
111
111
New contributor
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Szcur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
You draw all of them starting at same coordinate(0,0,0)
, and as youfill=white
all sides, only the largest and last cube is seen.
– Ignasi
1 hour ago
add a comment |Â
You draw all of them starting at same coordinate(0,0,0)
, and as youfill=white
all sides, only the largest and last cube is seen.
– Ignasi
1 hour ago
You draw all of them starting at same coordinate
(0,0,0)
, and as you fill=white
all sides, only the largest and last cube is seen.– Ignasi
1 hour ago
You draw all of them starting at same coordinate
(0,0,0)
, and as you fill=white
all sides, only the largest and last cube is seen.– Ignasi
1 hour ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
Just your code inside scope
s and a shift
plus scale
:
documentclassarticle
usepackagetikz
begindocument
begintikzpicture
beginscope
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,2),scale=0.9]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,3.8),scale=0.8]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
endtikzpicture
enddocument
Output:
The shifts could be(-0.1,0.9)
and(-0.2,3.6)
for better result, but I think the scale should be (to) lower value...
– koleygr
1 hour ago
For centered:[shift=(-0.05,1.85),scale=0.9]
and[shift=(-0.1,3.5),scale=0.8]
– koleygr
1 hour ago
Hi @koleygr thank you for your response! I am confused as to why you only 3 cubes are showing and why the code needed to be repeated. Any help you can provide is appreciated!
– Szcur
1 hour ago
@Szcur, I just show a way... I suppose it can be aded in aforeach
loop to avoid repeating code and to repeat the cubes from 1 to 0.1 scale... I will try it later because I have not the time right now...
– koleygr
23 mins ago
add a comment |Â
up vote
2
down vote
You could also declare a newcommand (or a pic
) whith some parameters to save typping.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning
%#1: optional. Default: fill=white
%#2: origin
%#3: size: cubex=cubey=cubez (it's a cube)
newcommandcube[3][fill=white]
draw[black, #1] (#2) -- ++(-#3,0,0) -- ++(0,#3,0) -- ++(0,0,-#3) -- ++(#3,0,0) -- ++(0,-#3,0)-- cycle;
draw[black,line join=bevel, #1] (#2) -- ++(0,#3,0) -- ++(0,0,-#3) (#2)++(0,#3,0)--++(-#3,0,0);
begindocument
begintikzpicture
cube[fill=red!30]0,0,02
cube[fill=green!30]0,2,01.8
cube[fill=blue!30]0,3.8,01.6
cube[fill=pink!30]0,5.4,01.4
cube[fill=orange!30]0,6.8,01.2
cube[fill=violet!30]0,8,01
cube[fill=brown!30]0,9,0.8
cube[fill=purple!30]0,9.8,0.6
cube[fill=cyan!30]0,10.4,0.4
beginscope[xshift=3cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.2,2,-.21.8
cube[fill=blue!30]-.4,3.8,-.41.6
cube[fill=pink!30]-.6,5.4,-.61.4
cube[fill=orange!30]-.8,6.8,-.81.2
cube[fill=violet!30]-1,8,-11
cube[fill=brown!30]-1.2,9,-1.2.8
cube[fill=purple!30]-1.4,9.8,-1.4.6
cube[fill=cyan!30]-1.6,10.4,-1.6.4
endscope
beginscope[xshift=6cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.1,2,-.11.8
cube[fill=blue!30]-.2,3.8,-.21.6
cube[fill=pink!30]-.3,5.4,-.31.4
cube[fill=orange!30]-.4,6.8,-.41.2
cube[fill=violet!30]-.5,8,-.51
cube[fill=brown!30]-.6,9,-.6.8
cube[fill=purple!30]-.7,9.8,-.7.6
cube[fill=cyan!30]-.8,10.4,-.8.4
endscope
endtikzpictureenddocument
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Just your code inside scope
s and a shift
plus scale
:
documentclassarticle
usepackagetikz
begindocument
begintikzpicture
beginscope
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,2),scale=0.9]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,3.8),scale=0.8]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
endtikzpicture
enddocument
Output:
The shifts could be(-0.1,0.9)
and(-0.2,3.6)
for better result, but I think the scale should be (to) lower value...
– koleygr
1 hour ago
For centered:[shift=(-0.05,1.85),scale=0.9]
and[shift=(-0.1,3.5),scale=0.8]
– koleygr
1 hour ago
Hi @koleygr thank you for your response! I am confused as to why you only 3 cubes are showing and why the code needed to be repeated. Any help you can provide is appreciated!
– Szcur
1 hour ago
@Szcur, I just show a way... I suppose it can be aded in aforeach
loop to avoid repeating code and to repeat the cubes from 1 to 0.1 scale... I will try it later because I have not the time right now...
– koleygr
23 mins ago
add a comment |Â
up vote
3
down vote
Just your code inside scope
s and a shift
plus scale
:
documentclassarticle
usepackagetikz
begindocument
begintikzpicture
beginscope
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,2),scale=0.9]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,3.8),scale=0.8]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
endtikzpicture
enddocument
Output:
The shifts could be(-0.1,0.9)
and(-0.2,3.6)
for better result, but I think the scale should be (to) lower value...
– koleygr
1 hour ago
For centered:[shift=(-0.05,1.85),scale=0.9]
and[shift=(-0.1,3.5),scale=0.8]
– koleygr
1 hour ago
Hi @koleygr thank you for your response! I am confused as to why you only 3 cubes are showing and why the code needed to be repeated. Any help you can provide is appreciated!
– Szcur
1 hour ago
@Szcur, I just show a way... I suppose it can be aded in aforeach
loop to avoid repeating code and to repeat the cubes from 1 to 0.1 scale... I will try it later because I have not the time right now...
– koleygr
23 mins ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Just your code inside scope
s and a shift
plus scale
:
documentclassarticle
usepackagetikz
begindocument
begintikzpicture
beginscope
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,2),scale=0.9]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,3.8),scale=0.8]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
endtikzpicture
enddocument
Output:
Just your code inside scope
s and a shift
plus scale
:
documentclassarticle
usepackagetikz
begindocument
begintikzpicture
beginscope
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,2),scale=0.9]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
beginscope[shift=(0,3.8),scale=0.8]
pgfmathsetmacrocubex0.4
pgfmathsetmacrocubey0.4
pgfmathsetmacrocubez0.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.6
pgfmathsetmacrocubey0.6
pgfmathsetmacrocubez0.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex0.8
pgfmathsetmacrocubey0.8
pgfmathsetmacrocubez0.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.0
pgfmathsetmacrocubey1.0
pgfmathsetmacrocubez1.0
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.2
pgfmathsetmacrocubey1.2
pgfmathsetmacrocubez1.2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.4
pgfmathsetmacrocubey1.4
pgfmathsetmacrocubez1.4
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.6
pgfmathsetmacrocubey1.6
pgfmathsetmacrocubez1.6
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex1.8
pgfmathsetmacrocubey1.8
pgfmathsetmacrocubez1.8
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
pgfmathsetmacrocubex2
pgfmathsetmacrocubey2
pgfmathsetmacrocubez2
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,-cubey,0) -- ++(cubex,0,0) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(0,0,-cubez) -- ++(0,-cubey,0) -- ++(0,0,cubez) -- cycle;
draw[black,fill=white] (0,0,0) -- ++(-cubex,0,0) -- ++(0,0,-cubez) -- ++(cubex,0,0) -- cycle;
endscope
endtikzpicture
enddocument
Output:
answered 1 hour ago


koleygr
10.2k1736
10.2k1736
The shifts could be(-0.1,0.9)
and(-0.2,3.6)
for better result, but I think the scale should be (to) lower value...
– koleygr
1 hour ago
For centered:[shift=(-0.05,1.85),scale=0.9]
and[shift=(-0.1,3.5),scale=0.8]
– koleygr
1 hour ago
Hi @koleygr thank you for your response! I am confused as to why you only 3 cubes are showing and why the code needed to be repeated. Any help you can provide is appreciated!
– Szcur
1 hour ago
@Szcur, I just show a way... I suppose it can be aded in aforeach
loop to avoid repeating code and to repeat the cubes from 1 to 0.1 scale... I will try it later because I have not the time right now...
– koleygr
23 mins ago
add a comment |Â
The shifts could be(-0.1,0.9)
and(-0.2,3.6)
for better result, but I think the scale should be (to) lower value...
– koleygr
1 hour ago
For centered:[shift=(-0.05,1.85),scale=0.9]
and[shift=(-0.1,3.5),scale=0.8]
– koleygr
1 hour ago
Hi @koleygr thank you for your response! I am confused as to why you only 3 cubes are showing and why the code needed to be repeated. Any help you can provide is appreciated!
– Szcur
1 hour ago
@Szcur, I just show a way... I suppose it can be aded in aforeach
loop to avoid repeating code and to repeat the cubes from 1 to 0.1 scale... I will try it later because I have not the time right now...
– koleygr
23 mins ago
The shifts could be
(-0.1,0.9)
and (-0.2,3.6)
for better result, but I think the scale should be (to) lower value...– koleygr
1 hour ago
The shifts could be
(-0.1,0.9)
and (-0.2,3.6)
for better result, but I think the scale should be (to) lower value...– koleygr
1 hour ago
For centered:
[shift=(-0.05,1.85),scale=0.9]
and [shift=(-0.1,3.5),scale=0.8]
– koleygr
1 hour ago
For centered:
[shift=(-0.05,1.85),scale=0.9]
and [shift=(-0.1,3.5),scale=0.8]
– koleygr
1 hour ago
Hi @koleygr thank you for your response! I am confused as to why you only 3 cubes are showing and why the code needed to be repeated. Any help you can provide is appreciated!
– Szcur
1 hour ago
Hi @koleygr thank you for your response! I am confused as to why you only 3 cubes are showing and why the code needed to be repeated. Any help you can provide is appreciated!
– Szcur
1 hour ago
@Szcur, I just show a way... I suppose it can be aded in a
foreach
loop to avoid repeating code and to repeat the cubes from 1 to 0.1 scale... I will try it later because I have not the time right now...– koleygr
23 mins ago
@Szcur, I just show a way... I suppose it can be aded in a
foreach
loop to avoid repeating code and to repeat the cubes from 1 to 0.1 scale... I will try it later because I have not the time right now...– koleygr
23 mins ago
add a comment |Â
up vote
2
down vote
You could also declare a newcommand (or a pic
) whith some parameters to save typping.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning
%#1: optional. Default: fill=white
%#2: origin
%#3: size: cubex=cubey=cubez (it's a cube)
newcommandcube[3][fill=white]
draw[black, #1] (#2) -- ++(-#3,0,0) -- ++(0,#3,0) -- ++(0,0,-#3) -- ++(#3,0,0) -- ++(0,-#3,0)-- cycle;
draw[black,line join=bevel, #1] (#2) -- ++(0,#3,0) -- ++(0,0,-#3) (#2)++(0,#3,0)--++(-#3,0,0);
begindocument
begintikzpicture
cube[fill=red!30]0,0,02
cube[fill=green!30]0,2,01.8
cube[fill=blue!30]0,3.8,01.6
cube[fill=pink!30]0,5.4,01.4
cube[fill=orange!30]0,6.8,01.2
cube[fill=violet!30]0,8,01
cube[fill=brown!30]0,9,0.8
cube[fill=purple!30]0,9.8,0.6
cube[fill=cyan!30]0,10.4,0.4
beginscope[xshift=3cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.2,2,-.21.8
cube[fill=blue!30]-.4,3.8,-.41.6
cube[fill=pink!30]-.6,5.4,-.61.4
cube[fill=orange!30]-.8,6.8,-.81.2
cube[fill=violet!30]-1,8,-11
cube[fill=brown!30]-1.2,9,-1.2.8
cube[fill=purple!30]-1.4,9.8,-1.4.6
cube[fill=cyan!30]-1.6,10.4,-1.6.4
endscope
beginscope[xshift=6cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.1,2,-.11.8
cube[fill=blue!30]-.2,3.8,-.21.6
cube[fill=pink!30]-.3,5.4,-.31.4
cube[fill=orange!30]-.4,6.8,-.41.2
cube[fill=violet!30]-.5,8,-.51
cube[fill=brown!30]-.6,9,-.6.8
cube[fill=purple!30]-.7,9.8,-.7.6
cube[fill=cyan!30]-.8,10.4,-.8.4
endscope
endtikzpictureenddocument
add a comment |Â
up vote
2
down vote
You could also declare a newcommand (or a pic
) whith some parameters to save typping.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning
%#1: optional. Default: fill=white
%#2: origin
%#3: size: cubex=cubey=cubez (it's a cube)
newcommandcube[3][fill=white]
draw[black, #1] (#2) -- ++(-#3,0,0) -- ++(0,#3,0) -- ++(0,0,-#3) -- ++(#3,0,0) -- ++(0,-#3,0)-- cycle;
draw[black,line join=bevel, #1] (#2) -- ++(0,#3,0) -- ++(0,0,-#3) (#2)++(0,#3,0)--++(-#3,0,0);
begindocument
begintikzpicture
cube[fill=red!30]0,0,02
cube[fill=green!30]0,2,01.8
cube[fill=blue!30]0,3.8,01.6
cube[fill=pink!30]0,5.4,01.4
cube[fill=orange!30]0,6.8,01.2
cube[fill=violet!30]0,8,01
cube[fill=brown!30]0,9,0.8
cube[fill=purple!30]0,9.8,0.6
cube[fill=cyan!30]0,10.4,0.4
beginscope[xshift=3cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.2,2,-.21.8
cube[fill=blue!30]-.4,3.8,-.41.6
cube[fill=pink!30]-.6,5.4,-.61.4
cube[fill=orange!30]-.8,6.8,-.81.2
cube[fill=violet!30]-1,8,-11
cube[fill=brown!30]-1.2,9,-1.2.8
cube[fill=purple!30]-1.4,9.8,-1.4.6
cube[fill=cyan!30]-1.6,10.4,-1.6.4
endscope
beginscope[xshift=6cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.1,2,-.11.8
cube[fill=blue!30]-.2,3.8,-.21.6
cube[fill=pink!30]-.3,5.4,-.31.4
cube[fill=orange!30]-.4,6.8,-.41.2
cube[fill=violet!30]-.5,8,-.51
cube[fill=brown!30]-.6,9,-.6.8
cube[fill=purple!30]-.7,9.8,-.7.6
cube[fill=cyan!30]-.8,10.4,-.8.4
endscope
endtikzpictureenddocument
add a comment |Â
up vote
2
down vote
up vote
2
down vote
You could also declare a newcommand (or a pic
) whith some parameters to save typping.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning
%#1: optional. Default: fill=white
%#2: origin
%#3: size: cubex=cubey=cubez (it's a cube)
newcommandcube[3][fill=white]
draw[black, #1] (#2) -- ++(-#3,0,0) -- ++(0,#3,0) -- ++(0,0,-#3) -- ++(#3,0,0) -- ++(0,-#3,0)-- cycle;
draw[black,line join=bevel, #1] (#2) -- ++(0,#3,0) -- ++(0,0,-#3) (#2)++(0,#3,0)--++(-#3,0,0);
begindocument
begintikzpicture
cube[fill=red!30]0,0,02
cube[fill=green!30]0,2,01.8
cube[fill=blue!30]0,3.8,01.6
cube[fill=pink!30]0,5.4,01.4
cube[fill=orange!30]0,6.8,01.2
cube[fill=violet!30]0,8,01
cube[fill=brown!30]0,9,0.8
cube[fill=purple!30]0,9.8,0.6
cube[fill=cyan!30]0,10.4,0.4
beginscope[xshift=3cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.2,2,-.21.8
cube[fill=blue!30]-.4,3.8,-.41.6
cube[fill=pink!30]-.6,5.4,-.61.4
cube[fill=orange!30]-.8,6.8,-.81.2
cube[fill=violet!30]-1,8,-11
cube[fill=brown!30]-1.2,9,-1.2.8
cube[fill=purple!30]-1.4,9.8,-1.4.6
cube[fill=cyan!30]-1.6,10.4,-1.6.4
endscope
beginscope[xshift=6cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.1,2,-.11.8
cube[fill=blue!30]-.2,3.8,-.21.6
cube[fill=pink!30]-.3,5.4,-.31.4
cube[fill=orange!30]-.4,6.8,-.41.2
cube[fill=violet!30]-.5,8,-.51
cube[fill=brown!30]-.6,9,-.6.8
cube[fill=purple!30]-.7,9.8,-.7.6
cube[fill=cyan!30]-.8,10.4,-.8.4
endscope
endtikzpictureenddocument
You could also declare a newcommand (or a pic
) whith some parameters to save typping.
documentclass[tikz,border=2mm]standalone
usetikzlibrarypositioning
%#1: optional. Default: fill=white
%#2: origin
%#3: size: cubex=cubey=cubez (it's a cube)
newcommandcube[3][fill=white]
draw[black, #1] (#2) -- ++(-#3,0,0) -- ++(0,#3,0) -- ++(0,0,-#3) -- ++(#3,0,0) -- ++(0,-#3,0)-- cycle;
draw[black,line join=bevel, #1] (#2) -- ++(0,#3,0) -- ++(0,0,-#3) (#2)++(0,#3,0)--++(-#3,0,0);
begindocument
begintikzpicture
cube[fill=red!30]0,0,02
cube[fill=green!30]0,2,01.8
cube[fill=blue!30]0,3.8,01.6
cube[fill=pink!30]0,5.4,01.4
cube[fill=orange!30]0,6.8,01.2
cube[fill=violet!30]0,8,01
cube[fill=brown!30]0,9,0.8
cube[fill=purple!30]0,9.8,0.6
cube[fill=cyan!30]0,10.4,0.4
beginscope[xshift=3cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.2,2,-.21.8
cube[fill=blue!30]-.4,3.8,-.41.6
cube[fill=pink!30]-.6,5.4,-.61.4
cube[fill=orange!30]-.8,6.8,-.81.2
cube[fill=violet!30]-1,8,-11
cube[fill=brown!30]-1.2,9,-1.2.8
cube[fill=purple!30]-1.4,9.8,-1.4.6
cube[fill=cyan!30]-1.6,10.4,-1.6.4
endscope
beginscope[xshift=6cm]
cube[fill=red!30]0,0,02
cube[fill=green!30]-.1,2,-.11.8
cube[fill=blue!30]-.2,3.8,-.21.6
cube[fill=pink!30]-.3,5.4,-.31.4
cube[fill=orange!30]-.4,6.8,-.41.2
cube[fill=violet!30]-.5,8,-.51
cube[fill=brown!30]-.6,9,-.6.8
cube[fill=purple!30]-.7,9.8,-.7.6
cube[fill=cyan!30]-.8,10.4,-.8.4
endscope
endtikzpictureenddocument
answered 37 mins ago
Ignasi
88.3k4159295
88.3k4159295
add a comment |Â
add a comment |Â
Szcur is a new contributor. Be nice, and check out our Code of Conduct.
Szcur is a new contributor. Be nice, and check out our Code of Conduct.
Szcur is a new contributor. Be nice, and check out our Code of Conduct.
Szcur is a new contributor. Be nice, and check out our Code of Conduct.
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f455500%2fi-want-to-draw-cubes-stacked-on-top-of-each-other-help%23new-answer', 'question_page');
);
Post as a guest
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
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
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
You draw all of them starting at same coordinate
(0,0,0)
, and as youfill=white
all sides, only the largest and last cube is seen.– Ignasi
1 hour ago