Surface of genus 3 tikz
I want to draw a surface of genus 3. I produced this
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{tikzpicture}
end{document}
Which gives me
Now, I would like to get 2 copies of this, rotate them and glue them together to get one surface. Is there an easy way to do this?
tikz-pgf rotating draw
add a comment |
I want to draw a surface of genus 3. I produced this
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{tikzpicture}
end{document}
Which gives me
Now, I would like to get 2 copies of this, rotate them and glue them together to get one surface. Is there an easy way to do this?
tikz-pgf rotating draw
It's a nice question, but your code produces quite a bumpy handle, plus the way you draw the "hole" should probably not be rotated. I think you might get prettier results, if you allowed answers that just draw a surface of genus 3 in tikz without using your code... (I hope you don't take offence — I don't mean to be snarky.)
– Earthliŋ
Dec 20 '18 at 19:05
I definitely agree that the "hole" shouldn't be rotated. And yes, the handle is not the nicest. What would be a better approach?
– mathstackuser
Dec 21 '18 at 10:21
Charles Staat's solution to my problem (tex.stackexchange.com/questions/231515/draw-a-smooth-surface) is a beautiful genus 3 surface.
– Benjamin McKay
Dec 21 '18 at 20:48
add a comment |
I want to draw a surface of genus 3. I produced this
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{tikzpicture}
end{document}
Which gives me
Now, I would like to get 2 copies of this, rotate them and glue them together to get one surface. Is there an easy way to do this?
tikz-pgf rotating draw
I want to draw a surface of genus 3. I produced this
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{tikzpicture}
end{document}
Which gives me
Now, I would like to get 2 copies of this, rotate them and glue them together to get one surface. Is there an easy way to do this?
tikz-pgf rotating draw
tikz-pgf rotating draw
edited Dec 20 '18 at 14:50
samcarter
87.9k797281
87.9k797281
asked Dec 20 '18 at 10:52
mathstackusermathstackuser
1996
1996
It's a nice question, but your code produces quite a bumpy handle, plus the way you draw the "hole" should probably not be rotated. I think you might get prettier results, if you allowed answers that just draw a surface of genus 3 in tikz without using your code... (I hope you don't take offence — I don't mean to be snarky.)
– Earthliŋ
Dec 20 '18 at 19:05
I definitely agree that the "hole" shouldn't be rotated. And yes, the handle is not the nicest. What would be a better approach?
– mathstackuser
Dec 21 '18 at 10:21
Charles Staat's solution to my problem (tex.stackexchange.com/questions/231515/draw-a-smooth-surface) is a beautiful genus 3 surface.
– Benjamin McKay
Dec 21 '18 at 20:48
add a comment |
It's a nice question, but your code produces quite a bumpy handle, plus the way you draw the "hole" should probably not be rotated. I think you might get prettier results, if you allowed answers that just draw a surface of genus 3 in tikz without using your code... (I hope you don't take offence — I don't mean to be snarky.)
– Earthliŋ
Dec 20 '18 at 19:05
I definitely agree that the "hole" shouldn't be rotated. And yes, the handle is not the nicest. What would be a better approach?
– mathstackuser
Dec 21 '18 at 10:21
Charles Staat's solution to my problem (tex.stackexchange.com/questions/231515/draw-a-smooth-surface) is a beautiful genus 3 surface.
– Benjamin McKay
Dec 21 '18 at 20:48
It's a nice question, but your code produces quite a bumpy handle, plus the way you draw the "hole" should probably not be rotated. I think you might get prettier results, if you allowed answers that just draw a surface of genus 3 in tikz without using your code... (I hope you don't take offence — I don't mean to be snarky.)
– Earthliŋ
Dec 20 '18 at 19:05
It's a nice question, but your code produces quite a bumpy handle, plus the way you draw the "hole" should probably not be rotated. I think you might get prettier results, if you allowed answers that just draw a surface of genus 3 in tikz without using your code... (I hope you don't take offence — I don't mean to be snarky.)
– Earthliŋ
Dec 20 '18 at 19:05
I definitely agree that the "hole" shouldn't be rotated. And yes, the handle is not the nicest. What would be a better approach?
– mathstackuser
Dec 21 '18 at 10:21
I definitely agree that the "hole" shouldn't be rotated. And yes, the handle is not the nicest. What would be a better approach?
– mathstackuser
Dec 21 '18 at 10:21
Charles Staat's solution to my problem (tex.stackexchange.com/questions/231515/draw-a-smooth-surface) is a beautiful genus 3 surface.
– Benjamin McKay
Dec 21 '18 at 20:48
Charles Staat's solution to my problem (tex.stackexchange.com/questions/231515/draw-a-smooth-surface) is a beautiful genus 3 surface.
– Benjamin McKay
Dec 21 '18 at 20:48
add a comment |
3 Answers
3
active
oldest
votes
This is what pic
s are made for. You can rotate (and stretch etc.) them and also name coordinates within them that get prefixed. That allows you to connect the handles in a smooth way.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic {handle};
end{tikzpicture}
begin{tikzpicture}
pic (lower) at (0,1) {handle};
pic[rotate=180] (upper) at (0,-1) {handle};
draw (lower-left) to[out=130,in=-130] (upper-right);
draw (lower-right) to[out=50,in=-50] (upper-left);
end{tikzpicture}
end{document}
Harald Hanche-Olsen reminded me what genus-3 is, so I read the question wrong. Big thanks to Harald.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (-0.5,0.85) {handle};
pic[rotate around={120:(120:1)}] (tr) at (-120:1) {handle};
pic[rotate around={-120:(-120:-1)}] (tl) at (-120:1) {handle};
end{tikzpicture}
end{document}
Here is an arguably nicer looking alternative.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw[fill=gray!20] (-2,0) coordinate (-left)
to [out=260, in=60] (-3,-2)
to [out=240, in=110] (-3,-4)
to [out=290,in=180] (0,-6)
to [out=0,in=250] (3,-4)
to [out=70,in=300] (3,-2)
to [out=120,in=280] (2,0) coordinate (-right);
pgfgettransformentries{tmpa}{tmpb}{tmp}{tmp}{tmp}{tmp}
pgfmathsetmacro{myrot}{-atan2(tmpb,tmpa)}
draw[rotate around={myrot:(0,-2.5)}] (-1.2,-2.4) to[bend right] (1.2,-2.4);
draw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] (1,-2.5)
to[bend right] (-1,-2.5);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (0,-pi) {handle};
pic[rotate=120] (tr) at (30:pi) {handle};
pic[rotate=-120] (tl) at (150:pi) {handle};
fill[gray!20] (lower-right) to[out=100,in=200] (tr-left)--
(tr-right) to[out=-130,in=-40] (tl-left)
-- (tl-right) to[out=-20,in=80] (lower-left) -- cycle;
draw (lower-right) to[out=100,in=200] (tr-left);
draw (tr-right) to[out=-130,in=-40] (tl-left);
draw (tl-right) to[out=-20,in=80] (lower-left);
end{tikzpicture}
end{document}
2
A good answer so far, but to get genus 3, you need to have three copies stitched together. You want one in the original orientation, and the two others rotated 120 and 240 degrees respectively. I don't want to steal your code for an answer of my own, so leave it to you to implement it. 8-)
– Harald Hanche-Olsen
Dec 20 '18 at 14:26
@HaraldHanche-Olsen Thanks! I was not sure what the OP wants. I read "2 copies" in the way that the OP want only two handles. But you are right, genus-3 suggests that you read the question correctly. Thanks again!
– marmot
Dec 20 '18 at 14:45
Good! Now it's up to the OP to adjust the beginning and ending angles appropriately in order to get a smooth transition.
– Harald Hanche-Olsen
Dec 20 '18 at 15:34
1
I added something. +1 for your own proposal.
– marmot
Dec 21 '18 at 13:00
1
@mathstackuser You can use almost precisely what you suggest: usedraw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] coordinate[pos=0.7] (-A) (1,-2.5) to[bend right] (-1,-2.5);
in the definition of thepic
and then you can access the coordinate from outside withdraw (lower-A) -- ++ (2,-2);
Note that there is a prefix, but this is of course good because each of thepics
will then produce unique coordinates (as long as their names are unique).
– marmot
Jan 14 at 16:54
|
show 4 more comments
Quick and dirty
documentclass[margin=0pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
begin{scope}[rotate=180]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
begin{scope}[yshift=3cm]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
end{tikzpicture}
end{document}
add a comment |
Editing some angles, this is what I got
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 1
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=120] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 2
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=240] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 3
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(-5.8 cm,10.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(-5.8 cm,10.25cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
node[above] (v1) at (0,0) {$x$}; %Beschriftung Basispunkt
node[below] at (0,-9.5) {1}; %Beschriftung Tori
node[right] at (8.25,4.7) {2}; %Beschriftung Tori
node[left] at (-8.25,4.7) {3}; %Beschriftung Tori
end{tikzpicture}
end{document}
This produces
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%2f466669%2fsurface-of-genus-3-tikz%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is what pic
s are made for. You can rotate (and stretch etc.) them and also name coordinates within them that get prefixed. That allows you to connect the handles in a smooth way.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic {handle};
end{tikzpicture}
begin{tikzpicture}
pic (lower) at (0,1) {handle};
pic[rotate=180] (upper) at (0,-1) {handle};
draw (lower-left) to[out=130,in=-130] (upper-right);
draw (lower-right) to[out=50,in=-50] (upper-left);
end{tikzpicture}
end{document}
Harald Hanche-Olsen reminded me what genus-3 is, so I read the question wrong. Big thanks to Harald.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (-0.5,0.85) {handle};
pic[rotate around={120:(120:1)}] (tr) at (-120:1) {handle};
pic[rotate around={-120:(-120:-1)}] (tl) at (-120:1) {handle};
end{tikzpicture}
end{document}
Here is an arguably nicer looking alternative.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw[fill=gray!20] (-2,0) coordinate (-left)
to [out=260, in=60] (-3,-2)
to [out=240, in=110] (-3,-4)
to [out=290,in=180] (0,-6)
to [out=0,in=250] (3,-4)
to [out=70,in=300] (3,-2)
to [out=120,in=280] (2,0) coordinate (-right);
pgfgettransformentries{tmpa}{tmpb}{tmp}{tmp}{tmp}{tmp}
pgfmathsetmacro{myrot}{-atan2(tmpb,tmpa)}
draw[rotate around={myrot:(0,-2.5)}] (-1.2,-2.4) to[bend right] (1.2,-2.4);
draw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] (1,-2.5)
to[bend right] (-1,-2.5);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (0,-pi) {handle};
pic[rotate=120] (tr) at (30:pi) {handle};
pic[rotate=-120] (tl) at (150:pi) {handle};
fill[gray!20] (lower-right) to[out=100,in=200] (tr-left)--
(tr-right) to[out=-130,in=-40] (tl-left)
-- (tl-right) to[out=-20,in=80] (lower-left) -- cycle;
draw (lower-right) to[out=100,in=200] (tr-left);
draw (tr-right) to[out=-130,in=-40] (tl-left);
draw (tl-right) to[out=-20,in=80] (lower-left);
end{tikzpicture}
end{document}
2
A good answer so far, but to get genus 3, you need to have three copies stitched together. You want one in the original orientation, and the two others rotated 120 and 240 degrees respectively. I don't want to steal your code for an answer of my own, so leave it to you to implement it. 8-)
– Harald Hanche-Olsen
Dec 20 '18 at 14:26
@HaraldHanche-Olsen Thanks! I was not sure what the OP wants. I read "2 copies" in the way that the OP want only two handles. But you are right, genus-3 suggests that you read the question correctly. Thanks again!
– marmot
Dec 20 '18 at 14:45
Good! Now it's up to the OP to adjust the beginning and ending angles appropriately in order to get a smooth transition.
– Harald Hanche-Olsen
Dec 20 '18 at 15:34
1
I added something. +1 for your own proposal.
– marmot
Dec 21 '18 at 13:00
1
@mathstackuser You can use almost precisely what you suggest: usedraw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] coordinate[pos=0.7] (-A) (1,-2.5) to[bend right] (-1,-2.5);
in the definition of thepic
and then you can access the coordinate from outside withdraw (lower-A) -- ++ (2,-2);
Note that there is a prefix, but this is of course good because each of thepics
will then produce unique coordinates (as long as their names are unique).
– marmot
Jan 14 at 16:54
|
show 4 more comments
This is what pic
s are made for. You can rotate (and stretch etc.) them and also name coordinates within them that get prefixed. That allows you to connect the handles in a smooth way.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic {handle};
end{tikzpicture}
begin{tikzpicture}
pic (lower) at (0,1) {handle};
pic[rotate=180] (upper) at (0,-1) {handle};
draw (lower-left) to[out=130,in=-130] (upper-right);
draw (lower-right) to[out=50,in=-50] (upper-left);
end{tikzpicture}
end{document}
Harald Hanche-Olsen reminded me what genus-3 is, so I read the question wrong. Big thanks to Harald.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (-0.5,0.85) {handle};
pic[rotate around={120:(120:1)}] (tr) at (-120:1) {handle};
pic[rotate around={-120:(-120:-1)}] (tl) at (-120:1) {handle};
end{tikzpicture}
end{document}
Here is an arguably nicer looking alternative.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw[fill=gray!20] (-2,0) coordinate (-left)
to [out=260, in=60] (-3,-2)
to [out=240, in=110] (-3,-4)
to [out=290,in=180] (0,-6)
to [out=0,in=250] (3,-4)
to [out=70,in=300] (3,-2)
to [out=120,in=280] (2,0) coordinate (-right);
pgfgettransformentries{tmpa}{tmpb}{tmp}{tmp}{tmp}{tmp}
pgfmathsetmacro{myrot}{-atan2(tmpb,tmpa)}
draw[rotate around={myrot:(0,-2.5)}] (-1.2,-2.4) to[bend right] (1.2,-2.4);
draw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] (1,-2.5)
to[bend right] (-1,-2.5);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (0,-pi) {handle};
pic[rotate=120] (tr) at (30:pi) {handle};
pic[rotate=-120] (tl) at (150:pi) {handle};
fill[gray!20] (lower-right) to[out=100,in=200] (tr-left)--
(tr-right) to[out=-130,in=-40] (tl-left)
-- (tl-right) to[out=-20,in=80] (lower-left) -- cycle;
draw (lower-right) to[out=100,in=200] (tr-left);
draw (tr-right) to[out=-130,in=-40] (tl-left);
draw (tl-right) to[out=-20,in=80] (lower-left);
end{tikzpicture}
end{document}
2
A good answer so far, but to get genus 3, you need to have three copies stitched together. You want one in the original orientation, and the two others rotated 120 and 240 degrees respectively. I don't want to steal your code for an answer of my own, so leave it to you to implement it. 8-)
– Harald Hanche-Olsen
Dec 20 '18 at 14:26
@HaraldHanche-Olsen Thanks! I was not sure what the OP wants. I read "2 copies" in the way that the OP want only two handles. But you are right, genus-3 suggests that you read the question correctly. Thanks again!
– marmot
Dec 20 '18 at 14:45
Good! Now it's up to the OP to adjust the beginning and ending angles appropriately in order to get a smooth transition.
– Harald Hanche-Olsen
Dec 20 '18 at 15:34
1
I added something. +1 for your own proposal.
– marmot
Dec 21 '18 at 13:00
1
@mathstackuser You can use almost precisely what you suggest: usedraw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] coordinate[pos=0.7] (-A) (1,-2.5) to[bend right] (-1,-2.5);
in the definition of thepic
and then you can access the coordinate from outside withdraw (lower-A) -- ++ (2,-2);
Note that there is a prefix, but this is of course good because each of thepics
will then produce unique coordinates (as long as their names are unique).
– marmot
Jan 14 at 16:54
|
show 4 more comments
This is what pic
s are made for. You can rotate (and stretch etc.) them and also name coordinates within them that get prefixed. That allows you to connect the handles in a smooth way.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic {handle};
end{tikzpicture}
begin{tikzpicture}
pic (lower) at (0,1) {handle};
pic[rotate=180] (upper) at (0,-1) {handle};
draw (lower-left) to[out=130,in=-130] (upper-right);
draw (lower-right) to[out=50,in=-50] (upper-left);
end{tikzpicture}
end{document}
Harald Hanche-Olsen reminded me what genus-3 is, so I read the question wrong. Big thanks to Harald.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (-0.5,0.85) {handle};
pic[rotate around={120:(120:1)}] (tr) at (-120:1) {handle};
pic[rotate around={-120:(-120:-1)}] (tl) at (-120:1) {handle};
end{tikzpicture}
end{document}
Here is an arguably nicer looking alternative.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw[fill=gray!20] (-2,0) coordinate (-left)
to [out=260, in=60] (-3,-2)
to [out=240, in=110] (-3,-4)
to [out=290,in=180] (0,-6)
to [out=0,in=250] (3,-4)
to [out=70,in=300] (3,-2)
to [out=120,in=280] (2,0) coordinate (-right);
pgfgettransformentries{tmpa}{tmpb}{tmp}{tmp}{tmp}{tmp}
pgfmathsetmacro{myrot}{-atan2(tmpb,tmpa)}
draw[rotate around={myrot:(0,-2.5)}] (-1.2,-2.4) to[bend right] (1.2,-2.4);
draw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] (1,-2.5)
to[bend right] (-1,-2.5);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (0,-pi) {handle};
pic[rotate=120] (tr) at (30:pi) {handle};
pic[rotate=-120] (tl) at (150:pi) {handle};
fill[gray!20] (lower-right) to[out=100,in=200] (tr-left)--
(tr-right) to[out=-130,in=-40] (tl-left)
-- (tl-right) to[out=-20,in=80] (lower-left) -- cycle;
draw (lower-right) to[out=100,in=200] (tr-left);
draw (tr-right) to[out=-130,in=-40] (tl-left);
draw (tl-right) to[out=-20,in=80] (lower-left);
end{tikzpicture}
end{document}
This is what pic
s are made for. You can rotate (and stretch etc.) them and also name coordinates within them that get prefixed. That allows you to connect the handles in a smooth way.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic {handle};
end{tikzpicture}
begin{tikzpicture}
pic (lower) at (0,1) {handle};
pic[rotate=180] (upper) at (0,-1) {handle};
draw (lower-left) to[out=130,in=-130] (upper-right);
draw (lower-right) to[out=50,in=-50] (upper-left);
end{tikzpicture}
end{document}
Harald Hanche-Olsen reminded me what genus-3 is, so I read the question wrong. Big thanks to Harald.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw (-2.6,-1.5) coordinate (-left) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5) coordinate (-right);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (-0.5,0.85) {handle};
pic[rotate around={120:(120:1)}] (tr) at (-120:1) {handle};
pic[rotate around={-120:(-120:-1)}] (tl) at (-120:1) {handle};
end{tikzpicture}
end{document}
Here is an arguably nicer looking alternative.
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
tikzset{pics/.cd,
handle/.style={code={
draw[fill=gray!20] (-2,0) coordinate (-left)
to [out=260, in=60] (-3,-2)
to [out=240, in=110] (-3,-4)
to [out=290,in=180] (0,-6)
to [out=0,in=250] (3,-4)
to [out=70,in=300] (3,-2)
to [out=120,in=280] (2,0) coordinate (-right);
pgfgettransformentries{tmpa}{tmpb}{tmp}{tmp}{tmp}{tmp}
pgfmathsetmacro{myrot}{-atan2(tmpb,tmpa)}
draw[rotate around={myrot:(0,-2.5)}] (-1.2,-2.4) to[bend right] (1.2,-2.4);
draw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] (1,-2.5)
to[bend right] (-1,-2.5);
}}}
begin{document}
begin{tikzpicture}
pic (lower) at (0,-pi) {handle};
pic[rotate=120] (tr) at (30:pi) {handle};
pic[rotate=-120] (tl) at (150:pi) {handle};
fill[gray!20] (lower-right) to[out=100,in=200] (tr-left)--
(tr-right) to[out=-130,in=-40] (tl-left)
-- (tl-right) to[out=-20,in=80] (lower-left) -- cycle;
draw (lower-right) to[out=100,in=200] (tr-left);
draw (tr-right) to[out=-130,in=-40] (tl-left);
draw (tl-right) to[out=-20,in=80] (lower-left);
end{tikzpicture}
end{document}
edited Dec 21 '18 at 17:02
answered Dec 20 '18 at 13:12
marmotmarmot
93.8k4109208
93.8k4109208
2
A good answer so far, but to get genus 3, you need to have three copies stitched together. You want one in the original orientation, and the two others rotated 120 and 240 degrees respectively. I don't want to steal your code for an answer of my own, so leave it to you to implement it. 8-)
– Harald Hanche-Olsen
Dec 20 '18 at 14:26
@HaraldHanche-Olsen Thanks! I was not sure what the OP wants. I read "2 copies" in the way that the OP want only two handles. But you are right, genus-3 suggests that you read the question correctly. Thanks again!
– marmot
Dec 20 '18 at 14:45
Good! Now it's up to the OP to adjust the beginning and ending angles appropriately in order to get a smooth transition.
– Harald Hanche-Olsen
Dec 20 '18 at 15:34
1
I added something. +1 for your own proposal.
– marmot
Dec 21 '18 at 13:00
1
@mathstackuser You can use almost precisely what you suggest: usedraw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] coordinate[pos=0.7] (-A) (1,-2.5) to[bend right] (-1,-2.5);
in the definition of thepic
and then you can access the coordinate from outside withdraw (lower-A) -- ++ (2,-2);
Note that there is a prefix, but this is of course good because each of thepics
will then produce unique coordinates (as long as their names are unique).
– marmot
Jan 14 at 16:54
|
show 4 more comments
2
A good answer so far, but to get genus 3, you need to have three copies stitched together. You want one in the original orientation, and the two others rotated 120 and 240 degrees respectively. I don't want to steal your code for an answer of my own, so leave it to you to implement it. 8-)
– Harald Hanche-Olsen
Dec 20 '18 at 14:26
@HaraldHanche-Olsen Thanks! I was not sure what the OP wants. I read "2 copies" in the way that the OP want only two handles. But you are right, genus-3 suggests that you read the question correctly. Thanks again!
– marmot
Dec 20 '18 at 14:45
Good! Now it's up to the OP to adjust the beginning and ending angles appropriately in order to get a smooth transition.
– Harald Hanche-Olsen
Dec 20 '18 at 15:34
1
I added something. +1 for your own proposal.
– marmot
Dec 21 '18 at 13:00
1
@mathstackuser You can use almost precisely what you suggest: usedraw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] coordinate[pos=0.7] (-A) (1,-2.5) to[bend right] (-1,-2.5);
in the definition of thepic
and then you can access the coordinate from outside withdraw (lower-A) -- ++ (2,-2);
Note that there is a prefix, but this is of course good because each of thepics
will then produce unique coordinates (as long as their names are unique).
– marmot
Jan 14 at 16:54
2
2
A good answer so far, but to get genus 3, you need to have three copies stitched together. You want one in the original orientation, and the two others rotated 120 and 240 degrees respectively. I don't want to steal your code for an answer of my own, so leave it to you to implement it. 8-)
– Harald Hanche-Olsen
Dec 20 '18 at 14:26
A good answer so far, but to get genus 3, you need to have three copies stitched together. You want one in the original orientation, and the two others rotated 120 and 240 degrees respectively. I don't want to steal your code for an answer of my own, so leave it to you to implement it. 8-)
– Harald Hanche-Olsen
Dec 20 '18 at 14:26
@HaraldHanche-Olsen Thanks! I was not sure what the OP wants. I read "2 copies" in the way that the OP want only two handles. But you are right, genus-3 suggests that you read the question correctly. Thanks again!
– marmot
Dec 20 '18 at 14:45
@HaraldHanche-Olsen Thanks! I was not sure what the OP wants. I read "2 copies" in the way that the OP want only two handles. But you are right, genus-3 suggests that you read the question correctly. Thanks again!
– marmot
Dec 20 '18 at 14:45
Good! Now it's up to the OP to adjust the beginning and ending angles appropriately in order to get a smooth transition.
– Harald Hanche-Olsen
Dec 20 '18 at 15:34
Good! Now it's up to the OP to adjust the beginning and ending angles appropriately in order to get a smooth transition.
– Harald Hanche-Olsen
Dec 20 '18 at 15:34
1
1
I added something. +1 for your own proposal.
– marmot
Dec 21 '18 at 13:00
I added something. +1 for your own proposal.
– marmot
Dec 21 '18 at 13:00
1
1
@mathstackuser You can use almost precisely what you suggest: use
draw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] coordinate[pos=0.7] (-A) (1,-2.5) to[bend right] (-1,-2.5);
in the definition of the pic
and then you can access the coordinate from outside with draw (lower-A) -- ++ (2,-2);
Note that there is a prefix, but this is of course good because each of the pics
will then produce unique coordinates (as long as their names are unique).– marmot
Jan 14 at 16:54
@mathstackuser You can use almost precisely what you suggest: use
draw[fill=white,rotate around={myrot:(0,-2.5)}] (-1,-2.5) to[bend right] coordinate[pos=0.7] (-A) (1,-2.5) to[bend right] (-1,-2.5);
in the definition of the pic
and then you can access the coordinate from outside with draw (lower-A) -- ++ (2,-2);
Note that there is a prefix, but this is of course good because each of the pics
will then produce unique coordinates (as long as their names are unique).– marmot
Jan 14 at 16:54
|
show 4 more comments
Quick and dirty
documentclass[margin=0pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
begin{scope}[rotate=180]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
begin{scope}[yshift=3cm]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
end{tikzpicture}
end{document}
add a comment |
Quick and dirty
documentclass[margin=0pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
begin{scope}[rotate=180]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
begin{scope}[yshift=3cm]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
end{tikzpicture}
end{document}
add a comment |
Quick and dirty
documentclass[margin=0pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
begin{scope}[rotate=180]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
begin{scope}[yshift=3cm]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
end{tikzpicture}
end{document}
Quick and dirty
documentclass[margin=0pt]{standalone}
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
begin{scope}[rotate=180]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
begin{scope}[yshift=3cm]
draw (-2.6,-1.5) to [out=320, in=70] (-2,-4) %unterer Torus
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=220] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.2,-6.4) to[bend right] (1.2,-6.4);
end{scope}
end{tikzpicture}
end{document}
answered Dec 20 '18 at 12:00
DenisDenis
2,233520
2,233520
add a comment |
add a comment |
Editing some angles, this is what I got
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 1
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=120] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 2
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=240] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 3
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(-5.8 cm,10.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(-5.8 cm,10.25cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
node[above] (v1) at (0,0) {$x$}; %Beschriftung Basispunkt
node[below] at (0,-9.5) {1}; %Beschriftung Tori
node[right] at (8.25,4.7) {2}; %Beschriftung Tori
node[left] at (-8.25,4.7) {3}; %Beschriftung Tori
end{tikzpicture}
end{document}
This produces
add a comment |
Editing some angles, this is what I got
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 1
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=120] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 2
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=240] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 3
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(-5.8 cm,10.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(-5.8 cm,10.25cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
node[above] (v1) at (0,0) {$x$}; %Beschriftung Basispunkt
node[below] at (0,-9.5) {1}; %Beschriftung Tori
node[right] at (8.25,4.7) {2}; %Beschriftung Tori
node[left] at (-8.25,4.7) {3}; %Beschriftung Tori
end{tikzpicture}
end{document}
This produces
add a comment |
Editing some angles, this is what I got
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 1
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=120] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 2
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=240] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 3
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(-5.8 cm,10.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(-5.8 cm,10.25cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
node[above] (v1) at (0,0) {$x$}; %Beschriftung Basispunkt
node[below] at (0,-9.5) {1}; %Beschriftung Tori
node[right] at (8.25,4.7) {2}; %Beschriftung Tori
node[left] at (-8.25,4.7) {3}; %Beschriftung Tori
end{tikzpicture}
end{document}
This produces
Editing some angles, this is what I got
documentclass[margin=0pt]{standalone}
%---------------------------- Tikz Libraries ------------------------------%
usepackage{tikz}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations, decorations.markings}
usetikzlibrary{arrows, arrows.meta}
begin{document}
begin{tikzpicture}
draw (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 1
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw (-1,-6.5) to[bend left] (1,-6.5);
draw (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=120] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 2
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(5.7 cm,9.25 cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
draw[rotate=240] (-2.6,-1.5) to [out=300, in=70] (-2,-4) %Torus 3
to [out=260, in=60] (-3,-6)
to [out=240, in=110] (-3,-8)
to [out=290,in=175] (0,-9.5)
to [out=5,in=250] (3,-8)
to [out=70,in=300] (3,-6)
to [out=120,in=280] (2,-4)
to [out=110,in=240] (2.6,-1.5);
draw[shift={(-5.8 cm,10.25 cm)}] (-1,-6.5) to[bend left] (1,-6.5);
draw[shift={(-5.8 cm,10.25cm)}] (-1.1,-6.43) to[bend right] (1.1,-6.43);
node[above] (v1) at (0,0) {$x$}; %Beschriftung Basispunkt
node[below] at (0,-9.5) {1}; %Beschriftung Tori
node[right] at (8.25,4.7) {2}; %Beschriftung Tori
node[left] at (-8.25,4.7) {3}; %Beschriftung Tori
end{tikzpicture}
end{document}
This produces
answered Dec 21 '18 at 10:25
mathstackusermathstackuser
1996
1996
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%2f466669%2fsurface-of-genus-3-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
It's a nice question, but your code produces quite a bumpy handle, plus the way you draw the "hole" should probably not be rotated. I think you might get prettier results, if you allowed answers that just draw a surface of genus 3 in tikz without using your code... (I hope you don't take offence — I don't mean to be snarky.)
– Earthliŋ
Dec 20 '18 at 19:05
I definitely agree that the "hole" shouldn't be rotated. And yes, the handle is not the nicest. What would be a better approach?
– mathstackuser
Dec 21 '18 at 10:21
Charles Staat's solution to my problem (tex.stackexchange.com/questions/231515/draw-a-smooth-surface) is a beautiful genus 3 surface.
– Benjamin McKay
Dec 21 '18 at 20:48