Shading a torus in TikZHow to draw a torus3D helix torus with hidden linesDrawing Torus with semi-dashed line...
Why do we say 'Pairwise Disjoint', rather than 'Disjoint'?
Finding the minimum value of a function without using Calculus
How to increase the accuracy of a plot
How can a demon take control of a human body during REM sleep?
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
How do you make a gun that shoots melee weapons and/or swords?
Is there a way to make cleveref distinguish two environments with the same counter?
What does the Digital Threat scope actually do?
Sampling from Gaussian mixture models, when are the sampled data independent?
The preposition for the verb (avenge) - avenge sb/sth (on OR from) sb
How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?
Idiom for feeling after taking risk and someone else being rewarded
What should I do when a paper is published similar to my PhD thesis without citation?
How should I solve this integral with changing parameters?
Giving a career talk in my old university, how prominently should I tell students my salary?
Can I negotiate a patent idea for a raise, under French law?
Are small insurances worth it?
Why aren't there more Gauls like Obelix?
Why restrict private health insurance?
How many bytes of data does AES 256 encrypt at one time?
Writing text next to a table
Was it really inappropriate to write a pull request for the company I interviewed with?
Professor forcing me to attend a conference, I can't afford even with 50% funding
Can the Witch Sight warlock invocation see through the Mirror Image spell?
Shading a torus in TikZ
How to draw a torus3D helix torus with hidden linesDrawing Torus with semi-dashed line on itPolyline shading in TikZTikZ/PGF - switching off shadingIntersection of paths with constructed namesHow to define the default vertical distance between nodes?Shading in TikZ calendarHalftone shading with TikZNumerical conditional within tikz keys?Periodic shading in tikzTikZ: Drawing an arc from an intersection to an intersectionLine up nested tikz enviroments or how to get rid of them
I would like to be able to shade a torus in TikZ to make it look like a surface in 3D, similarly to how the sphere in this code is shaded to give it a 3D feel but the opacity is such that it does not look like a solid ball:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}
draw (0,0) circle (1cm);
draw (-1,0) arc (180:360:1cm and 0.5cm);
draw[dashed] (1,0) arc (0:180:1cm and 0.5cm);
shade[ball color=blue!10!white,opacity=0.50] (0,0) circle (1cm);
end{tikzpicture}
end{document}
Here is my attempt with the torus:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}
%Torus
draw (0,0) ellipse (1.6 and .9);
shade[ball color = blue!10!white, opacity=0.5] (0,0) ellipse (1.6 and .9);
%Hole
begin{scope}[scale=.8]
clip (0,1.3) circle (1.55);
fill[white] (0,-1.27) circle (1.55);
end{scope}
begin{scope}[scale=.8]
path[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0) (-.9,0)--(0,-.56)--(.9,0);
draw[rounded corners=28pt] (-1.1,.1)--(0,-.6)--(1.1,.1);
draw[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0);
end{scope}
%Cut
draw[dashed] (0,-.9) arc (270:90:.2 and .365);
draw (0,-.9) arc (-90:90:.2 and .365);
end{tikzpicture}
end{document}
This is naive, since I'm using the same shading as for a ball, and I'm using clipping hacks to remove the shading from the hole. My attempt looks bad because it does not accurately reflect how light would hit the surface of a torus. Any tips for producing a realistically shaded torus would be greatly appreciated.
tikz-pgf shading
add a comment |
I would like to be able to shade a torus in TikZ to make it look like a surface in 3D, similarly to how the sphere in this code is shaded to give it a 3D feel but the opacity is such that it does not look like a solid ball:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}
draw (0,0) circle (1cm);
draw (-1,0) arc (180:360:1cm and 0.5cm);
draw[dashed] (1,0) arc (0:180:1cm and 0.5cm);
shade[ball color=blue!10!white,opacity=0.50] (0,0) circle (1cm);
end{tikzpicture}
end{document}
Here is my attempt with the torus:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}
%Torus
draw (0,0) ellipse (1.6 and .9);
shade[ball color = blue!10!white, opacity=0.5] (0,0) ellipse (1.6 and .9);
%Hole
begin{scope}[scale=.8]
clip (0,1.3) circle (1.55);
fill[white] (0,-1.27) circle (1.55);
end{scope}
begin{scope}[scale=.8]
path[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0) (-.9,0)--(0,-.56)--(.9,0);
draw[rounded corners=28pt] (-1.1,.1)--(0,-.6)--(1.1,.1);
draw[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0);
end{scope}
%Cut
draw[dashed] (0,-.9) arc (270:90:.2 and .365);
draw (0,-.9) arc (-90:90:.2 and .365);
end{tikzpicture}
end{document}
This is naive, since I'm using the same shading as for a ball, and I'm using clipping hacks to remove the shading from the hole. My attempt looks bad because it does not accurately reflect how light would hit the surface of a torus. Any tips for producing a realistically shaded torus would be greatly appreciated.
tikz-pgf shading
2
Render it using a proper 3D programme - TikZ is not designed for this. Also, please post compilable code rather than mere fragments.
– cfr
Apr 25 '18 at 2:04
1
See tex.stackexchange.com/questions/348/…
– John Kormylo
Apr 25 '18 at 3:05
... and here are some more, just drop the helix ...
– marmot
Apr 25 '18 at 3:23
I have seen both of these posts, but they are not helpful for me - either because I don't like how they look or because I don't understand how sketch works. I'm not something that looks truly 3D, I would only like to add an extra light spot onto the torus to make it look better than what I currently have.
– rosterherik
Apr 25 '18 at 3:40
add a comment |
I would like to be able to shade a torus in TikZ to make it look like a surface in 3D, similarly to how the sphere in this code is shaded to give it a 3D feel but the opacity is such that it does not look like a solid ball:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}
draw (0,0) circle (1cm);
draw (-1,0) arc (180:360:1cm and 0.5cm);
draw[dashed] (1,0) arc (0:180:1cm and 0.5cm);
shade[ball color=blue!10!white,opacity=0.50] (0,0) circle (1cm);
end{tikzpicture}
end{document}
Here is my attempt with the torus:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}
%Torus
draw (0,0) ellipse (1.6 and .9);
shade[ball color = blue!10!white, opacity=0.5] (0,0) ellipse (1.6 and .9);
%Hole
begin{scope}[scale=.8]
clip (0,1.3) circle (1.55);
fill[white] (0,-1.27) circle (1.55);
end{scope}
begin{scope}[scale=.8]
path[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0) (-.9,0)--(0,-.56)--(.9,0);
draw[rounded corners=28pt] (-1.1,.1)--(0,-.6)--(1.1,.1);
draw[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0);
end{scope}
%Cut
draw[dashed] (0,-.9) arc (270:90:.2 and .365);
draw (0,-.9) arc (-90:90:.2 and .365);
end{tikzpicture}
end{document}
This is naive, since I'm using the same shading as for a ball, and I'm using clipping hacks to remove the shading from the hole. My attempt looks bad because it does not accurately reflect how light would hit the surface of a torus. Any tips for producing a realistically shaded torus would be greatly appreciated.
tikz-pgf shading
I would like to be able to shade a torus in TikZ to make it look like a surface in 3D, similarly to how the sphere in this code is shaded to give it a 3D feel but the opacity is such that it does not look like a solid ball:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}
draw (0,0) circle (1cm);
draw (-1,0) arc (180:360:1cm and 0.5cm);
draw[dashed] (1,0) arc (0:180:1cm and 0.5cm);
shade[ball color=blue!10!white,opacity=0.50] (0,0) circle (1cm);
end{tikzpicture}
end{document}
Here is my attempt with the torus:
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}
%Torus
draw (0,0) ellipse (1.6 and .9);
shade[ball color = blue!10!white, opacity=0.5] (0,0) ellipse (1.6 and .9);
%Hole
begin{scope}[scale=.8]
clip (0,1.3) circle (1.55);
fill[white] (0,-1.27) circle (1.55);
end{scope}
begin{scope}[scale=.8]
path[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0) (-.9,0)--(0,-.56)--(.9,0);
draw[rounded corners=28pt] (-1.1,.1)--(0,-.6)--(1.1,.1);
draw[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0);
end{scope}
%Cut
draw[dashed] (0,-.9) arc (270:90:.2 and .365);
draw (0,-.9) arc (-90:90:.2 and .365);
end{tikzpicture}
end{document}
This is naive, since I'm using the same shading as for a ball, and I'm using clipping hacks to remove the shading from the hole. My attempt looks bad because it does not accurately reflect how light would hit the surface of a torus. Any tips for producing a realistically shaded torus would be greatly appreciated.
tikz-pgf shading
tikz-pgf shading
edited Apr 26 '18 at 0:13
rosterherik
asked Apr 25 '18 at 1:54
rosterherikrosterherik
536
536
2
Render it using a proper 3D programme - TikZ is not designed for this. Also, please post compilable code rather than mere fragments.
– cfr
Apr 25 '18 at 2:04
1
See tex.stackexchange.com/questions/348/…
– John Kormylo
Apr 25 '18 at 3:05
... and here are some more, just drop the helix ...
– marmot
Apr 25 '18 at 3:23
I have seen both of these posts, but they are not helpful for me - either because I don't like how they look or because I don't understand how sketch works. I'm not something that looks truly 3D, I would only like to add an extra light spot onto the torus to make it look better than what I currently have.
– rosterherik
Apr 25 '18 at 3:40
add a comment |
2
Render it using a proper 3D programme - TikZ is not designed for this. Also, please post compilable code rather than mere fragments.
– cfr
Apr 25 '18 at 2:04
1
See tex.stackexchange.com/questions/348/…
– John Kormylo
Apr 25 '18 at 3:05
... and here are some more, just drop the helix ...
– marmot
Apr 25 '18 at 3:23
I have seen both of these posts, but they are not helpful for me - either because I don't like how they look or because I don't understand how sketch works. I'm not something that looks truly 3D, I would only like to add an extra light spot onto the torus to make it look better than what I currently have.
– rosterherik
Apr 25 '18 at 3:40
2
2
Render it using a proper 3D programme - TikZ is not designed for this. Also, please post compilable code rather than mere fragments.
– cfr
Apr 25 '18 at 2:04
Render it using a proper 3D programme - TikZ is not designed for this. Also, please post compilable code rather than mere fragments.
– cfr
Apr 25 '18 at 2:04
1
1
See tex.stackexchange.com/questions/348/…
– John Kormylo
Apr 25 '18 at 3:05
See tex.stackexchange.com/questions/348/…
– John Kormylo
Apr 25 '18 at 3:05
... and here are some more, just drop the helix ...
– marmot
Apr 25 '18 at 3:23
... and here are some more, just drop the helix ...
– marmot
Apr 25 '18 at 3:23
I have seen both of these posts, but they are not helpful for me - either because I don't like how they look or because I don't understand how sketch works. I'm not something that looks truly 3D, I would only like to add an extra light spot onto the torus to make it look better than what I currently have.
– rosterherik
Apr 25 '18 at 3:40
I have seen both of these posts, but they are not helpful for me - either because I don't like how they look or because I don't understand how sketch works. I'm not something that looks truly 3D, I would only like to add an extra light spot onto the torus to make it look better than what I currently have.
– rosterherik
Apr 25 '18 at 3:40
add a comment |
2 Answers
2
active
oldest
votes
That's not a too serious answer, but just to tell you that if you have an idea how the shading should look like, you can reverse engineer it with pgfplots. Here is an example.

documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[colormap/blackwhite,
view={30}{60},axis lines=none
]
addplot3[surf,shader=interp,
samples=60, point meta=x+3*z*z-0.25*y,
domain=0:2*pi,y domain=0:2*pi,
z buffer=sort]
({(2+cos(deg(x)))*cos(deg(y))},
{(2+cos(deg(x)))*sin(deg(y))},
{sin(deg(x))});
end{axis}
end{tikzpicture}
end{document}
The trick is to play with point meta. Is this shading realistic? Certainly not (unless you have some crazy light sources). Could you make it realistic? Yes, if you know what you're doing or study the asymptote manual long enough. So if you want something realistic, use asymptote. If you want a cartoon and like to play with pgfplots, you may potentially find this useful.
Thank you for being so helpful marmot. This is closer to what I want than what I have, so it is useful. Is there a way to make this picture translucent?
– rosterherik
Apr 25 '18 at 3:43
@rosterherik I am not sure I understand "translucent". Do you mean transparent?
– marmot
Apr 25 '18 at 3:57
@rosterherik To best way to thank on TeX.SX is to up-vote and award green ticks to what you think is the best answer :)
– Andrew
Apr 25 '18 at 4:27
1
@rosterherik I agree that it is good to wait before accepting an answer but there is no reason why you cannot up-vote marmot's nice answer now: currently only one person has voted for the TeX.SX rodent and it is not you!
– Andrew
Apr 25 '18 at 10:52
1
@rosterherik :)
– Andrew
Apr 26 '18 at 7:52
|
show 3 more comments
Not an answer just an explanation of a setting or two available in @marmot 's excellent answer that may answer your question of translucency to an acceptable level (marmots that is) so if we take the above answer and tweak the one line (I found 50 to be a safer memory value than 60) the Opacity looks better around 7.5 where the far walls are ghosted through the surface materials, personally think this is more understandable than covering with broken lines see Drawing Torus with semi-dashed line on it
addplot3[surf,opacity=0.7,
samples=50, point meta=x+3*z*z-0.25*y,

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%2f428394%2fshading-a-torus-in-tikz%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
That's not a too serious answer, but just to tell you that if you have an idea how the shading should look like, you can reverse engineer it with pgfplots. Here is an example.

documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[colormap/blackwhite,
view={30}{60},axis lines=none
]
addplot3[surf,shader=interp,
samples=60, point meta=x+3*z*z-0.25*y,
domain=0:2*pi,y domain=0:2*pi,
z buffer=sort]
({(2+cos(deg(x)))*cos(deg(y))},
{(2+cos(deg(x)))*sin(deg(y))},
{sin(deg(x))});
end{axis}
end{tikzpicture}
end{document}
The trick is to play with point meta. Is this shading realistic? Certainly not (unless you have some crazy light sources). Could you make it realistic? Yes, if you know what you're doing or study the asymptote manual long enough. So if you want something realistic, use asymptote. If you want a cartoon and like to play with pgfplots, you may potentially find this useful.
Thank you for being so helpful marmot. This is closer to what I want than what I have, so it is useful. Is there a way to make this picture translucent?
– rosterherik
Apr 25 '18 at 3:43
@rosterherik I am not sure I understand "translucent". Do you mean transparent?
– marmot
Apr 25 '18 at 3:57
@rosterherik To best way to thank on TeX.SX is to up-vote and award green ticks to what you think is the best answer :)
– Andrew
Apr 25 '18 at 4:27
1
@rosterherik I agree that it is good to wait before accepting an answer but there is no reason why you cannot up-vote marmot's nice answer now: currently only one person has voted for the TeX.SX rodent and it is not you!
– Andrew
Apr 25 '18 at 10:52
1
@rosterherik :)
– Andrew
Apr 26 '18 at 7:52
|
show 3 more comments
That's not a too serious answer, but just to tell you that if you have an idea how the shading should look like, you can reverse engineer it with pgfplots. Here is an example.

documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[colormap/blackwhite,
view={30}{60},axis lines=none
]
addplot3[surf,shader=interp,
samples=60, point meta=x+3*z*z-0.25*y,
domain=0:2*pi,y domain=0:2*pi,
z buffer=sort]
({(2+cos(deg(x)))*cos(deg(y))},
{(2+cos(deg(x)))*sin(deg(y))},
{sin(deg(x))});
end{axis}
end{tikzpicture}
end{document}
The trick is to play with point meta. Is this shading realistic? Certainly not (unless you have some crazy light sources). Could you make it realistic? Yes, if you know what you're doing or study the asymptote manual long enough. So if you want something realistic, use asymptote. If you want a cartoon and like to play with pgfplots, you may potentially find this useful.
Thank you for being so helpful marmot. This is closer to what I want than what I have, so it is useful. Is there a way to make this picture translucent?
– rosterherik
Apr 25 '18 at 3:43
@rosterherik I am not sure I understand "translucent". Do you mean transparent?
– marmot
Apr 25 '18 at 3:57
@rosterherik To best way to thank on TeX.SX is to up-vote and award green ticks to what you think is the best answer :)
– Andrew
Apr 25 '18 at 4:27
1
@rosterherik I agree that it is good to wait before accepting an answer but there is no reason why you cannot up-vote marmot's nice answer now: currently only one person has voted for the TeX.SX rodent and it is not you!
– Andrew
Apr 25 '18 at 10:52
1
@rosterherik :)
– Andrew
Apr 26 '18 at 7:52
|
show 3 more comments
That's not a too serious answer, but just to tell you that if you have an idea how the shading should look like, you can reverse engineer it with pgfplots. Here is an example.

documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[colormap/blackwhite,
view={30}{60},axis lines=none
]
addplot3[surf,shader=interp,
samples=60, point meta=x+3*z*z-0.25*y,
domain=0:2*pi,y domain=0:2*pi,
z buffer=sort]
({(2+cos(deg(x)))*cos(deg(y))},
{(2+cos(deg(x)))*sin(deg(y))},
{sin(deg(x))});
end{axis}
end{tikzpicture}
end{document}
The trick is to play with point meta. Is this shading realistic? Certainly not (unless you have some crazy light sources). Could you make it realistic? Yes, if you know what you're doing or study the asymptote manual long enough. So if you want something realistic, use asymptote. If you want a cartoon and like to play with pgfplots, you may potentially find this useful.
That's not a too serious answer, but just to tell you that if you have an idea how the shading should look like, you can reverse engineer it with pgfplots. Here is an example.

documentclass[tikz,border=3.14mm]{standalone}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
begin{document}
begin{tikzpicture}
begin{axis}[colormap/blackwhite,
view={30}{60},axis lines=none
]
addplot3[surf,shader=interp,
samples=60, point meta=x+3*z*z-0.25*y,
domain=0:2*pi,y domain=0:2*pi,
z buffer=sort]
({(2+cos(deg(x)))*cos(deg(y))},
{(2+cos(deg(x)))*sin(deg(y))},
{sin(deg(x))});
end{axis}
end{tikzpicture}
end{document}
The trick is to play with point meta. Is this shading realistic? Certainly not (unless you have some crazy light sources). Could you make it realistic? Yes, if you know what you're doing or study the asymptote manual long enough. So if you want something realistic, use asymptote. If you want a cartoon and like to play with pgfplots, you may potentially find this useful.
answered Apr 25 '18 at 3:40
marmotmarmot
107k5129243
107k5129243
Thank you for being so helpful marmot. This is closer to what I want than what I have, so it is useful. Is there a way to make this picture translucent?
– rosterherik
Apr 25 '18 at 3:43
@rosterherik I am not sure I understand "translucent". Do you mean transparent?
– marmot
Apr 25 '18 at 3:57
@rosterherik To best way to thank on TeX.SX is to up-vote and award green ticks to what you think is the best answer :)
– Andrew
Apr 25 '18 at 4:27
1
@rosterherik I agree that it is good to wait before accepting an answer but there is no reason why you cannot up-vote marmot's nice answer now: currently only one person has voted for the TeX.SX rodent and it is not you!
– Andrew
Apr 25 '18 at 10:52
1
@rosterherik :)
– Andrew
Apr 26 '18 at 7:52
|
show 3 more comments
Thank you for being so helpful marmot. This is closer to what I want than what I have, so it is useful. Is there a way to make this picture translucent?
– rosterherik
Apr 25 '18 at 3:43
@rosterherik I am not sure I understand "translucent". Do you mean transparent?
– marmot
Apr 25 '18 at 3:57
@rosterherik To best way to thank on TeX.SX is to up-vote and award green ticks to what you think is the best answer :)
– Andrew
Apr 25 '18 at 4:27
1
@rosterherik I agree that it is good to wait before accepting an answer but there is no reason why you cannot up-vote marmot's nice answer now: currently only one person has voted for the TeX.SX rodent and it is not you!
– Andrew
Apr 25 '18 at 10:52
1
@rosterherik :)
– Andrew
Apr 26 '18 at 7:52
Thank you for being so helpful marmot. This is closer to what I want than what I have, so it is useful. Is there a way to make this picture translucent?
– rosterherik
Apr 25 '18 at 3:43
Thank you for being so helpful marmot. This is closer to what I want than what I have, so it is useful. Is there a way to make this picture translucent?
– rosterherik
Apr 25 '18 at 3:43
@rosterherik I am not sure I understand "translucent". Do you mean transparent?
– marmot
Apr 25 '18 at 3:57
@rosterherik I am not sure I understand "translucent". Do you mean transparent?
– marmot
Apr 25 '18 at 3:57
@rosterherik To best way to thank on TeX.SX is to up-vote and award green ticks to what you think is the best answer :)
– Andrew
Apr 25 '18 at 4:27
@rosterherik To best way to thank on TeX.SX is to up-vote and award green ticks to what you think is the best answer :)
– Andrew
Apr 25 '18 at 4:27
1
1
@rosterherik I agree that it is good to wait before accepting an answer but there is no reason why you cannot up-vote marmot's nice answer now: currently only one person has voted for the TeX.SX rodent and it is not you!
– Andrew
Apr 25 '18 at 10:52
@rosterherik I agree that it is good to wait before accepting an answer but there is no reason why you cannot up-vote marmot's nice answer now: currently only one person has voted for the TeX.SX rodent and it is not you!
– Andrew
Apr 25 '18 at 10:52
1
1
@rosterherik :)
– Andrew
Apr 26 '18 at 7:52
@rosterherik :)
– Andrew
Apr 26 '18 at 7:52
|
show 3 more comments
Not an answer just an explanation of a setting or two available in @marmot 's excellent answer that may answer your question of translucency to an acceptable level (marmots that is) so if we take the above answer and tweak the one line (I found 50 to be a safer memory value than 60) the Opacity looks better around 7.5 where the far walls are ghosted through the surface materials, personally think this is more understandable than covering with broken lines see Drawing Torus with semi-dashed line on it
addplot3[surf,opacity=0.7,
samples=50, point meta=x+3*z*z-0.25*y,

add a comment |
Not an answer just an explanation of a setting or two available in @marmot 's excellent answer that may answer your question of translucency to an acceptable level (marmots that is) so if we take the above answer and tweak the one line (I found 50 to be a safer memory value than 60) the Opacity looks better around 7.5 where the far walls are ghosted through the surface materials, personally think this is more understandable than covering with broken lines see Drawing Torus with semi-dashed line on it
addplot3[surf,opacity=0.7,
samples=50, point meta=x+3*z*z-0.25*y,

add a comment |
Not an answer just an explanation of a setting or two available in @marmot 's excellent answer that may answer your question of translucency to an acceptable level (marmots that is) so if we take the above answer and tweak the one line (I found 50 to be a safer memory value than 60) the Opacity looks better around 7.5 where the far walls are ghosted through the surface materials, personally think this is more understandable than covering with broken lines see Drawing Torus with semi-dashed line on it
addplot3[surf,opacity=0.7,
samples=50, point meta=x+3*z*z-0.25*y,

Not an answer just an explanation of a setting or two available in @marmot 's excellent answer that may answer your question of translucency to an acceptable level (marmots that is) so if we take the above answer and tweak the one line (I found 50 to be a safer memory value than 60) the Opacity looks better around 7.5 where the far walls are ghosted through the surface materials, personally think this is more understandable than covering with broken lines see Drawing Torus with semi-dashed line on it
addplot3[surf,opacity=0.7,
samples=50, point meta=x+3*z*z-0.25*y,

answered 47 secs ago
KJOKJO
2,7791119
2,7791119
add a comment |
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%2f428394%2fshading-a-torus-in-tikz%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
2
Render it using a proper 3D programme - TikZ is not designed for this. Also, please post compilable code rather than mere fragments.
– cfr
Apr 25 '18 at 2:04
1
See tex.stackexchange.com/questions/348/…
– John Kormylo
Apr 25 '18 at 3:05
... and here are some more, just drop the helix ...
– marmot
Apr 25 '18 at 3:23
I have seen both of these posts, but they are not helpful for me - either because I don't like how they look or because I don't understand how sketch works. I'm not something that looks truly 3D, I would only like to add an extra light spot onto the torus to make it look better than what I currently have.
– rosterherik
Apr 25 '18 at 3:40