How to make the vertices not connect to arrows?

Multi tool use
up vote
2
down vote
favorite
I draw the following graph in Metapost. How to make the vertices of the subgraph with red edges not connect to arrows. The graph I obtained is
I want the vertices looks like the following picture (there is small space between a vertex and the arrows connnected to it). Thank you very much.
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
drawarrow q[2]..A[2]..q[1] withcolor red;
drawarrow q[5]..A[1]..q[1] withcolor red;
drawarrow q[5]..A[5]..q[4] withcolor red;
drawarrow q[3]..A[4]..q[4] withcolor red;
drawarrow q[3]..A[3]..q[2] withcolor red;
drawarrow q[1].. p[1] intersectionpoint p[3] ..q[6] withcolor red;
drawarrow q[6].. p[3] intersectionpoint p[2] ..q[5] withcolor red;
drawarrow q[4].. p[4] intersectionpoint p[2] ..q[6] withcolor red;
drawarrow q[6].. p[4] intersectionpoint p[1] ..q[3] withcolor red;
endfig;
end
metapost
add a comment |
up vote
2
down vote
favorite
I draw the following graph in Metapost. How to make the vertices of the subgraph with red edges not connect to arrows. The graph I obtained is
I want the vertices looks like the following picture (there is small space between a vertex and the arrows connnected to it). Thank you very much.
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
drawarrow q[2]..A[2]..q[1] withcolor red;
drawarrow q[5]..A[1]..q[1] withcolor red;
drawarrow q[5]..A[5]..q[4] withcolor red;
drawarrow q[3]..A[4]..q[4] withcolor red;
drawarrow q[3]..A[3]..q[2] withcolor red;
drawarrow q[1].. p[1] intersectionpoint p[3] ..q[6] withcolor red;
drawarrow q[6].. p[3] intersectionpoint p[2] ..q[5] withcolor red;
drawarrow q[4].. p[4] intersectionpoint p[2] ..q[6] withcolor red;
drawarrow q[6].. p[4] intersectionpoint p[1] ..q[3] withcolor red;
endfig;
end
metapost
Just an honest question to the upvoters? Is this latex related (in order of this site) or there is a better forum to ask this question?
– koleygr
5 hours ago
1
@koleygr METAPOST is part of TeX systems, shipped with texlive and friends. Btw this is TeX S.E., not LaTeX S.E. There also plain TeX users, ConTeXt users and more here.
– sztruks
5 hours ago
@sztruks... My question was honest, and haven't herd about metapost... Thanks for the info... (ConTeXt is also something I have no idea about and will check it soon). Thanks
– koleygr
5 hours ago
2
@koleygr. No problem, those great tools are not as known as they could be. And my first comment was definatly too rude, apologize.
– sztruks
5 hours ago
@sztruks.. Just show the edit in your comment... I didn't found rude your first comment... Really.. Not at all.. It was a useful comment for me, and just noticed there that I had asked about "LaTeX related" and not "TeX related" as had too by mistake. But your comment was not rude at all, but a nice comment with enough information I needed to know about.
– koleygr
2 hours ago
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I draw the following graph in Metapost. How to make the vertices of the subgraph with red edges not connect to arrows. The graph I obtained is
I want the vertices looks like the following picture (there is small space between a vertex and the arrows connnected to it). Thank you very much.
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
drawarrow q[2]..A[2]..q[1] withcolor red;
drawarrow q[5]..A[1]..q[1] withcolor red;
drawarrow q[5]..A[5]..q[4] withcolor red;
drawarrow q[3]..A[4]..q[4] withcolor red;
drawarrow q[3]..A[3]..q[2] withcolor red;
drawarrow q[1].. p[1] intersectionpoint p[3] ..q[6] withcolor red;
drawarrow q[6].. p[3] intersectionpoint p[2] ..q[5] withcolor red;
drawarrow q[4].. p[4] intersectionpoint p[2] ..q[6] withcolor red;
drawarrow q[6].. p[4] intersectionpoint p[1] ..q[3] withcolor red;
endfig;
end
metapost
I draw the following graph in Metapost. How to make the vertices of the subgraph with red edges not connect to arrows. The graph I obtained is
I want the vertices looks like the following picture (there is small space between a vertex and the arrows connnected to it). Thank you very much.
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
drawarrow q[2]..A[2]..q[1] withcolor red;
drawarrow q[5]..A[1]..q[1] withcolor red;
drawarrow q[5]..A[5]..q[4] withcolor red;
drawarrow q[3]..A[4]..q[4] withcolor red;
drawarrow q[3]..A[3]..q[2] withcolor red;
drawarrow q[1].. p[1] intersectionpoint p[3] ..q[6] withcolor red;
drawarrow q[6].. p[3] intersectionpoint p[2] ..q[5] withcolor red;
drawarrow q[4].. p[4] intersectionpoint p[2] ..q[6] withcolor red;
drawarrow q[6].. p[4] intersectionpoint p[1] ..q[3] withcolor red;
endfig;
end
metapost
metapost
edited 1 hour ago


