| 1 |
% cylinderborders.mp |
| 2 |
% L. Nobre G. |
| 3 |
% 2014 |
| 4 |
|
| 5 |
prologues := 1; |
| 6 |
|
| 7 |
input featpost3Dplus2D; |
| 8 |
|
| 9 |
beginfig(1); |
| 10 |
f := (3,5,2); |
| 11 |
numeric margi, ray, dist, len, marj; |
| 12 |
margi = 0.15; |
| 13 |
marj = 0.37; |
| 14 |
ray = 0.2; |
| 15 |
dist = 0.6; |
| 16 |
len = 0.25; |
| 17 |
color pos, pa, pb, pc, pd, qa, qb, qc, qd, ra, P, Q; |
| 18 |
pos = (marj,dist,0); |
| 19 |
numeric pqwid, pqlen, theta; |
| 20 |
pqwid = (dist ++ ray) + 2*margi; |
| 21 |
pqlen = len + 4*margi; |
| 22 |
theta = 2*angle(dist,ray); |
| 23 |
pa = (2margi+marj,dist+margi,0); |
| 24 |
pb = (2margi+marj,-margi,0); |
| 25 |
pc = (-len-margi,-margi,0); |
| 26 |
pd = (-len-margi,dist+margi,0); |
| 27 |
qa = (margi+marj,dist+margi*cosd(theta),-margi*sind(theta)); |
| 28 |
qb = (margi+marj,dist-(dist+margi)*cosd(theta),(dist+margi)*sind(theta)); |
| 29 |
qc = (-len-2margi,dist-(dist+margi)*cosd(theta),(dist+margi)*sind(theta)); |
| 30 |
qd = (-len-2margi,dist+margi*cosd(theta),-margi*sind(theta)); |
| 31 |
ra = (margi+marj,dist,0); |
| 32 |
path lowplan, higplan; |
| 33 |
lowplan = rp(pa)--rp(pb)--rp(pc)--rp(pd)--cycle; |
| 34 |
higplan = rp(qa)--rp(qb)--rp(qc)--rp(qd)--cycle; |
| 35 |
unfill higplan; |
| 36 |
draw higplan; |
| 37 |
unfill lowplan; |
| 38 |
draw lowplan; |
| 39 |
draw rp(pos)--rp(-len*red); |
| 40 |
rigorousdisc( 0, true, (0,0,ray), ray, -len*red ); |
| 41 |
draw rp(ra)--rp(qb); |
| 42 |
draw rp(pos) withpen pencircle scaled 3pt; |
| 43 |
P = (0,ray*sind(theta),ray*(1+cosd(theta))); |
| 44 |
Q = P-len*red; |
| 45 |
draw rp(black)--rp(pos)--rp(P)--rp(Q)--rp(pos); |
| 46 |
draw rp(ra)--rp((-margi-len,dist,0)) dashed withdots withcolor 0.5white; |
| 47 |
draw rp(P)--rp(Q) withcolor blue withpen pencircle scaled 2pt; |
| 48 |
endfig; |
| 49 |
|
| 50 |
end. |