Dashed trajectory encircling two segmentsTikZ, a selfloop without an arrow at the endHow to create a line with “radial” shading?Drawing a polyline between two nodes in tikzHow can I create “unbound” horizontal bar plots?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to restrict lines by intersections with other lines pgfplotComplex TikZ graphs from multiple sources with subgraphs labeling an edgehow to combine features of tikz-picture with tikz-cd
Question about the most suitable position for a bishop here
Synaptic Static - when to roll the d6?
What is the highest power supply a Raspberry pi 3 B can handle without getting damaged?
In a list with unique pairs A, B, how can I sort them so that the last B is the first A in the next pair?
Why is Havana covered in 5-digit numbers in Our Man in Havana?
Definition of 'vrit'
Am I legally required to provide a (GPL licensed) source code even after a project is abandoned?
I just entered the USA without passport control at Atlanta airport
King or Queen-Which piece is which?
Is there any way to revive my Sim?
Setting up the trap
What preparations would Hubble have needed to return in a Shuttle?
First occurrence in the Sixers sequence
Can a character learn spells from someone else's spellbook and then sell it?
Counterfeit checks were created for my account. How does this type of fraud work?
Would a 7805 5 V regulator drain a 9 V battery?
How can I take pictures like these examples with a yellowish tone and point & shoot film camera look?
Why things float in space, though there is always gravity of our star is present
Basic power tool set for Home repair and simple projects
I have found ports on my Samsung smart tv running a display service. What can I do with it?
How "fast" do astronomical events occur?
What is this word in a sample of blackletter script?
"Correct me if I'm wrong"
If the mass of the Earth is decreasing by sending debris in space, does its angular momentum also decrease?
Dashed trajectory encircling two segments
TikZ, a selfloop without an arrow at the endHow to create a line with “radial” shading?Drawing a polyline between two nodes in tikzHow can I create “unbound” horizontal bar plots?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to restrict lines by intersections with other lines pgfplotComplex TikZ graphs from multiple sources with subgraphs labeling an edgehow to combine features of tikz-picture with tikz-cd
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In TikZ, I want to draw two segments (black) and a dashed trajectory (red) encircling these segments, as shown in the picture. Is there a way to easily draw the dashed trajectory just based on the coordinates of the two segments?

Here is my attempt:
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
endtikzpicture
It doesn't look very nice, and I wasn't able to make the curve.

tikz-pgf
New contributor
doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
In TikZ, I want to draw two segments (black) and a dashed trajectory (red) encircling these segments, as shown in the picture. Is there a way to easily draw the dashed trajectory just based on the coordinates of the two segments?

Here is my attempt:
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
endtikzpicture
It doesn't look very nice, and I wasn't able to make the curve.

tikz-pgf
New contributor
doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Welcome to TEX.SE. please show us what you have tried so far. This is not ajust-do-it-for-mesite.
– Raaja
Jun 10 at 7:23
@Raaja Thank you. I have tried searching for this on Google and a number of TikZ tutorials, but could not find how to do this. One approach would be to draw each "dash" separately, but that would be extremely tedious and I can't imagine it's the best approach. Also, I don't think it would work well for the curved part.
– doe
Jun 10 at 7:33
2
You can always start something and shows us what you have done. We can take that as a start and then give you (close to) what you want instead of starting from scratch.
– Raaja
Jun 10 at 7:46
@Raaja I have added my efforts.
– doe
Jun 10 at 8:18
You are welcome and you get my +1. Moreover, from next time, please make it compilable.
– Raaja
Jun 10 at 9:04
add a comment |
In TikZ, I want to draw two segments (black) and a dashed trajectory (red) encircling these segments, as shown in the picture. Is there a way to easily draw the dashed trajectory just based on the coordinates of the two segments?

Here is my attempt:
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
endtikzpicture
It doesn't look very nice, and I wasn't able to make the curve.

tikz-pgf
New contributor
doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
In TikZ, I want to draw two segments (black) and a dashed trajectory (red) encircling these segments, as shown in the picture. Is there a way to easily draw the dashed trajectory just based on the coordinates of the two segments?

