1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079
|
%%%% elpdmd01.ldf
%%%% Created by Laurence D. Finston (LDF) Fri Aug 27 14:50:45 CEST 2010
%% * (1) Copyright and License.
%%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing.
%%%% Copyright (C) 2010, 2011, 2012, 2013 The Free Software Foundation
%%%% GNU 3DLDF is free software; you can redistribute it and/or modify
%%%% it under the terms of the GNU General Public License as published by
%%%% the Free Software Foundation; either version 3 of the License, or
%%%% (at your option) any later version.
%%%% GNU 3DLDF is distributed in the hope that it will be useful,
%%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%%%% GNU General Public License for more details.
%%%% You should have received a copy of the GNU General Public License
%%%% along with GNU 3DLDF; if not, write to the Free Software
%%%% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
%%%% GNU 3DLDF is a GNU package.
%%%% It is part of the GNU Project of the
%%%% Free Software Foundation
%%%% and is published under the GNU General Public License.
%%%% See the website http://www.gnu.org
%%%% for more information.
%%%% GNU 3DLDF is available for downloading from
%%%% http://www.gnu.org/software/3dldf/LDF.html.
%%%% Please send bug reports to Laurence.Finston@gmx.de
%%%% The mailing list help-3dldf@gnu.org is available for people to
%%%% ask other users for help.
%%%% The mailing list info-3dldf@gnu.org is for sending
%%%% announcements to users. To subscribe to these mailing lists, send an
%%%% email with ``subscribe <email-address>'' as the subject.
%%%% The author can be contacted at:
%%%% Laurence D. Finston
%%%% c/o Free Software Foundation, Inc.
%%%% 51 Franklin St, Fifth Floor
%%%% Boston, MA 02110-1301
%%%% USA
%%%% Laurence.Finston@gmx.de
%% Created: August 27, 2010
%% Last updated: November 26, 2010
%% Run like this:
%% 3dldf elpdmd01.ldf
%% mpost elpdmd01.mp
%% tex elpdmd01.txt
%% dvips -o elpdmd01.ps elpdmd01.dvi
%% ps2pdf elpdmd01.ps
%% All on one line:
if false:
3dldf elpdmd01.ldf && mpost elpdmd01.mp && tex elpdmd01.txt && \
dvips -o elpdmd01.ps elpdmd01.dvi \
&& ps2pdf elpdmd01.ps
fi;
%% View the PostScript file using Ghostview like this:
%% gv elpdmd01.ps &
%% or with GNU Ghostview like this:
%% ggv elpdmd01.ps &
%% View the PDF file with Acrobat Reader like this:
%% acroread elpdmd01.pdf &
%% * (1) Beginning of 3DLDF code.
%% ** (2) Plans for a paper or cardboard model of an ellipsoid (Ellipsoid Model 1)
input "elpdmd01.lmc"; %% input macro file
verbatim_metapost "verbatimtex \font\large=cmr17 etex;";
verbatim_metapost "verbatimtex \font\small=cmr7 etex;";
verbatim_metapost "prologues := 3;";
% verbatim_metapost "verbatimtex \font\large=cmr12 scaled \magstep2 etex;";
% verbatim_metapost "verbatimtex \font\Large=cmr17 scaled \magstep2 etex;";
%% ** (2) Declarations
picture v[];
focus f[];
set f0 with_position (0, 30, -50)
with_direction (0, 30, 10) with_distance 40;
ellipsoid E;
ellipse e[];
point p[];
transform t[];
triangle w[];
pickup pencircle scaled (.5mm, .5mm, .5mm);
color_vector cv;
cv += red; % 0
cv += black; % 1
cv += blue; % 2
cv += black; % 3
cv += black; % 4
cv += black; % 5
cv += black; % 6
cv += black; % 7
cv += yellow; % 8
cv += black; % 9
cv += black; % 10
cv += cyan; % 11
cv += magenta; % 12
cv += green; % 13
bool_point_vector bpv;
%% ** (2) Figure 1
beginfig(1);
%% *** (3) Ellipsoid E
Ew := 20;
Eh := 16;
Ed := 8;
set E with_center origin with_axis_x Ew with_axis_y Eh with_axis_z Ed
with_divisions_x 8 with_divisions_y 8 with_divisions_z 2
with_point_count 64;
draw E;
%% *** (3) Get the individual ellipses from E
for i = 0 upto 13:
e[i] := get_ellipse (i) E;
endfor;
% draw e2 with_color orange;
% draw e8 with_color red;
% draw e11 with_color blue;
% draw e13 with_color green;
%% *** (3) Trapezoid 0
bpv := e0 intersection_points e2;
p0 := bpv1;
% message "bpv:";
% show bpv;
dotlabel.urt("$p_{0}$", p0);
bpv := e2 intersection_points e13;
p1 := bpv1;
% message "bpv:";
% show bpv;
dotlabel.urt("$p_{1}$", p1);
bpv := e13 intersection_points e8;
% message "bpv:";
% show bpv;
p2 := bpv[1];
dotlabel.urt("$p_{2}$", p2);
bpv := e0 intersection_points e8;
p3 := bpv[1];
dotlabel.ulft("$p_{3}$", p3);
p4 := mediate(p0, p2);
p5 := mediate(p1, p3);
p6 := mediate(p4, p5);
bpv := (origin -- p6) intersection_points E;
% message "bpv:";
% show bpv;
p7 := bpv0;
dotlabel.top("$p_{7}$", p7);
%% **** (4) Triangle 0
set w0 with_points (p0, p1, p7);
draw w0 with_color gray;
p8 := get_center w0;
%dotlabel.top("$p_{8}$", p8);
p9 := (get_normal w0) shifted p8;
%dotlabel.top("$p_{9}$", p9);
%% **** (4) Triangle 1
set w1 with_points (p1, p7, p2);
draw w1 with_color gray;
p10 := get_center w1;
%dotlabel.top("$p_{10}$", p10);
p11 := (-1 * (get_normal w1)) shifted p10;
%dotlabel.top("$p_{11}$", p11);
%% **** (4) Triangle 2
set w2 with_points (p0, p7, p3);
draw w2; % with_color gray;
p12 := mediate(mediate(p0, p7), p3);
p13 := get_normal (p0 -- p7 -- p3 -- cycle);
%dotlabel.top("$p_{12}$", p12);
shift p13 by p12;
%dotlabel.top("$p_{13}$", p13);
% message "(p13 - p12):";
% show (p13 - p12);
% message "get_normal (p0 -- p7 -- p3 -- cycle):";
% show get_normal (p0 -- p7 -- p3 -- cycle);
%% w1 and w2 are nearly similar, but not quite.
% message "w1:";
% show w1;
% message "w2:";
% show w2;
% message "w1 == w2:";
% show w1 == w2;
% pause;
%% **** (4) Triangle 3
set w3 with_points (p3, p7, p2);
p14 := mediate(mediate(p2, p3), p7);
p15 := (get_normal w3) shifted p14;
%dotlabel.top("$p_{14}$", p14);
%dotlabel.top("$p_{15}$", p15);
%% *** (3) Trapezoid 1
draw e2 with_color orange;
draw e8 with_color red;
draw e11 with_color blue;
draw e13 with_color green;
bpv := e2 intersection_points e11;
p16 := bpv1;
dotlabel.top("$p_{16}$", p16);
bpv := e2 intersection_points e11;
bpv := e8 intersection_points e11;
p17 := bpv1;
dotlabel.top("$p_{17}$", p17);
p18 := mediate(p1, p17);
p19 := mediate(p2, p16);
p20 := mediate(p18, p19);
bpv := (origin -- p20) intersection_points E;
% message "bpv:";
% show bpv;
p21 := bpv0;
dotlabel.top("$p_{21}$", p21);
%% **** (4) Triangle 4
set w4 with_points (p1, p21, p2);
label("$w_{1}$", get_center w1);
label("$w_{4}$", get_center w4);
draw w4;
p22 := get_center w4;
dotlabel.top("$p_{22}$", p22);
p23 := (get_normal w4) shifted by p22;
dotlabel.top("$p_{23}$", p23);
%% **** (4) Triangle 5
set w5 with_points (p2, p21, p17);
draw w5;
p24 := get_center w5;
dotlabel.top("$p_{24}$", p24);
p25 := (get_normal w5) shifted by p24;
% message "p25:";
% show p25;
%pause;
dotlabel.top("$p_{25}$", p25);
%% **** (4) Triangle 6
set w6 with_points (p1, p16, p21);
draw w6;
p26 := get_center w6;
dotlabel.top("$p_{26}$", p26);
p27 := (get_normal w6) shifted by p26;
% message "p27:";
% show p27;
dotlabel.top("$p_{27}$", p27);
%% **** (4) Triangle 7
%% !! START HERE: LDF 2010.11.29.
%% *** (3)
v0 := current_picture;
%% *** (3) End of Figure 1
endfig with_projection parallel_x_y no_sort;
%% ** (2) Figure 2
beginfig(2);
current_picture := v0;
endfig with_projection parallel_x_z no_sort;
%% ** (2) Figure 3
beginfig(3);
current_picture := v0;
endfig with_projection parallel_z_y no_sort;
%% ** (2) Figure 4
beginfig(4);
current_picture := v0;
endfig with_focus f0 no_sort;
%% ** (2) Figure 5
%% Notes:
%% The p[] points aren't transformed. In this figure, r[] and u[] points
%% are used instead.
%% The w[] triangles are transformed, _not_ copied!
%% transform t0 -- t2 can be reused.
%%
%% LDF 2010.08.27.
point r[];
point s[];
point u[];
point h[]; %% For scratch use.
picture dtp[]; %% Double-tab picture array
numeric dtp_ctr;
dtp_ctr := 0;
beginfig(5);
%% *** (3) Trapezoid 0
%% **** (4) Triangle 0
t0 := align (p8 -- p9) with_axis y_axis;
r0 := p0 * t0;
r1 := p1 * t0;
r7 := p7 * t0;
w0 *= t0;
t1 := identity shifted by (-1 * r0);
w0 *= r0 *= r1 *= r7 *= t1;
ang_0 := r1 angle (1, 0);
% message "ang_0:";
% show ang_0;
t2 := (identity rotated (0, -ang_0)) rotated (0, 90);
w0 *= r0 *= r1 *= r7 *= t2;
% message "r0:";
% show r0;
dotlabel.rt("$r_{0}$", r0);
dotlabel.rt("$r_{1}$", r1);
dotlabel.lft("$r_{7}$", r7);
label("$w_{0}$", get_center w0);
%draw w0 with_color dark_gray;
draw r0 -- r1 dashed evenly;
draw r1 -- r7 dashed evenly;
draw r7 -- r0;
% message "w0:";
% show w0;
% pause;
%% **** (4) Triangle 1
s1 := p1;
s2 := p2;
s7 := p7;
t0 := ((align (p10 -- p11) with_axis y_axis) rotated (0, -90));
s1 *= s2 *= s7 *= w1 *= t0;
t1 := identity shifted by (r1 - s1);
s1 *= s2 *= s7 *= w1 *= t1;
s8 := s1 shifted (0, 1);
ang_0 := (s1 - s7) angle (s1 - r7);
t2 := identity rotated_around (s1, s8) -ang_0;
s1 *= s2 *= s7 *= w1 *= t2;
% message "(s1 - s7) angle (s1 - r7):";
% show (s1 - s7) angle (s1 - r7);
% message "w1:";
% show w1;
% pause;
% message "r7:";
% show r7;
% message "s7:";
% show s7;
% message "s1 == r1:";
% show s1 == r1;
r2 := s2;
dotlabel.llft("$s_{2}$", s2);
label("$w_{1}$", get_center w1);
draw r1 -- r2 dashed evenly;
draw r2 -- r7;
%% **** (4) Triangle 2 (w2)
s0 := p0;
s3 := p3;
s7 := p7;
s12 := p12;
s13 := p13;
t0 := align (s7 -- s3) with_axis x_axis;
s0 *= s3 *= s7 *= s12 *= s13 *= w2 *= t0;
t0 := align (s12 -- s13) with_axis y_axis;
shift t0 (-3, 0, .25);
s0 *= s3 *= s7 *= s12 *= s13 *= w2 *= t0;
h0 := s3 shifted (0, 1);
a := (s0 - s3) angle (1, 0);
t0 := identity rotated_around (s3, h0) -a;
s0 *= s7 *= s12 *= s13 *= w2 *= t0;
% message "s7:";
% show s7;
% message "s3:";
% show s3;
% message "s0:";
% show s0;
% message "s12:";
% show s12;
% message "s13:";
% show s13;
% message "w2:";
% show w2;
% pause;
%% !! START HERE: move w2 to a better position with respect to w0.
%% LDF 2010.11.29.
h1 := mediate(s0, s7);
h2 := mediate(r0, r7);
h3 := h1 shifted (0, 1);
h4 := s0 rotated_around (h1, h3) 90;
%dotlabel.top("$h_{4}$", h4);
%% !! START HERE: This is okay. Use a parameter instead of .75.
%% One other place, below. LDF 2010.11.29.
h5 := (unit_vector(h4 - h1) * .75) shifted by h1;
t2 := identity shifted by (h2 - h5);
s0 *= s3 *= s7 *= s12 *= s13 *= w2 *= h1 *= h2 *= h3 *= h4 *= h5 *= t2;
draw s0 -- s3 dashed evenly;
draw s0 -- s7;
%draw s3 -- s7 dashed evenly;
dotlabel.urt("$h_{1}$", h1);
dotlabel.llft("$h_{2}$", h2);
dotlabel.top("$h_{5}$", h5);
dotlabel.bot("$s_{0}$", s0);
%dotlabel.top("$s_{3}$", s3);
%dotlabel.top("$s_{7}$", s7);
label("$w_2$", get_center w2);
%% **** (4) Triangle 3
u2 := p2;
u3 := p3;
u7 := p7;
t0 := (align (p14 -- p15) with_axis y_axis);
rotate t0 (0, 270);
shift t0 (2, 0);
u2 *= u3 *= u7 *= w3 *= t0;
a := (u7 - u3) angle (1, 0, 0);
h0 := u3 shifted (0, 1);
t1 := identity rotated_around (u3, h0) -a;
u2 *= u7 *= w3 *= t1;
a := (s7 - s3) angle (1, 0, 0);
% message "a:";
% show a;
t2 := identity rotated_around (u3, h0) a;
u2 *= u7 *= w3 *= t2;
t3 := identity shifted by (s7 - u7);
u2 *= u3 *= u7 *= w3 *= t3;
% message "u2:";
% show u2;
% message "u7:";
% show u7;
% message "u3:";
% show u3;
% pause;
% message "w3:";
% show w3;
% message "(u7 - u3):";
% show (u7 - u3);
% message "(s7 - s3):";
% show (s7 - s3);
% pause;
draw u2 -- u7;
draw u3 -- u7 dashed evenly;
draw u2 -- u3 dashed evenly;
dotlabel.ulft("$u_{2}$", u2);
dotlabel.lft("$u_{3}$", u3);
dotlabel.urt("$u_{7}$", u7);
% message "w0:";
% show w0;
% message "w3:";
% show w3;
% message "w1:";
% show w1;
% message "w2:";
% show w2;
label("$w_3$", get_center w3);
%% **** (4) Tabs for triangles w0 -- w2
dtp_ctr := 0;
tab (dtp, dtp_ctr) {w0, 0, 2, .8, .7, .25, w2, 0, 1, 5}; % dtp0
dtp_ctr += 1;
%% **** (4) Tabs for triangles w1 -- w3
% dotlabel.bot(0, get_point 0 w1) with_text_color red;
% dotlabel.bot(1, get_point 1 w1) with_text_color red;
% dotlabel.bot(2, get_point 2 w1) with_text_color red;
% dotlabel.bot(0, get_point 0 w3) with_text_color blue;
% dotlabel.bot(1, get_point 1 w3) with_text_color blue;
% dotlabel.bot(2, get_point 2 w3) with_text_color blue;
tab (dtp, dtp_ctr) {w1, 1, 2, .8, .7, .25, w3, 1, 2, 5}; % dtp1
dtp_ctr += 1;
%% *** (3) Trapezoid 1
%% **** (4) Triangle 4 (w4)
point P[];
P1 := p1;
P2 := p2;
P21 := p21;
P22 := p22; % center of w4
P23 := p23; % normal of w4 (shifted to center)
t0 := align (P22 -- P23) with_axis y_axis;
shift t0 (1, 0, 1);
P1 *= P2 *= P21 *= P22 *= P23 *= w4 *= t0;
h0 := P2 shifted (0, 1);
a := (r1 - s2) angle (P1 - P2);
%message "a:";
%show a;
t1 := identity rotated_around (P2, h0) -a;
P1 *= P21 *= P22 *= P23 *= w4 *= t1;
b := (r1 - s2) angle (P1 - P2);
% message "b:";
% show b;
% message "(P1 - P2):";
% show (P1 - P2);
% message "(r1 - s2):";
% show (r1 - s2);
t2 := identity shifted by (r1 - P1);
P1 *= P2 *= P21 *= P22 *= P23 *= w4 *= t2;
%draw w4 with_color red;
draw P1 -- P21;
draw P2 -- P21 dashed evenly;
label("$w_{4}$", P22);
%dotlabel.urt("$P_{1}$", P1);
%dotlabel.urt("$P_{2}$", P2);
dotlabel.urt("$P_{21}$", P21);
%% **** (4) Triangle 5 (w5)
point R[];
R2 := p2;
R17 := p17;
R21 := p21;
R24 := p24;
R25 := p25;
t0 := ((align (R24 -- R25) with_axis y_axis) rotated (0, -90)) shifted (3, 0);
R2 *= R17 *= R21 *= R24 *= R25 *= w5 *= t0;
% message "w5:";
% show w5;
a := (R21 - R2) angle (P21 - s2);
t1 := identity rotated_around (R24, R25) -a;
R2 *= R17 *= R21 *= w5 *= t1;
% message "a:";
% show a;
b := (R21 - R2) angle (P21 - s2);
% message "b:";
% show b;
t2 := identity shifted by (P21 - R21);
R2 *= R17 *= R21 *= R24 *= R25 *= w5 *= t2;
%draw w5;
%dotlabel.urt("$R_{2}$", R2);
dotlabel.urt("$R_{17}$", R17);
%dotlabel.urt("$R_{21}$", R21);
% message "(R21 - R2):";
% show (R21 - R2);
% message "(P21 - s2):";
% show (P21 - s2);
draw R21 -- R17;
draw R2 -- R17 dashed evenly;
% message "R24:";
% show R24;
label("$w_{5}$", R24);
%% !! START HERE: Working on tabs. LDF 2010.11.26.
%% **** (4) Triangle 6 (w6)
point S[];
S1 := p1;
S16 := p16;
S21 := p21;
S26 := p26;
S27 := p27;
t0 := ((align (S26 -- S27) with_axis y_axis) rotated (0, -90)) shifted (3, 0);
S1 *= S16 *= S21 *= S26 *= S27 *= w6 *= t0;
a := (S21 - S1) angle (P21 - r1);
% message "a:";
% show a;
t1 := identity rotated_around (S26, S27) a;
S1 *= S16 *= S21 *= w6 *= t1;
b := (S21 - S1) angle (P21 - r1);
% message "b:";
% show b;
% message "w6:";
% show w6;
% message "(S21 - S1):";
% show (S21 - S1);
% message "(P21 - r1):";
% show (P21 - r1);
h0 := mediate(r1, P21);
h1 := mediate(S1, S21);
h2 := h0 shifted (0, 1);
h3 := r1 rotated_around (h0, h2) 90;
%dotlabel.top("$h_{0}$", h0);
%dotlabel.top("$h_{1}$", h1);
%dotlabel.top("$h_{3}$", h3);
h4 := (unit_vector(h3 - h0) * .75) shifted h0;
%dotlabel.top("$h_{4}$", h4);
t2 := identity shifted by (h4 - h1);
S1 *= S16 *= S21 *= S26 *= S27 *= w6 *= h1 *= t2;
%pause;
%draw w6;
draw S1 -- S16 dashed evenly;
draw S1 -- S21;
draw S21 -- S16 dashed evenly;
dotlabel.rt("$S_{1}$", S1);
dotlabel.rt("$S_{16}$", S16);
dotlabel.lft("$S_{21}$", S21);
% message "S26:";
% show S26;
label("$w_{6}$", S26);
%% **** (4)
%% *** (3) End of Figure 5
endfig with_projection parallel_x_z no_sort;
%% ** (2) Separate double tabs
beginfig(6);
%% *** (3) Trapezoid 0
%% **** (4) Triangles w0 -- w2
%% dtp0: w0 -- w2
shift dtp0 (-1, 0);;
current_picture += dtp0;
label("$w_{0}$ -- $w_{2}$", (-.5, 0, -.5));
%% **** (4) Triangles w1 -- w3
%% dtp1: w1 -- w3
shift dtp1 (.5, 0);;
current_picture += dtp1;
label("$w_{1}$ -- $w_{3}$", (1, 0, -.5));
%% **** (4) Triangles w4 -- w6
%% *** (3) End of figure 6
endfig with_projection parallel_x_z no_sort;
%% ** (2)
%% ** (2) Figure 7
point p[];
transform t[];
transform temp_trf;
temp_trf := identity shifted (0, 0, -5);
numeric offset;
offset := .675cm;
%% *** (3)
beginfig(7);
%% **** (4) w0
rotate w0 (180, 90);
w0 *= temp_trf;
draw w0;
label("$w_{0}$", get_center w0);
cutout (offset) {w0};
for i := 0 upto 2:
label.top(i, get_point (i) w0);
endfor;
%% **** (4) w1
shift w1 by (-1 * get_point 0 w1);
rotate w1 (180, 180);
p0 := get_point 0 w1;
p1 := get_point 1 w1;
p2 := get_point 2 w1;
a := (p2 - p0) angle (1, 0);
% message "a:";
% % show a;
t0 := identity rotated (0, a);
p0 *= p1 *= p2 *= w1 *= t0;
% message "p0:";
% show p0;
% message "w1:";
% show w1;
% dotlabel.top("$p_{0}$", p0);
% dotlabel.top("$p_{1}$", p1);
% dotlabel.top("$p_{2}$", p2);
a := xpart (get_point 1 w0) + (1.5 * offset);
shift w1 (a, 0);
w1 *= temp_trf;
draw w1;
label("$w_{1}$", get_center w1);
cutout (offset) {w1};
draw w1;
if true: % false
for i = 0 upto 2:
dotlabel.top(i, get_point (i) w1);
endfor;
fi;
%% **** (4) w2
shift w2 by -1 * get_point 2 w2;
rotate w2 (180, 0);
a := xpart (get_point 2 w1) + (1.5 * offset);
shift w2 (a, 0);
w2 *= temp_trf;
p0 := get_point 0 w2;
p1 := get_point 1 w2;
p2 := get_point 2 w2;
dotlabel.top("$p_{0}$", p0);
dotlabel.top("$p_{1}$", p1);
dotlabel.top("$p_{2}$", p2);
%% !! START HERE: Get the triangles to be exactly aligned on the x-axis.
%% LDF 2010.12.04.
message "p2:";
show p2;
message "get_point 2 w1:";
show get_point 2 w1;
%pause;
draw w2;
label("$w_{2}$", get_center w2);
cutout (offset) {w2};
%% **** (4)
endfig with_projection parallel_x_z no_sort;
%% *** (3) End of figure 7
%% *** (3) End of 3DLDF code
verbatim_metapost "end;";
end;
%% ** (2)
%% * (1) Emacs-Lisp code for use in indirect buffers when using the
%% GNU Emacs editor. The local variable list is not evaluated when an
%% indirect buffer is visited, so it's necessary to evaluate the
%% following s-expression in order to use the facilities normally
%% accessed via the local variables list.
%% LDF 2004.02.12.
%% (progn (metafont-mode) (outline-minor-mode t) (setq fill-column 80) (ignore '(
%% )) (setq outline-regexp "%% [*\f]+"))
%% * (1) Local variables for Emacs.
%% Local Variables:
%% mode:Metafont
%% eval:(outline-minor-mode t)
%% eval:(read-abbrev-file abbrev-file-name)
%% outline-regexp:"%% [*\f]+"
%% End:
|