Draw a sphere with one handle with TikzDraw a sphere with a handle with TikZTikZ: Cropping the Bounding...

Finding files for which a command fails

What happens when a metallic dragon and a chromatic dragon mate?

What are the advantages and disadvantages of running one shots compared to campaigns?

Need help identifying/translating a plaque in Tangier, Morocco

Can I find out the caloric content of bread by dehydrating it?

New order #4: World

How can I plot a Farey diagram?

Does the average primeness of natural numbers tend to zero?

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

Why was the "bread communication" in the arena of Catching Fire left out in the movie?

How to make payment on the internet without leaving a money trail?

"listening to me about as much as you're listening to this pole here"

Filling an area between two curves

Could a US political party gain complete control over the government by removing checks & balances?

Re-submission of rejected manuscript without informing co-authors

How is it possible for user's password to be changed after storage was encrypted? (on OS X, Android)

What is the meaning of "of trouble" in the following sentence?

Is there a familial term for apples and pears?

Copycat chess is back

Ideas for 3rd eye abilities

Email Account under attack (really) - anything I can do?

Landing in very high winds

Can the Produce Flame cantrip be used to grapple, or as an unarmed strike, in the right circumstances?

Does a dangling wire really electrocute me if I'm standing in water?



Draw a sphere with one handle with Tikz


Draw a sphere with a handle with TikZTikZ: Cropping the Bounding BoxTikZ: How to draw an isometric drawing in tikzDraw sphere with some portion is dottedDraw parallels of a sphere with tikzDraw a sphere in TikzLine up nested tikz enviroments or how to get rid of themDraw a colored sphere in Tikz3D sphere with TIKZDraw a sphere with a handle with TikZHow can one draw a segment of a sphere with TikZ?













4















I would like to draw a sphere with one handle as follows:
enter image description here



I have tried with the following code from Draw a sphere with a handle with TikZ, but this is different from my required image.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords]
path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (6,6);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{20}
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({3*sin(myang)*cos(angright)},{3*cos(myang)},{3*sin(myang)*sin(angright)}) coordinate (P1)
({3*sin(myang)*cos(angtop)},{3*sin(myang)*sin(angtop)},{3*cos(myang)}) coordinate (P2);
draw[right color=white,left color=gray!80,shading angle=300] plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=0,looseness=2] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({3*sin(myang)*cos(x)},{3*cos(myang)},{3*sin(myang)*sin(x)})
to[out=0,in=90,looseness=4] (P2);
end{tikzpicture}
end{document}


This produces:
enter image description here
How can I draw the required figure which I want?










share|improve this question




















  • 2





    This answer contains both the code of which you say it is yours and versions with smaller handles.

    – marmot
    15 hours ago
















4















I would like to draw a sphere with one handle as follows:
enter image description here



I have tried with the following code from Draw a sphere with a handle with TikZ, but this is different from my required image.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords]
path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (6,6);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{20}
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({3*sin(myang)*cos(angright)},{3*cos(myang)},{3*sin(myang)*sin(angright)}) coordinate (P1)
({3*sin(myang)*cos(angtop)},{3*sin(myang)*sin(angtop)},{3*cos(myang)}) coordinate (P2);
draw[right color=white,left color=gray!80,shading angle=300] plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=0,looseness=2] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({3*sin(myang)*cos(x)},{3*cos(myang)},{3*sin(myang)*sin(x)})
to[out=0,in=90,looseness=4] (P2);
end{tikzpicture}
end{document}


This produces:
enter image description here
How can I draw the required figure which I want?










share|improve this question




















  • 2





    This answer contains both the code of which you say it is yours and versions with smaller handles.

    – marmot
    15 hours ago














4












4








4


1






I would like to draw a sphere with one handle as follows:
enter image description here



I have tried with the following code from Draw a sphere with a handle with TikZ, but this is different from my required image.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords]
path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (6,6);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{20}
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({3*sin(myang)*cos(angright)},{3*cos(myang)},{3*sin(myang)*sin(angright)}) coordinate (P1)
({3*sin(myang)*cos(angtop)},{3*sin(myang)*sin(angtop)},{3*cos(myang)}) coordinate (P2);
draw[right color=white,left color=gray!80,shading angle=300] plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=0,looseness=2] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({3*sin(myang)*cos(x)},{3*cos(myang)},{3*sin(myang)*sin(x)})
to[out=0,in=90,looseness=4] (P2);
end{tikzpicture}
end{document}


This produces:
enter image description here
How can I draw the required figure which I want?










share|improve this question
















I would like to draw a sphere with one handle as follows:
enter image description here