Here is my attempt:
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
endtikzpicture
It doesn't look very nice, and I wasn't able to make the curve.

tikz-pgf
tikz-pgf
New contributor
doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Jun 10 at 8:17
doe
New contributor
doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Jun 10 at 7:01
doedoe
334
334
New contributor
doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Welcome to TEX.SE. please show us what you have tried so far. This is not ajust-do-it-for-mesite.
– Raaja
Jun 10 at 7:23
@Raaja Thank you. I have tried searching for this on Google and a number of TikZ tutorials, but could not find how to do this. One approach would be to draw each "dash" separately, but that would be extremely tedious and I can't imagine it's the best approach. Also, I don't think it would work well for the curved part.
– doe
Jun 10 at 7:33
2
You can always start something and shows us what you have done. We can take that as a start and then give you (close to) what you want instead of starting from scratch.
– Raaja
Jun 10 at 7:46
@Raaja I have added my efforts.
– doe
Jun 10 at 8:18
You are welcome and you get my +1. Moreover, from next time, please make it compilable.
– Raaja
Jun 10 at 9:04
add a comment |
1
Welcome to TEX.SE. please show us what you have tried so far. This is not ajust-do-it-for-mesite.
– Raaja
Jun 10 at 7:23
@Raaja Thank you. I have tried searching for this on Google and a number of TikZ tutorials, but could not find how to do this. One approach would be to draw each "dash" separately, but that would be extremely tedious and I can't imagine it's the best approach. Also, I don't think it would work well for the curved part.
– doe
Jun 10 at 7:33
2
You can always start something and shows us what you have done. We can take that as a start and then give you (close to) what you want instead of starting from scratch.
– Raaja
Jun 10 at 7:46
@Raaja I have added my efforts.
– doe
Jun 10 at 8:18
You are welcome and you get my +1. Moreover, from next time, please make it compilable.
– Raaja
Jun 10 at 9:04
1
1
Welcome to TEX.SE. please show us what you have tried so far. This is not a
just-do-it-for-me site.– Raaja
Jun 10 at 7:23
Welcome to TEX.SE. please show us what you have tried so far. This is not a
just-do-it-for-me site.– Raaja
Jun 10 at 7:23
@Raaja Thank you. I have tried searching for this on Google and a number of TikZ tutorials, but could not find how to do this. One approach would be to draw each "dash" separately, but that would be extremely tedious and I can't imagine it's the best approach. Also, I don't think it would work well for the curved part.
– doe
Jun 10 at 7:33
@Raaja Thank you. I have tried searching for this on Google and a number of TikZ tutorials, but could not find how to do this. One approach would be to draw each "dash" separately, but that would be extremely tedious and I can't imagine it's the best approach. Also, I don't think it would work well for the curved part.
– doe
Jun 10 at 7:33
2
2
You can always start something and shows us what you have done. We can take that as a start and then give you (close to) what you want instead of starting from scratch.
– Raaja
Jun 10 at 7:46
You can always start something and shows us what you have done. We can take that as a start and then give you (close to) what you want instead of starting from scratch.
– Raaja
Jun 10 at 7:46
@Raaja I have added my efforts.
– doe
Jun 10 at 8:18
@Raaja I have added my efforts.
– doe
Jun 10 at 8:18
You are welcome and you get my +1. Moreover, from next time, please make it compilable.
– Raaja
Jun 10 at 9:04
You are welcome and you get my +1. Moreover, from next time, please make it compilable.
– Raaja
Jun 10 at 9:04
add a comment |
2 Answers
2
active
oldest
votes
If you could accept not being dashed, a round cap can help:
documentclass[tikz, border=2mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
beginscope[xshift=2cm]
draw[line cap=round, red!30, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
beginscope[xshift=4cm]
draw[line cap=round, line width=3mm] (1,1)--(2,2)--(2,3.5);
draw[line cap=round, white, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
endtikzpicture
enddocument

Update: with some patience and hobby library you could do something like:
documentclass[tikz, border=2mm]standalone
usetikzlibraryhobby
begindocument
begintikzpicture
draw (1,1) node (a) --(2,2) node (b) --(2,3.5) node[rotate=45] (c) ;
draw[dashed, use Hobby shortcut] (a.south west) to[closed, curve through=(a.north west) .. (b.north west) .. (c.north west) .. (c.north east) .. (c.south east) .. (b.south east) .. (a.south east)] cycle;
endtikzpicture
enddocument

add a comment |
The following draws halos around simple paths as the one above. You only need to record the path
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
and then can draw a halo via
draw[dashed,halo];

documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
newcounterhalo
tikzsetrecord path/.style=/utils/exec=tikzsethalo pars/.cd,#1,
decorate,decoration=markings,mark=at position 0 with
setcounterhalo1%typeoutpgfdecoratedpathlength
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-1)
(-pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-A-2)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-3);
pgfmathsetmacromystep(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/int(1+(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/pgfkeysvalueof/tikz/halo pars/step)
xdefmystepmystep,
mark=between positions pgfkeysvalueof/tikz/halo pars/step and pgfdecoratedpathlength-pgfkeysvalueof/tikz/halo pars/step step mystep pt with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo);,
mark=at position 1 with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-1)
(pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-B-2)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-3);
xdefLstHaloCoords(halo-A-1) (halo-A-2) (halo-A-3)
foreach XX in 1,...,numbervaluehalo
xdefLstHaloCoordsLstHaloCoordsspace (halo-L-XX)
xdefLstHaloCoordsLstHaloCoordsspace (halo-B-1) (halo-B-2) (halo-B-3)
foreach XX in numbervaluehalo,thenumexprnumbervaluehalo-1,...,1
xdefLstHaloCoordsLstHaloCoordsspace (halo-R-XX)
,
halo/.style=insert path=plot[smooth,samples at=1,...,numbervaluebracep,variable=x]
(bracep-x),halo/.style=insert path=plot[smooth cycle] coordinates LstHaloCoords ,
halo pars/.cd,dist/.initial=5pt,step/.initial=2pt
begindocument
begintikzpicture
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[dashed,halo];
endtikzpicture
enddocument
The halo path is known to TikZ so it can be used for all sorts of things like intersections or fill with pattern (needs the libraries intersections or patterns), e.g.
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[red,pattern=north west lines,pattern color=blue,halo];

