exemple.mp [ source brut ]
%@Auteur: Didier Aldebert input geometriesyr16; typerepre:="persp";
figureespace(-10u,-10u,10u,10u); Initialisation(5,30,25,57); color A,B,C,D,E,F,G,H,W,X,Y,Z,O,e,o,g,f,h,I,p,J,q; trace Cube(A,B,C,D,H,E,F,G); W=A+2*(A-B)+4*(A-D); X-W=6*(B-A); Y-X=8*(C-B); Z-W=Y-X; O=A+1.3(A-B)+1.2(D-A)+(0,0,2); I=0.5[A,E]; J=0.5[F,E]; e=IntersectionPlanDroite(W,X,Y,O,E); g=IntersectionPlanDroite(W,X,Y,O,G); f=IntersectionPlanDroite(W,X,Y,O,F); h=IntersectionPlanDroite(W,X,Y,O,H); p=IntersectionPlanDroite(W,X,Y,O,I); q=IntersectionPlanDroite(W,X,Y,O,J); o=ProjectionsurPlan(O,W,X,Y); trace polygone(W,X,Y,Z); trace segment (O,o); trace segment(e-1.2(o-e),o+0.3(o-e)); trace segment(f-0.4(o-f),o+0.3(o-f)); trace segment(g-0.3(o-g),o+0.3(o-g)); trace segment(h-1.2(o-h),o+0.3(o-h)); drawoptions(withcolor red); pickup pencircle scaled 2bp; trace polygone(e,f,g,h); trace segment(e,A); trace segment(f,B); trace segment(g,C); trace segment(h,D); pickup defaultpen; drawoptions(withcolor blue); trace segment(O,e); trace demidroite(e,symetrie(E,e)) cutafter segment(W,X) dashed evenly; trace segment(e,e+1.2(e-E)) cutbefore segment(W,X); trace segment(O,g); trace demidroite(g,symetrie(G,g)) cutafter segment(X,Y) dashed evenly; trace segment(g,g+1.2(g-G)) cutbefore segment(X,Y); trace segment(O,f); trace demidroite(f,symetrie(F,f)) cutafter segment(X,Y) dashed evenly; trace segment(f,f+0.7(f-F)) cutbefore segment(X,Y); trace segment(O,H); trace segment(H,IntersectionPlanDroite(B,F,C,O,H)) dashed evenly; trace segment(IntersectionPlanDroite(B,F,C,O,H),h); trace demidroite(h,symetrie(H,h)) cutafter segment(X,Y) dashed evenly; trace segment(h,h+1.8(h-H)) cutbefore segment(X,Y); trace segment(O,p); trace demidroite(p,symetrie(O,p)) cutafter segment(W,X) dashed evenly; trace segment(p,p+0.8(p-O)) cutbefore segment(W,X); trace segment(O,q); trace demidroite(q,symetrie(O,q)) cutafter segment(X,Y) dashed evenly; trace segment(q,q+0.4(q-O)) cutbefore segment(X,Y); drawoptions(); marque_p:="plein"; nomme.top(O); marque_p:="rien"; nomme.llft(e); nomme.urt(g); nomme.llft(f); nomme.urt(h); nomme.llft(A); nomme.llft(B); nomme.urt(C); nomme.ulft(D); nomme.llft(E); nomme.llft(F); nomme.urt(G); nomme.urt(H); dotlabel.urt(btex $\omega$ etex,Projette(o)); dotlabel.llft(btex $i$ etex,Projette(p)); dotlabel.llft(btex $j$ etex,Projette(q)); dotlabel.llft(btex $I$ etex,Projette(I)); dotlabel.urt(btex $J$ etex,Projette(J)); finespace; end