I have tried with the following code from Draw a sphere with a handle with TikZ, but this is different from my required image.



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords]
path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (6,6);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{20}
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({3*sin(myang)*cos(angright)},{3*cos(myang)},{3*sin(myang)*sin(angright)}) coordinate (P1)
({3*sin(myang)*cos(angtop)},{3*sin(myang)*sin(angtop)},{3*cos(myang)}) coordinate (P2);
draw[right color=white,left color=gray!80,shading angle=300] plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=0,looseness=2] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({3*sin(myang)*cos(x)},{3*cos(myang)},{3*sin(myang)*sin(x)})
to[out=0,in=90,looseness=4] (P2);
end{tikzpicture}
end{document}


This produces:
enter image description here
How can I draw the required figure which I want?







tikz-pgf tikz-3d






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 15 hours ago









user185220

415




415










asked 15 hours ago









MKSMKS

5815




5815








  • 2





    This answer contains both the code of which you say it is yours and versions with smaller handles.

    – marmot
    15 hours ago














  • 2





    This answer contains both the code of which you say it is yours and versions with smaller handles.

    – marmot
    15 hours ago








2




2





This answer contains both the code of which you say it is yours and versions with smaller handles.

– marmot
15 hours ago





This answer contains both the code of which you say it is yours and versions with smaller handles.

– marmot
15 hours ago










1 Answer
1






active

oldest

votes


















4














This answer comes with three codes, the last of which is the most customizable one. I added two more (looseness) parameters, and playing with them allowed me to draw



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords,rotate=-60]
%path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (4,4.5);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{10} % controls the diameter of the handle
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
pgfmathsetmacro{out}{55}
pgfmathsetmacro{LooOne}{5.2}
pgfmathsetmacro{LooTwo}{4.2}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({R*sin(myang)*cos(angtop)},{R*sin(myang)*sin(angtop)},{R*cos(myang)})
coordinate (P2)
({R*sin(myang)*cos(angright)},{-R*sin(myang)*sin(angright)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(angright)*sin(out)})
coordinate (P1);
draw[opacity=0.5,
right color=white,left color=gray!40!white,shading angle={-225+(90-out)/2}]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
draw[dashed] plot[variable=x,domain=angtop:angtop-180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
plot[variable=x,domain=angright:angright+180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)});
shadedraw [ball color=gray!50,opacity=0.5]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
end{tikzpicture}
end{document}


enter image description here






share|improve this answer





















  • 1





    A dotted portion at the bottom of the handle is missing in this figure@marmot

    – MKS
    14 hours ago






  • 1





    @MKS I added them....

    – marmot
    14 hours ago












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%2f483788%2fdraw-a-sphere-with-one-handle-with-tikz%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














This answer comes with three codes, the last of which is the most customizable one. I added two more (looseness) parameters, and playing with them allowed me to draw



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords,rotate=-60]
%path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (4,4.5);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{10} % controls the diameter of the handle
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
pgfmathsetmacro{out}{55}
pgfmathsetmacro{LooOne}{5.2}
pgfmathsetmacro{LooTwo}{4.2}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({R*sin(myang)*cos(angtop)},{R*sin(myang)*sin(angtop)},{R*cos(myang)})
coordinate (P2)
({R*sin(myang)*cos(angright)},{-R*sin(myang)*sin(angright)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(angright)*sin(out)})
coordinate (P1);
draw[opacity=0.5,
right color=white,left color=gray!40!white,shading angle={-225+(90-out)/2}]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
draw[dashed] plot[variable=x,domain=angtop:angtop-180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
plot[variable=x,domain=angright:angright+180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)});
shadedraw [ball color=gray!50,opacity=0.5]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
end{tikzpicture}
end{document}


enter image description here






share|improve this answer





















  • 1





    A dotted portion at the bottom of the handle is missing in this figure@marmot

    – MKS
    14 hours ago






  • 1





    @MKS I added them....

    – marmot
    14 hours ago
















4














This answer comes with three codes, the last of which is the most customizable one. I added two more (looseness) parameters, and playing with them allowed me to draw



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords,rotate=-60]
%path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (4,4.5);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{10} % controls the diameter of the handle
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
pgfmathsetmacro{out}{55}
pgfmathsetmacro{LooOne}{5.2}
pgfmathsetmacro{LooTwo}{4.2}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({R*sin(myang)*cos(angtop)},{R*sin(myang)*sin(angtop)},{R*cos(myang)})
coordinate (P2)
({R*sin(myang)*cos(angright)},{-R*sin(myang)*sin(angright)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(angright)*sin(out)})
coordinate (P1);
draw[opacity=0.5,
right color=white,left color=gray!40!white,shading angle={-225+(90-out)/2}]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
draw[dashed] plot[variable=x,domain=angtop:angtop-180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
plot[variable=x,domain=angright:angright+180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)});
shadedraw [ball color=gray!50,opacity=0.5]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
end{tikzpicture}
end{document}