As you can see, the result is not perfect, but can be improved by playing with the step parameter (I chose this on purpose in order not to deceive users). An automatically nice solution that works with much more complicated, in particular self-intersecting, paths is much harder to obtain. However, the above works with curves, too, i.e. not just with straight lines.
Note also that if I only take your dashed contour, add rounded corners and replace the last coordinate by cycle (so that the last corner is also rounded), I get

documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument
Things look arguably even better if one draws the fist line in one stretch and takes into account the slope of the lower leg when drawing the contour.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

If you want the dash pattern to close, use
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
path [rounded corners,preaction=decorate,decoration=markings,mark=at position 0 with %
pgfmathsetmacromyonpgfdecoratedpathlength/50
xdefmyonmyon,postaction=draw,dash pattern=on myon pt off myon pt] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

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
);
);
doe is a new contributor. Be nice, and check out our Code of Conduct.
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%2f495067%2fdashed-trajectory-encircling-two-segments%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
If you could accept not being dashed, a round cap can help:
documentclass[tikz, border=2mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
beginscope[xshift=2cm]
draw[line cap=round, red!30, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
beginscope[xshift=4cm]
draw[line cap=round, line width=3mm] (1,1)--(2,2)--(2,3.5);
draw[line cap=round, white, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
endtikzpicture
enddocument

Update: with some patience and hobby library you could do something like:
documentclass[tikz, border=2mm]standalone
usetikzlibraryhobby
begindocument
begintikzpicture
draw (1,1) node (a) --(2,2) node (b) --(2,3.5) node[rotate=45] (c) ;
draw[dashed, use Hobby shortcut] (a.south west) to[closed, curve through=(a.north west) .. (b.north west) .. (c.north west) .. (c.north east) .. (c.south east) .. (b.south east) .. (a.south east)] cycle;
endtikzpicture
enddocument

add a comment |
If you could accept not being dashed, a round cap can help:
documentclass[tikz, border=2mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
beginscope[xshift=2cm]
draw[line cap=round, red!30, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
beginscope[xshift=4cm]
draw[line cap=round, line width=3mm] (1,1)--(2,2)--(2,3.5);
draw[line cap=round, white, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
endtikzpicture
enddocument

Update: with some patience and hobby library you could do something like:
documentclass[tikz, border=2mm]standalone
usetikzlibraryhobby
begindocument
begintikzpicture
draw (1,1) node (a) --(2,2) node (b) --(2,3.5) node[rotate=45] (c) ;
draw[dashed, use Hobby shortcut] (a.south west) to[closed, curve through=(a.north west) .. (b.north west) .. (c.north west) .. (c.north east) .. (c.south east) .. (b.south east) .. (a.south east)] cycle;
endtikzpicture
enddocument

add a comment |
If you could accept not being dashed, a round cap can help:
documentclass[tikz, border=2mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
beginscope[xshift=2cm]
draw[line cap=round, red!30, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
beginscope[xshift=4cm]
draw[line cap=round, line width=3mm] (1,1)--(2,2)--(2,3.5);
draw[line cap=round, white, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
endtikzpicture
enddocument

Update: with some patience and hobby library you could do something like:
documentclass[tikz, border=2mm]standalone
usetikzlibraryhobby
begindocument
begintikzpicture
draw (1,1) node (a) --(2,2) node (b) --(2,3.5) node[rotate=45] (c) ;
draw[dashed, use Hobby shortcut] (a.south west) to[closed, curve through=(a.north west) .. (b.north west) .. (c.north west) .. (c.north east) .. (c.south east) .. (b.south east) .. (a.south east)] cycle;
endtikzpicture
enddocument

If you could accept not being dashed, a round cap can help:
documentclass[tikz, border=2mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) -- (0.8,1) -- (1.1,0.8) -- (2.2,2);
beginscope[xshift=2cm]
draw[line cap=round, red!30, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
beginscope[xshift=4cm]
draw[line cap=round, line width=3mm] (1,1)--(2,2)--(2,3.5);
draw[line cap=round, white, line width=2.5mm] (1,1)--(2,2)--(2,3.5);
draw (1,1)--(2,2)--(2,3.5);
endscope
endtikzpicture
enddocument

Update: with some patience and hobby library you could do something like:
documentclass[tikz, border=2mm]standalone
usetikzlibraryhobby
begindocument
begintikzpicture
draw (1,1) node (a) --(2,2) node (b) --(2,3.5) node[rotate=45] (c) ;
draw[dashed, use Hobby shortcut] (a.south west) to[closed, curve through=(a.north west) .. (b.north west) .. (c.north west) .. (c.north east) .. (c.south east) .. (b.south east) .. (a.south east)] cycle;
endtikzpicture
enddocument

edited Jun 10 at 10:34
answered Jun 10 at 8:48
IgnasiIgnasi
97.5k6180327
97.5k6180327
add a comment |
add a comment |
The following draws halos around simple paths as the one above. You only need to record the path
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
and then can draw a halo via
draw[dashed,halo];

documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
newcounterhalo
tikzsetrecord path/.style=/utils/exec=tikzsethalo pars/.cd,#1,
decorate,decoration=markings,mark=at position 0 with
setcounterhalo1%typeoutpgfdecoratedpathlength
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-1)
(-pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-A-2)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-3);
pgfmathsetmacromystep(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/int(1+(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/pgfkeysvalueof/tikz/halo pars/step)
xdefmystepmystep,
mark=between positions pgfkeysvalueof/tikz/halo pars/step and pgfdecoratedpathlength-pgfkeysvalueof/tikz/halo pars/step step mystep pt with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo);,
mark=at position 1 with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-1)
(pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-B-2)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-3);
xdefLstHaloCoords(halo-A-1) (halo-A-2) (halo-A-3)
foreach XX in 1,...,numbervaluehalo
xdefLstHaloCoordsLstHaloCoordsspace (halo-L-XX)
xdefLstHaloCoordsLstHaloCoordsspace (halo-B-1) (halo-B-2) (halo-B-3)
foreach XX in numbervaluehalo,thenumexprnumbervaluehalo-1,...,1
xdefLstHaloCoordsLstHaloCoordsspace (halo-R-XX)
,
halo/.style=insert path=plot[smooth,samples at=1,...,numbervaluebracep,variable=x]
(bracep-x),halo/.style=insert path=plot[smooth cycle] coordinates LstHaloCoords ,
halo pars/.cd,dist/.initial=5pt,step/.initial=2pt
begindocument
begintikzpicture
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[dashed,halo];
endtikzpicture
enddocument
The halo path is known to TikZ so it can be used for all sorts of things like intersections or fill with pattern (needs the libraries intersections or patterns), e.g.
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[red,pattern=north west lines,pattern color=blue,halo];

As you can see, the result is not perfect, but can be improved by playing with the step parameter (I chose this on purpose in order not to deceive users). An automatically nice solution that works with much more complicated, in particular self-intersecting, paths is much harder to obtain. However, the above works with curves, too, i.e. not just with straight lines.
Note also that if I only take your dashed contour, add rounded corners and replace the last coordinate by cycle (so that the last corner is also rounded), I get

documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument
Things look arguably even better if one draws the fist line in one stretch and takes into account the slope of the lower leg when drawing the contour.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

If you want the dash pattern to close, use
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
path [rounded corners,preaction=decorate,decoration=markings,mark=at position 0 with %
pgfmathsetmacromyonpgfdecoratedpathlength/50
xdefmyonmyon,postaction=draw,dash pattern=on myon pt off myon pt] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

add a comment |
The following draws halos around simple paths as the one above. You only need to record the path
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
and then can draw a halo via
draw[dashed,halo];

documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
newcounterhalo
tikzsetrecord path/.style=/utils/exec=tikzsethalo pars/.cd,#1,
decorate,decoration=markings,mark=at position 0 with
setcounterhalo1%typeoutpgfdecoratedpathlength
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-1)
(-pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-A-2)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-3);
pgfmathsetmacromystep(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/int(1+(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/pgfkeysvalueof/tikz/halo pars/step)
xdefmystepmystep,
mark=between positions pgfkeysvalueof/tikz/halo pars/step and pgfdecoratedpathlength-pgfkeysvalueof/tikz/halo pars/step step mystep pt with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo);,
mark=at position 1 with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-1)
(pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-B-2)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-3);
xdefLstHaloCoords(halo-A-1) (halo-A-2) (halo-A-3)
foreach XX in 1,...,numbervaluehalo
xdefLstHaloCoordsLstHaloCoordsspace (halo-L-XX)
xdefLstHaloCoordsLstHaloCoordsspace (halo-B-1) (halo-B-2) (halo-B-3)
foreach XX in numbervaluehalo,thenumexprnumbervaluehalo-1,...,1
xdefLstHaloCoordsLstHaloCoordsspace (halo-R-XX)
,
halo/.style=insert path=plot[smooth,samples at=1,...,numbervaluebracep,variable=x]
(bracep-x),halo/.style=insert path=plot[smooth cycle] coordinates LstHaloCoords ,
halo pars/.cd,dist/.initial=5pt,step/.initial=2pt
begindocument
begintikzpicture
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[dashed,halo];
endtikzpicture
enddocument
The halo path is known to TikZ so it can be used for all sorts of things like intersections or fill with pattern (needs the libraries intersections or patterns), e.g.
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[red,pattern=north west lines,pattern color=blue,halo];

As you can see, the result is not perfect, but can be improved by playing with the step parameter (I chose this on purpose in order not to deceive users). An automatically nice solution that works with much more complicated, in particular self-intersecting, paths is much harder to obtain. However, the above works with curves, too, i.e. not just with straight lines.
Note also that if I only take your dashed contour, add rounded corners and replace the last coordinate by cycle (so that the last corner is also rounded), I get

documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument
Things look arguably even better if one draws the fist line in one stretch and takes into account the slope of the lower leg when drawing the contour.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

If you want the dash pattern to close, use
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
path [rounded corners,preaction=decorate,decoration=markings,mark=at position 0 with %
pgfmathsetmacromyonpgfdecoratedpathlength/50
xdefmyonmyon,postaction=draw,dash pattern=on myon pt off myon pt] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

add a comment |
The following draws halos around simple paths as the one above. You only need to record the path
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
and then can draw a halo via
draw[dashed,halo];

documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
newcounterhalo
tikzsetrecord path/.style=/utils/exec=tikzsethalo pars/.cd,#1,
decorate,decoration=markings,mark=at position 0 with
setcounterhalo1%typeoutpgfdecoratedpathlength
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-1)
(-pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-A-2)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-3);
pgfmathsetmacromystep(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/int(1+(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/pgfkeysvalueof/tikz/halo pars/step)
xdefmystepmystep,
mark=between positions pgfkeysvalueof/tikz/halo pars/step and pgfdecoratedpathlength-pgfkeysvalueof/tikz/halo pars/step step mystep pt with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo);,
mark=at position 1 with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-1)
(pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-B-2)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-3);
xdefLstHaloCoords(halo-A-1) (halo-A-2) (halo-A-3)
foreach XX in 1,...,numbervaluehalo
xdefLstHaloCoordsLstHaloCoordsspace (halo-L-XX)
xdefLstHaloCoordsLstHaloCoordsspace (halo-B-1) (halo-B-2) (halo-B-3)
foreach XX in numbervaluehalo,thenumexprnumbervaluehalo-1,...,1
xdefLstHaloCoordsLstHaloCoordsspace (halo-R-XX)
,
halo/.style=insert path=plot[smooth,samples at=1,...,numbervaluebracep,variable=x]
(bracep-x),halo/.style=insert path=plot[smooth cycle] coordinates LstHaloCoords ,
halo pars/.cd,dist/.initial=5pt,step/.initial=2pt
begindocument
begintikzpicture
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[dashed,halo];
endtikzpicture
enddocument
The halo path is known to TikZ so it can be used for all sorts of things like intersections or fill with pattern (needs the libraries intersections or patterns), e.g.
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[red,pattern=north west lines,pattern color=blue,halo];

As you can see, the result is not perfect, but can be improved by playing with the step parameter (I chose this on purpose in order not to deceive users). An automatically nice solution that works with much more complicated, in particular self-intersecting, paths is much harder to obtain. However, the above works with curves, too, i.e. not just with straight lines.
Note also that if I only take your dashed contour, add rounded corners and replace the last coordinate by cycle (so that the last corner is also rounded), I get

documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument
Things look arguably even better if one draws the fist line in one stretch and takes into account the slope of the lower leg when drawing the contour.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

If you want the dash pattern to close, use
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
path [rounded corners,preaction=decorate,decoration=markings,mark=at position 0 with %
pgfmathsetmacromyonpgfdecoratedpathlength/50
xdefmyonmyon,postaction=draw,dash pattern=on myon pt off myon pt] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

The following draws halos around simple paths as the one above. You only need to record the path
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
and then can draw a halo via
draw[dashed,halo];

documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
newcounterhalo
tikzsetrecord path/.style=/utils/exec=tikzsethalo pars/.cd,#1,
decorate,decoration=markings,mark=at position 0 with
setcounterhalo1%typeoutpgfdecoratedpathlength
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-1)
(-pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-A-2)
(-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-A-3);
pgfmathsetmacromystep(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/int(1+(pgfdecoratedpathlength-2*pgfkeysvalueof/tikz/halo pars/step)/pgfkeysvalueof/tikz/halo pars/step)
xdefmystepmystep,
mark=between positions pgfkeysvalueof/tikz/halo pars/step and pgfdecoratedpathlength-pgfkeysvalueof/tikz/halo pars/step step mystep pt with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo);,
mark=at position 1 with stepcounterhalo
path (0pt,pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-L-numbervaluehalo)
(0pt,-1*pgfkeysvalueof/tikz/halo pars/dist) coordinate (halo-R-numbervaluehalo)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-1)
(pgfkeysvalueof/tikz/halo pars/dist,0pt) coordinate (halo-B-2)
(pgfkeysvalueof/tikz/halo pars/dist/sqrt(2),-pgfkeysvalueof/tikz/halo pars/dist/sqrt(2)) coordinate (halo-B-3);
xdefLstHaloCoords(halo-A-1) (halo-A-2) (halo-A-3)
foreach XX in 1,...,numbervaluehalo
xdefLstHaloCoordsLstHaloCoordsspace (halo-L-XX)
xdefLstHaloCoordsLstHaloCoordsspace (halo-B-1) (halo-B-2) (halo-B-3)
foreach XX in numbervaluehalo,thenumexprnumbervaluehalo-1,...,1
xdefLstHaloCoordsLstHaloCoordsspace (halo-R-XX)
,
halo/.style=insert path=plot[smooth,samples at=1,...,numbervaluebracep,variable=x]
(bracep-x),halo/.style=insert path=plot[smooth cycle] coordinates LstHaloCoords ,
halo pars/.cd,dist/.initial=5pt,step/.initial=2pt
begindocument
begintikzpicture
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[dashed,halo];
endtikzpicture
enddocument
The halo path is known to TikZ so it can be used for all sorts of things like intersections or fill with pattern (needs the libraries intersections or patterns), e.g.
draw[thick,postaction=record path=step=5pt] (1,1) -- (2,2) -- (2,3.5);
draw[red,pattern=north west lines,pattern color=blue,halo];

