Shift control points from Bezier curves
Is it possible to add an offset to the control points of the bezier curves to make my red line to pass through the center of the point cloud?
Here is my mwe:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (firewall) and (cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
And here is the output:
bezier
add a comment |
Is it possible to add an offset to the control points of the bezier curves to make my red line to pass through the center of the point cloud?
Here is my mwe:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (firewall) and (cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
And here is the output:
bezier
1
If this is what you want, then just set both the control in the red line to cloud:.. controls (cloud) ..
in place of.. controls (firewall) and (cloud) ..
.
– Partha D.
Jan 28 at 12:54
Oky, this will do it, but is there any option to add an offset?
– Warok
Jan 28 at 15:38
add a comment |
Is it possible to add an offset to the control points of the bezier curves to make my red line to pass through the center of the point cloud?
Here is my mwe:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (firewall) and (cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
And here is the output:
bezier
Is it possible to add an offset to the control points of the bezier curves to make my red line to pass through the center of the point cloud?
Here is my mwe:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (firewall) and (cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
And here is the output:
bezier
bezier
asked Jan 28 at 8:10
WarokWarok
1289
1289
1
If this is what you want, then just set both the control in the red line to cloud:.. controls (cloud) ..
in place of.. controls (firewall) and (cloud) ..
.
– Partha D.
Jan 28 at 12:54
Oky, this will do it, but is there any option to add an offset?
– Warok
Jan 28 at 15:38
add a comment |
1
If this is what you want, then just set both the control in the red line to cloud:.. controls (cloud) ..
in place of.. controls (firewall) and (cloud) ..
.
– Partha D.
Jan 28 at 12:54
Oky, this will do it, but is there any option to add an offset?
– Warok
Jan 28 at 15:38
1
1
If this is what you want, then just set both the control in the red line to cloud:
.. controls (cloud) ..
in place of .. controls (firewall) and (cloud) ..
.– Partha D.
Jan 28 at 12:54
If this is what you want, then just set both the control in the red line to cloud:
.. controls (cloud) ..
in place of .. controls (firewall) and (cloud) ..
.– Partha D.
Jan 28 at 12:54
Oky, this will do it, but is there any option to add an offset?
– Warok
Jan 28 at 15:38
Oky, this will do it, but is there any option to add an offset?
– Warok
Jan 28 at 15:38
add a comment |
2 Answers
2
active
oldest
votes
Is that close to what you are asking for:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
%label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls ([yshift=-2.5cm]firewall) and ([xshift=-1cm]cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
Nice job, thanks man
– Warok
Jan 29 at 9:36
@Warok Pleased to know that your problem is fixed
– Hafid Boukhoulda
Jan 29 at 10:50
add a comment |
While @Hafid Boukhoulda gives a flexible, general approach for offset, setting both the control points to the same point (cloud)
makes the Beizer curve look smooth, simple and beautiful -- and hence could be another choice to consider if it meets your requirements.
...for which I used the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [label=right:XXX]
(firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [label=above:XXX]
(client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=XXX]
(dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=center:{}]
(cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [label=below:XXX]
(server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [label=right:XXX]
(server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (cloud) .. (server1)node{};
% only one control (cloud) instead of two
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
Nice job, thanks dude
– Warok
Jan 29 at 9:36
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%2f472185%2fshift-control-points-from-bezier-curves%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
Is that close to what you are asking for:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
%label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls ([yshift=-2.5cm]firewall) and ([xshift=-1cm]cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
Nice job, thanks man
– Warok
Jan 29 at 9:36
@Warok Pleased to know that your problem is fixed
– Hafid Boukhoulda
Jan 29 at 10:50
add a comment |
Is that close to what you are asking for:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
%label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls ([yshift=-2.5cm]firewall) and ([xshift=-1cm]cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
Nice job, thanks man
– Warok
Jan 29 at 9:36
@Warok Pleased to know that your problem is fixed
– Hafid Boukhoulda
Jan 29 at 10:50
add a comment |
Is that close to what you are asking for:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
%label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls ([yshift=-2.5cm]firewall) and ([xshift=-1cm]cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
Is that close to what you are asking for:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [
label=right:XXX,
] (firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [
label=above:XXX
] (client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
label=XXX
] (dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [
%label=center:XXX,
] (cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [
label=below:XXX
] (server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [
label=right:XXX
] (server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls ([yshift=-2.5cm]firewall) and ([xshift=-1cm]cloud).. (server1)node{};
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
answered Jan 28 at 18:34
Hafid BoukhouldaHafid Boukhoulda
3,0921520
3,0921520
Nice job, thanks man
– Warok
Jan 29 at 9:36
@Warok Pleased to know that your problem is fixed
– Hafid Boukhoulda
Jan 29 at 10:50
add a comment |
Nice job, thanks man
– Warok
Jan 29 at 9:36
@Warok Pleased to know that your problem is fixed
– Hafid Boukhoulda
Jan 29 at 10:50
Nice job, thanks man
– Warok
Jan 29 at 9:36
Nice job, thanks man
– Warok
Jan 29 at 9:36
@Warok Pleased to know that your problem is fixed
– Hafid Boukhoulda
Jan 29 at 10:50
@Warok Pleased to know that your problem is fixed
– Hafid Boukhoulda
Jan 29 at 10:50
add a comment |
While @Hafid Boukhoulda gives a flexible, general approach for offset, setting both the control points to the same point (cloud)
makes the Beizer curve look smooth, simple and beautiful -- and hence could be another choice to consider if it meets your requirements.
...for which I used the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [label=right:XXX]
(firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [label=above:XXX]
(client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=XXX]
(dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=center:{}]
(cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [label=below:XXX]
(server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [label=right:XXX]
(server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (cloud) .. (server1)node{};
% only one control (cloud) instead of two
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
Nice job, thanks dude
– Warok
Jan 29 at 9:36
add a comment |
While @Hafid Boukhoulda gives a flexible, general approach for offset, setting both the control points to the same point (cloud)
makes the Beizer curve look smooth, simple and beautiful -- and hence could be another choice to consider if it meets your requirements.
...for which I used the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [label=right:XXX]
(firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [label=above:XXX]
(client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=XXX]
(dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=center:{}]
(cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [label=below:XXX]
(server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [label=right:XXX]
(server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (cloud) .. (server1)node{};
% only one control (cloud) instead of two
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
Nice job, thanks dude
– Warok
Jan 29 at 9:36
add a comment |
While @Hafid Boukhoulda gives a flexible, general approach for offset, setting both the control points to the same point (cloud)
makes the Beizer curve look smooth, simple and beautiful -- and hence could be another choice to consider if it meets your requirements.
...for which I used the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [label=right:XXX]
(firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [label=above:XXX]
(client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=XXX]
(dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=center:{}]
(cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [label=below:XXX]
(server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [label=right:XXX]
(server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (cloud) .. (server1)node{};
% only one control (cloud) instead of two
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
While @Hafid Boukhoulda gives a flexible, general approach for offset, setting both the control points to the same point (cloud)
makes the Beizer curve look smooth, simple and beautiful -- and hence could be another choice to consider if it meets your requirements.
...for which I used the code:
documentclass{article}
usepackage{xcolor}
usepackage{tikz}
usetikzlibrary{chains}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds}
usetikzlibrary{trees}
usetikzlibrary{arrows,automata}
usepackage{epstopdf}
definecolor{mycolor}{RGB}{8,108,131}
usepackage{array}
usepackage{adjustbox}
usetikzlibrary{shapes}
begin{document}
begin{tikzpicture}[
scale=0.8,
transform shape,
show background rectangle,
background rectangle/.style={fill=gray!10},
box/.style={draw, font=itshape}
]
coordinate (b) at (current page.center);
node [label=right:XXX]
(firewall)at(b) {includegraphics[width=9mm]{example-image-a}};
node [label=above:XXX]
(client) at ([yshift=2cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=XXX]
(dnsServer) at([xshift=-5cm]firewall){includegraphics[width=9mm]{example-image-a}};
node [label=center:{}]
(cloud) at ([yshift=-2cm]firewall){includegraphics[width=9mm]{example-image-b}};
node [label=below:XXX]
(server1) at([xshift=5cm]cloud){includegraphics[width=9mm]{example-image-a}};
node [label=right:XXX]
(server2) at([xshift=5cm]server1){includegraphics[width=9mm]{example-image-a}};
draw [thick,mycolor,->](client) .. controls (firewall) .. (dnsServer)node[very near start, left]{1};
draw [thick,mycolor,->](dnsServer) .. controls (firewall)and (cloud) .. (server1)node[very near end, left]{2};
draw [thick,mycolor,<->](server1)--(server2)node[midway,above]{3 et 4};
draw [thick,mycolor,->](server1) .. controls (cloud) and (firewall).. (client)node[very near start, right]{5};
draw [thick,red,->](client) .. controls (cloud) .. (server1)node{};
% only one control (cloud) instead of two
path[mycolor,->] (client) edge [loop right] node {6} ();
end{tikzpicture}
end{document}
answered Jan 29 at 3:31
Partha D.Partha D.
76517
76517
Nice job, thanks dude
– Warok
Jan 29 at 9:36
add a comment |
Nice job, thanks dude
– Warok
Jan 29 at 9:36
Nice job, thanks dude
– Warok
Jan 29 at 9:36
Nice job, thanks dude
– Warok
Jan 29 at 9:36
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%2f472185%2fshift-control-points-from-bezier-curves%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
1
If this is what you want, then just set both the control in the red line to cloud:
.. controls (cloud) ..
in place of.. controls (firewall) and (cloud) ..
.– Partha D.
Jan 28 at 12:54
Oky, this will do it, but is there any option to add an offset?
– Warok
Jan 28 at 15:38