enter image description here






share|improve this answer





















  • 1





    A dotted portion at the bottom of the handle is missing in this figure@marmot

    – MKS
    14 hours ago






  • 1





    @MKS I added them....

    – marmot
    14 hours ago














4












4








4







This answer comes with three codes, the last of which is the most customizable one. I added two more (looseness) parameters, and playing with them allowed me to draw



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords,rotate=-60]
%path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (4,4.5);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{10} % controls the diameter of the handle
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
pgfmathsetmacro{out}{55}
pgfmathsetmacro{LooOne}{5.2}
pgfmathsetmacro{LooTwo}{4.2}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({R*sin(myang)*cos(angtop)},{R*sin(myang)*sin(angtop)},{R*cos(myang)})
coordinate (P2)
({R*sin(myang)*cos(angright)},{-R*sin(myang)*sin(angright)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(angright)*sin(out)})
coordinate (P1);
draw[opacity=0.5,
right color=white,left color=gray!40!white,shading angle={-225+(90-out)/2}]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
draw[dashed] plot[variable=x,domain=angtop:angtop-180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
plot[variable=x,domain=angright:angright+180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)});
shadedraw [ball color=gray!50,opacity=0.5]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
end{tikzpicture}
end{document}


enter image description here






share|improve this answer















This answer comes with three codes, the last of which is the most customizable one. I added two more (looseness) parameters, and playing with them allowed me to draw



documentclass[tikz,border=3.14mm]{standalone}
usepackage{tikz-3dplot}
begin{document}
tdplotsetmaincoords{70}{110}
begin{tikzpicture}[tdplot_main_coords,rotate=-60]
%path[tdplot_screen_coords,use as bounding box] (-3.2,-3.2) rectangle (4,4.5);
pgfmathsetmacro{R}{3}
pgfmathsetmacro{myang}{10} % controls the diameter of the handle
pgfmathsetmacro{angtop}{-80}
pgfmathsetmacro{angright}{95}
pgfmathsetmacro{out}{55}
pgfmathsetmacro{LooOne}{5.2}
pgfmathsetmacro{LooTwo}{4.2}
coordinate (O) at (0,0,0);
shadedraw [ball color=gray!40,tdplot_screen_coords] (0,0,0) circle(R);
path
({R*sin(myang)*cos(angtop)},{R*sin(myang)*sin(angtop)},{R*cos(myang)})
coordinate (P2)
({R*sin(myang)*cos(angright)},{-R*sin(myang)*sin(angright)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(angright)*sin(out)})
coordinate (P1);
draw[opacity=0.5,
right color=white,left color=gray!40!white,shading angle={-225+(90-out)/2}]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
draw[dashed] plot[variable=x,domain=angtop:angtop-180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
plot[variable=x,domain=angright:angright+180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)});
shadedraw [ball color=gray!50,opacity=0.5]
plot[variable=x,domain=angtop:angtop+180,samples=91]
({3*sin(myang)*cos(x)},{3*sin(myang)*sin(x)},{3*cos(myang)})
to[out=90,in=90-out,looseness=LooOne] (P1)
plot[variable=x,domain=angright:angright-180,samples=91]
({R*sin(myang)*cos(x)},{-R*sin(myang)*sin(x)*cos(out)+R*cos(myang)*sin(out)},
{R*cos(myang)*cos(out)+R*sin(myang)*sin(x)*sin(out)})
to[out=90-out,in=90,looseness=LooTwo] (P2);
end{tikzpicture}
end{document}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 14 hours ago

























answered 14 hours ago









marmotmarmot

116k5147277




116k5147277








  • 1





    A dotted portion at the bottom of the handle is missing in this figure@marmot

    – MKS
    14 hours ago






  • 1





    @MKS I added them....

    – marmot
    14 hours ago














  • 1





    A dotted portion at the bottom of the handle is missing in this figure@marmot

    – MKS
    14 hours ago






  • 1





    @MKS I added them....

    – marmot
    14 hours ago








1




1





A dotted portion at the bottom of the handle is missing in this figure@marmot

– MKS
14 hours ago





A dotted portion at the bottom of the handle is missing in this figure@marmot

– MKS
14 hours ago




1




1





@MKS I added them....

– marmot
14 hours ago





@MKS I added them....

– marmot
14 hours ago


















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%2f483788%2fdraw-a-sphere-with-one-handle-with-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

El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

Castillo d'Acher Características Menú de navegación

Connecting two nodes from the same mother node horizontallyTikZ: What EXACTLY does the the |- notation for...