As you can see, the result is not perfect, but can be improved by playing with the step parameter (I chose this on purpose in order not to deceive users). An automatically nice solution that works with much more complicated, in particular self-intersecting, paths is much harder to obtain. However, the above works with curves, too, i.e. not just with straight lines.
Note also that if I only take your dashed contour, add rounded corners and replace the last coordinate by cycle (so that the last corner is also rounded), I get

documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2);
draw [thick] (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,2) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument
Things look arguably even better if one draws the fist line in one stretch and takes into account the slope of the lower leg when drawing the contour.
documentclass[tikz,border=3.14mm]standalone
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
draw [dashed,rounded corners] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

If you want the dash pattern to close, use
documentclass[tikz,border=3.14mm]standalone
usetikzlibrarydecorations.markings
begindocument
begintikzpicture
draw [thick] (1,1) -- (2,2) -- (2,3.5);
path [rounded corners,preaction=decorate,decoration=markings,mark=at position 0 with %
pgfmathsetmacromyonpgfdecoratedpathlength/50
xdefmyonmyon,postaction=draw,dash pattern=on myon pt off myon pt] (2.2,1.9) -- (2.2,3.7) -- (1.8,3.7) -- (1.8,2.1) --
(0.8,1) -- (1.1,0.8) -- cycle;
endtikzpicture
enddocument

edited Jun 10 at 23:22
answered Jun 10 at 16:02
marmotmarmot
136k6177326
136k6177326
add a comment |
add a comment |
doe is a new contributor. Be nice, and check out our Code of Conduct.
doe is a new contributor. Be nice, and check out our Code of Conduct.
doe is a new contributor. Be nice, and check out our Code of Conduct.
doe is a new contributor. Be nice, and check out our Code of Conduct.
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%2f495067%2fdashed-trajectory-encircling-two-segments%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
Welcome to TEX.SE. please show us what you have tried so far. This is not a
just-do-it-for-mesite.– Raaja
Jun 10 at 7:23
@Raaja Thank you. I have tried searching for this on Google and a number of TikZ tutorials, but could not find how to do this. One approach would be to draw each "dash" separately, but that would be extremely tedious and I can't imagine it's the best approach. Also, I don't think it would work well for the curved part.
– doe
Jun 10 at 7:33
2
You can always start something and shows us what you have done. We can take that as a start and then give you (close to) what you want instead of starting from scratch.
– Raaja
Jun 10 at 7:46
@Raaja I have added my efforts.
– doe
Jun 10 at 8:18
You are welcome and you get my +1. Moreover, from next time, please make it compilable.
– Raaja
Jun 10 at 9:04