Shading a torus in TikZHow 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

Having the player face themselves after the mid-game

(Codewars) Linked Lists-Sorted Insert

Is "cogitate" used appropriately in "I cogitate that success relies on hard work"?

What would be the most expensive material to an intergalactic society?

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

Did Amazon pay $0 in taxes last year?

How to install round brake pads

How do I increase the number of TTY consoles?

Which country has more?

How exactly does an Ethernet collision happen in the cable, since nodes use different circuits for Tx and Rx?

What should I do when a paper is published similar to my PhD thesis without citation?

What is better: yes / no radio, or simple checkbox?

What is Tony Stark injecting into himself in Iron Man 3?

How to educate team mate to take screenshots for bugs with out unwanted stuff

Does an unused member variable take up memory?

The preposition for the verb (avenge) - avenge sb/sth (on OR from) sb

Strange opamp's output impedance in spice

Can the Witch Sight warlock invocation see through the Mirror Image spell?

Can one live in the U.S. and not use a credit card?

How can I portion out frozen cookie dough?

Insult for someone who "doesn't know anything"

Is there stress on two letters on the word стоят

How to increase the accuracy of a plot



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













2















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
begindocument
begintikzpicture
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);
endtikzpicture
enddocument


Here is my attempt with the torus:



documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
%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
beginscope[scale=.8]
clip (0,1.3) circle (1.55);
fill[white] (0,-1.27) circle (1.55);
endscope
beginscope[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);
endscope
%Cut
draw[dashed] (0,-.9) arc (270:90:.2 and .365);
draw (0,-.9) arc (-90:90:.2 and .365);
endtikzpicture
enddocument


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.










share|improve this question



















  • 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















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
begindocument
begintikzpicture
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);
endtikzpicture
enddocument


Here is my attempt with the torus:



documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
%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
beginscope[scale=.8]
clip (0,1.3) circle (1.55);
fill[white] (0,-1.27) circle (1.55);
endscope
beginscope[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);
endscope
%Cut
draw[dashed] (0,-.9) arc (270:90:.2 and .365);
draw (0,-.9) arc (-90:90:.2 and .365);
endtikzpicture
enddocument


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.










share|improve this question



















  • 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








2


1






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
begindocument
begintikzpicture
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);
endtikzpicture
enddocument


Here is my attempt with the torus:



documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
%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
beginscope[scale=.8]
clip (0,1.3) circle (1.55);
fill[white] (0,-1.27) circle (1.55);
endscope
beginscope[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);
endscope
%Cut
draw[dashed] (0,-.9) arc (270:90:.2 and .365);
draw (0,-.9) arc (-90:90:.2 and .365);
endtikzpicture
enddocument


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.










share|improve this question
















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
begindocument
begintikzpicture
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);
endtikzpicture
enddocument


Here is my attempt with the torus:



documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
%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
beginscope[scale=.8]
clip (0,1.3) circle (1.55);
fill[white] (0,-1.27) circle (1.55);
endscope
beginscope[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);
endscope
%Cut
draw[dashed] (0,-.9) arc (270:90:.2 and .365);
draw (0,-.9) arc (-90:90:.2 and .365);
endtikzpicture
enddocument


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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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












  • 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










2 Answers
2






active

oldest

votes


















5














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.



enter image description here



documentclass[tikz,border=3.14mm]standalone
usepackagepgfplots
pgfplotssetcompat=1.15
begindocument
begintikzpicture
beginaxis[colormap/blackwhite,
view=3060,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)));
endaxis
endtikzpicture
enddocument


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.






share|improve this answer























  • 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


















0














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,


enter image description here



And the main collection of toroidal answers are at How to draw a torus





share
























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "85"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%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









    5














    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.



    enter image description here



    documentclass[tikz,border=3.14mm]standalone
    usepackagepgfplots
    pgfplotssetcompat=1.15
    begindocument
    begintikzpicture
    beginaxis[colormap/blackwhite,
    view=3060,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)));
    endaxis
    endtikzpicture
    enddocument


    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.






    share|improve this answer























    • 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















    5














    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.



    enter image description here



    documentclass[tikz,border=3.14mm]standalone
    usepackagepgfplots
    pgfplotssetcompat=1.15
    begindocument
    begintikzpicture
    beginaxis[colormap/blackwhite,
    view=3060,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)));
    endaxis
    endtikzpicture
    enddocument


    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.






    share|improve this answer























    • 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













    5












    5








    5







    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.



    enter image description here



    documentclass[tikz,border=3.14mm]standalone
    usepackagepgfplots
    pgfplotssetcompat=1.15
    begindocument
    begintikzpicture
    beginaxis[colormap/blackwhite,
    view=3060,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)));
    endaxis
    endtikzpicture
    enddocument


    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.






    share|improve this answer













    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.



    enter image description here



    documentclass[tikz,border=3.14mm]standalone
    usepackagepgfplots
    pgfplotssetcompat=1.15
    begindocument
    begintikzpicture
    beginaxis[colormap/blackwhite,
    view=3060,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)));
    endaxis
    endtikzpicture
    enddocument


    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.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    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

















    • 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











    0














    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,


    enter image description here



    And the main collection of toroidal answers are at How to draw a torus





    share





























      0














      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,


      enter image description here



      And the main collection of toroidal answers are at How to draw a torus





      share



























        0












        0








        0







        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,


        enter image description here



        And the main collection of toroidal answers are at How to draw a torus





        share















        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,


        enter image description here



        And the main collection of toroidal answers are at How to draw a torus






        share













        share


        share








        edited 2 mins ago

























        answered 9 mins ago









        KJOKJO

        2,7791119




        2,7791119



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            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





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

            Join wedge with single bond in chemfigHow to make only one part of double bond bold with chemfig?Crossing bonds in chemfigjoining atoms in chemfig. Two adjacent molculesHow do I selectively change bond length in chemfig?Ugly bond joints in chemfigchemfig: reaction above arrowUsing the mhchem and chemfig packages in conjunctionBonding to specific element letter using chemfigResonance hybrids in chemfigScale chemfig molecule in beamer with tikzWhy does this chemfig bond with a hook start in the middle of the atom?

            Are small insurances worth itIs insurance worth it if you can afford to replace the item? If not, when is it?Is accident insurance worth it for my kids who play sportsIs insuring property for more than it is worth allowed?At what point does it become worth it to file an insurance claim?Are wage loss insurance programs worth the cost compared to having an emergency fund?When is an event worth insuring against?Is insurance worth it if you can afford to replace the item? If not, when is it?FHA loan just commenced : Any way to get any of the up-front mortgage insurance back?Which types of insurances do I need to buy?Should I carry less renter's insurance if I can self-insure?Mortgage Adviser Signed Me Up For Multiple Home and Life Insurances (UK)Why many travel insurances don't cover country of nationality?