sztruks
1,174716
1,174716
asked 6 hours ago
Jianrong Li
1405
1405
Just an honest question to the upvoters? Is this latex related (in order of this site) or there is a better forum to ask this question?
– koleygr
5 hours ago
1
@koleygr METAPOST is part of TeX systems, shipped with texlive and friends. Btw this is TeX S.E., not LaTeX S.E. There also plain TeX users, ConTeXt users and more here.
– sztruks
5 hours ago
@sztruks... My question was honest, and haven't herd about metapost... Thanks for the info... (ConTeXt is also something I have no idea about and will check it soon). Thanks
– koleygr
5 hours ago
2
@koleygr. No problem, those great tools are not as known as they could be. And my first comment was definatly too rude, apologize.
– sztruks
5 hours ago
@sztruks.. Just show the edit in your comment... I didn't found rude your first comment... Really.. Not at all.. It was a useful comment for me, and just noticed there that I had asked about "LaTeX related" and not "TeX related" as had too by mistake. But your comment was not rude at all, but a nice comment with enough information I needed to know about.
– koleygr
2 hours ago
add a comment |
Just an honest question to the upvoters? Is this latex related (in order of this site) or there is a better forum to ask this question?
– koleygr
5 hours ago
1
@koleygr METAPOST is part of TeX systems, shipped with texlive and friends. Btw this is TeX S.E., not LaTeX S.E. There also plain TeX users, ConTeXt users and more here.
– sztruks
5 hours ago
@sztruks... My question was honest, and haven't herd about metapost... Thanks for the info... (ConTeXt is also something I have no idea about and will check it soon). Thanks
– koleygr
5 hours ago
2
@koleygr. No problem, those great tools are not as known as they could be. And my first comment was definatly too rude, apologize.
– sztruks
5 hours ago
@sztruks.. Just show the edit in your comment... I didn't found rude your first comment... Really.. Not at all.. It was a useful comment for me, and just noticed there that I had asked about "LaTeX related" and not "TeX related" as had too by mistake. But your comment was not rude at all, but a nice comment with enough information I needed to know about.
– koleygr
2 hours ago
Just an honest question to the upvoters? Is this latex related (in order of this site) or there is a better forum to ask this question?
– koleygr
5 hours ago
Just an honest question to the upvoters? Is this latex related (in order of this site) or there is a better forum to ask this question?
– koleygr
5 hours ago
1
1
@koleygr METAPOST is part of TeX systems, shipped with texlive and friends. Btw this is TeX S.E., not LaTeX S.E. There also plain TeX users, ConTeXt users and more here.
– sztruks
5 hours ago
@koleygr METAPOST is part of TeX systems, shipped with texlive and friends. Btw this is TeX S.E., not LaTeX S.E. There also plain TeX users, ConTeXt users and more here.
– sztruks
5 hours ago
@sztruks... My question was honest, and haven't herd about metapost... Thanks for the info... (ConTeXt is also something I have no idea about and will check it soon). Thanks
– koleygr
5 hours ago
@sztruks... My question was honest, and haven't herd about metapost... Thanks for the info... (ConTeXt is also something I have no idea about and will check it soon). Thanks
– koleygr
5 hours ago
2
2
@koleygr. No problem, those great tools are not as known as they could be. And my first comment was definatly too rude, apologize.
– sztruks
5 hours ago
@koleygr. No problem, those great tools are not as known as they could be. And my first comment was definatly too rude, apologize.
– sztruks
5 hours ago
@sztruks.. Just show the edit in your comment... I didn't found rude your first comment... Really.. Not at all.. It was a useful comment for me, and just noticed there that I had asked about "LaTeX related" and not "TeX related" as had too by mistake. But your comment was not rude at all, but a nice comment with enough information I needed to know about.
– koleygr
2 hours ago
@sztruks.. Just show the edit in your comment... I didn't found rude your first comment... Really.. Not at all.. It was a useful comment for me, and just noticed there that I had asked about "LaTeX related" and not "TeX related" as had too by mistake. But your comment was not rude at all, but a nice comment with enough information I needed to know about.
– koleygr
2 hours ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Here is an answer : I designed circles around your vertices and used cutbefore
and cutafter
primitives
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
%circles that will create buffers around your vertice
path c;
for i=1 upto 6 :
c[i]:= fullcircle scaled 4bp shifted q[i] ;
endfor
path r;
r[1]:= q[2]..A[2]..q[1] ;
r[2]:= q[5]..A[1]..q[1] ;
r[3]:= q[5]..A[5]..q[4] ;
r[4]:= q[3]..A[4]..q[4] ;
r[5]:= q[3]..A[3]..q[2] ;
r[6]:= q[1].. p[1] intersectionpoint p[3] ..q[6] ;
r[7]:= q[6].. p[3] intersectionpoint p[2] ..q[5] ;
r[8]:= q[4].. p[4] intersectionpoint p[2] ..q[6] ;
r[9]:= q[6].. p[4] intersectionpoint p[1] ..q[3] ;
%cutafter and cutbefore cut path before and after a pair
drawarrow (r[1] cutbefore c[2] cutafter c[1]) withcolor red;
drawarrow (r[2] cutbefore c[5] cutafter c[1]) withcolor red;
drawarrow (r[3] cutbefore c[5] cutafter c[4]) withcolor red;
drawarrow (r[4] cutbefore c[3] cutafter c[4]) withcolor red;
drawarrow (r[5] cutbefore c[3] cutafter c[2]) withcolor red;
drawarrow (r[6] cutbefore c[1] cutafter c[6]) withcolor red;
drawarrow (r[7] cutbefore c[6] cutafter c[5]) withcolor red;
drawarrow (r[8] cutbefore c[4] cutafter c[6]) withcolor red;
drawarrow (r[9] cutbefore c[6] cutafter c[3]) withcolor red;
endfig ;
end
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Here is an answer : I designed circles around your vertices and used cutbefore
and cutafter
primitives
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
%circles that will create buffers around your vertice
path c;
for i=1 upto 6 :
c[i]:= fullcircle scaled 4bp shifted q[i] ;
endfor
path r;
r[1]:= q[2]..A[2]..q[1] ;
r[2]:= q[5]..A[1]..q[1] ;
r[3]:= q[5]..A[5]..q[4] ;
r[4]:= q[3]..A[4]..q[4] ;
r[5]:= q[3]..A[3]..q[2] ;
r[6]:= q[1].. p[1] intersectionpoint p[3] ..q[6] ;
r[7]:= q[6].. p[3] intersectionpoint p[2] ..q[5] ;
r[8]:= q[4].. p[4] intersectionpoint p[2] ..q[6] ;
r[9]:= q[6].. p[4] intersectionpoint p[1] ..q[3] ;
%cutafter and cutbefore cut path before and after a pair
drawarrow (r[1] cutbefore c[2] cutafter c[1]) withcolor red;
drawarrow (r[2] cutbefore c[5] cutafter c[1]) withcolor red;
drawarrow (r[3] cutbefore c[5] cutafter c[4]) withcolor red;
drawarrow (r[4] cutbefore c[3] cutafter c[4]) withcolor red;
drawarrow (r[5] cutbefore c[3] cutafter c[2]) withcolor red;
drawarrow (r[6] cutbefore c[1] cutafter c[6]) withcolor red;
drawarrow (r[7] cutbefore c[6] cutafter c[5]) withcolor red;
drawarrow (r[8] cutbefore c[4] cutafter c[6]) withcolor red;
drawarrow (r[9] cutbefore c[6] cutafter c[3]) withcolor red;
endfig ;
end
add a comment |
up vote
3
down vote
accepted
Here is an answer : I designed circles around your vertices and used cutbefore
and cutafter
primitives
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
%circles that will create buffers around your vertice
path c;
for i=1 upto 6 :
c[i]:= fullcircle scaled 4bp shifted q[i] ;
endfor
path r;
r[1]:= q[2]..A[2]..q[1] ;
r[2]:= q[5]..A[1]..q[1] ;
r[3]:= q[5]..A[5]..q[4] ;
r[4]:= q[3]..A[4]..q[4] ;
r[5]:= q[3]..A[3]..q[2] ;
r[6]:= q[1].. p[1] intersectionpoint p[3] ..q[6] ;
r[7]:= q[6].. p[3] intersectionpoint p[2] ..q[5] ;
r[8]:= q[4].. p[4] intersectionpoint p[2] ..q[6] ;
r[9]:= q[6].. p[4] intersectionpoint p[1] ..q[3] ;
%cutafter and cutbefore cut path before and after a pair
drawarrow (r[1] cutbefore c[2] cutafter c[1]) withcolor red;
drawarrow (r[2] cutbefore c[5] cutafter c[1]) withcolor red;
drawarrow (r[3] cutbefore c[5] cutafter c[4]) withcolor red;
drawarrow (r[4] cutbefore c[3] cutafter c[4]) withcolor red;
drawarrow (r[5] cutbefore c[3] cutafter c[2]) withcolor red;
drawarrow (r[6] cutbefore c[1] cutafter c[6]) withcolor red;
drawarrow (r[7] cutbefore c[6] cutafter c[5]) withcolor red;
drawarrow (r[8] cutbefore c[4] cutafter c[6]) withcolor red;
drawarrow (r[9] cutbefore c[6] cutafter c[3]) withcolor red;
endfig ;
end
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Here is an answer : I designed circles around your vertices and used cutbefore
and cutafter
primitives
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
%circles that will create buffers around your vertice
path c;
for i=1 upto 6 :
c[i]:= fullcircle scaled 4bp shifted q[i] ;
endfor
path r;
r[1]:= q[2]..A[2]..q[1] ;
r[2]:= q[5]..A[1]..q[1] ;
r[3]:= q[5]..A[5]..q[4] ;
r[4]:= q[3]..A[4]..q[4] ;
r[5]:= q[3]..A[3]..q[2] ;
r[6]:= q[1].. p[1] intersectionpoint p[3] ..q[6] ;
r[7]:= q[6].. p[3] intersectionpoint p[2] ..q[5] ;
r[8]:= q[4].. p[4] intersectionpoint p[2] ..q[6] ;
r[9]:= q[6].. p[4] intersectionpoint p[1] ..q[3] ;
%cutafter and cutbefore cut path before and after a pair
drawarrow (r[1] cutbefore c[2] cutafter c[1]) withcolor red;
drawarrow (r[2] cutbefore c[5] cutafter c[1]) withcolor red;
drawarrow (r[3] cutbefore c[5] cutafter c[4]) withcolor red;
drawarrow (r[4] cutbefore c[3] cutafter c[4]) withcolor red;
drawarrow (r[5] cutbefore c[3] cutafter c[2]) withcolor red;
drawarrow (r[6] cutbefore c[1] cutafter c[6]) withcolor red;
drawarrow (r[7] cutbefore c[6] cutafter c[5]) withcolor red;
drawarrow (r[8] cutbefore c[4] cutafter c[6]) withcolor red;
drawarrow (r[9] cutbefore c[6] cutafter c[3]) withcolor red;
endfig ;
end
Here is an answer : I designed circles around your vertices and used cutbefore
and cutafter
primitives
beginfig(1) ;
pair A,L,R,N,q;
path p;
A[1] := (0,2cm);
for i=2 upto 5:
A[i] := A[i-1] rotated -360/5;
endfor;
label.top(btex 1 etex, A[1]);
label.rt(btex 2 etex, A[2]);
label.bot(btex 3 etex, A[3]);
label.bot(btex 4 etex, A[4]);
label.lft(btex 5 etex, A[5]);
for i=1 upto 5:
q[i]:=A[i] rotated -36;
endfor;
q[6]:=0.5[A[1], A[4]];
for i=1 upto 6:
draw q[i] withpen pencircle scaled 2bp;
endfor;
for i=1 upto 5:
draw A[i] withpen pencircle scaled 2bp;
endfor;
N[1]:=0.5[A[1],A[4]];
N[2]:=1.5[A[5],N[1]];
N[3]:=0.5[A[5],N[1]];
p[1]:=A[1]..N[2]..A[4];
p[2]:=A[4]..N[3]..A[1];
draw p[1];
draw p[2];
drawarrow subpath(0,1) of p[1];
drawarrow subpath(0,0.2) of p[1];
drawarrow subpath(0,1.8) of p[1];
drawarrow subpath(0,1) of p[2];
drawarrow subpath(0,0.2) of p[2];
drawarrow subpath(0,1.8) of p[2];
N[1]:=0.5[A[2],A[5]];
N[2]:=0.5[A[1],N[1]];
p[3]:=A[2]..N[2]..A[5];
draw p[3];
drawarrow subpath(0,1.3) of p[3];
drawarrow subpath(0,0.5) of p[3];
drawarrow subpath(0,1.8) of p[3];
N[1]:=0.5[A[5],A[3]];
N[2]:=0.5[A[4],N[1]];
p[4]:=A[5]..N[2]..A[3];
draw p[4];
drawarrow subpath(0,0.8) of p[4];
drawarrow subpath(0,0.3) of p[4];
drawarrow subpath(0,1.8) of p[4];
p[5]:=A[3]..A[2];
draw p[5];
drawarrow subpath(0,0.5) of p[5];
%circles that will create buffers around your vertice
path c;
for i=1 upto 6 :
c[i]:= fullcircle scaled 4bp shifted q[i] ;
endfor
path r;
r[1]:= q[2]..A[2]..q[1] ;
r[2]:= q[5]..A[1]..q[1] ;
r[3]:= q[5]..A[5]..q[4] ;
r[4]:= q[3]..A[4]..q[4] ;
r[5]:= q[3]..A[3]..q[2] ;
r[6]:= q[1].. p[1] intersectionpoint p[3] ..q[6] ;
r[7]:= q[6].. p[3] intersectionpoint p[2] ..q[5] ;
r[8]:= q[4].. p[4] intersectionpoint p[2] ..q[6] ;
r[9]:= q[6].. p[4] intersectionpoint p[1] ..q[3] ;
%cutafter and cutbefore cut path before and after a pair
drawarrow (r[1] cutbefore c[2] cutafter c[1]) withcolor red;
drawarrow (r[2] cutbefore c[5] cutafter c[1]) withcolor red;
drawarrow (r[3] cutbefore c[5] cutafter c[4]) withcolor red;
drawarrow (r[4] cutbefore c[3] cutafter c[4]) withcolor red;
drawarrow (r[5] cutbefore c[3] cutafter c[2]) withcolor red;
drawarrow (r[6] cutbefore c[1] cutafter c[6]) withcolor red;
drawarrow (r[7] cutbefore c[6] cutafter c[5]) withcolor red;
drawarrow (r[8] cutbefore c[4] cutafter c[6]) withcolor red;
drawarrow (r[9] cutbefore c[6] cutafter c[3]) withcolor red;
endfig ;
end
edited 2 hours ago
answered 2 hours ago


sztruks
1,174716
1,174716
add a comment |
add a comment |
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
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459602%2fhow-to-make-the-vertices-not-connect-to-arrows%23new-answer', 'question_page');
}
);
Post as a guest
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
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
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
i XAOZDh UX 3eZNf2UOR pY QRoAZ F cIc5nU 4fgQtK5AeImC6mdcNoVCwLR0au7p4 5SGq,sV KhtVBBo yj9 RFmQ0A39X 0
Just an honest question to the upvoters? Is this latex related (in order of this site) or there is a better forum to ask this question?
– koleygr
5 hours ago
1
@koleygr METAPOST is part of TeX systems, shipped with texlive and friends. Btw this is TeX S.E., not LaTeX S.E. There also plain TeX users, ConTeXt users and more here.
– sztruks
5 hours ago
@sztruks... My question was honest, and haven't herd about metapost... Thanks for the info... (ConTeXt is also something I have no idea about and will check it soon). Thanks
– koleygr
5 hours ago
2
@koleygr. No problem, those great tools are not as known as they could be. And my first comment was definatly too rude, apologize.
– sztruks
5 hours ago
@sztruks.. Just show the edit in your comment... I didn't found rude your first comment... Really.. Not at all.. It was a useful comment for me, and just noticed there that I had asked about "LaTeX related" and not "TeX related" as had too by mistake. But your comment was not rude at all, but a nice comment with enough information I needed to know about.
– koleygr
2 hours ago