m-three.mkiv /size: 1691 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=m-three,
3%D        version=2017.11.08,
4%D          title=\CONTEXT\ Extra Modules,
5%D       subtitle=\METAPOST\ pseudo-3D module support,
6%D         author=Hans Hagen and Alan Braslau,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\unprotect
15
16\defineMPinstance
17  [three]
18  [\s!format=metafun,
19   \s!extensions=\v!yes,
20   \s!initializations=\v!yes,
21   \c!method=\s!double]
22
23\startMPdefinitions{three}
24    loadmodule "tres" ;
25\stopMPdefinitions
26
27\protect
28
29\continueifinputfile{m-three.mkiv}
30
31%D We put this test here as in \type {meta-tex.mkiv} it would abort due to redefinition
32%D of namespaces.
33
34\starttext
35
36%D Alan: we need to make a fill example:
37
38\startMPpage[instance=three]
39    path f ; f := (
40        projection Origin  --
41        projection (1,0,0) --
42        projection (1,1,0) --
43        projection (0,1,0) --
44        projection (0,1,1) --
45        projection (1,1,1) --
46        projection (1,0,1) --
47        projection (0,0,1) --
48        cycle
49    ) scaled 5cm ;
50
51    fill f withcolor "darkred"  ;
52
53    path p ; p := (
54        projection Origin  --
55        projection (1,0,0) --
56        projection (1,1,0) --
57        projection (0,1,0) --
58        projection (0,1,1) --
59        projection (1,1,1) --
60        projection (1,0,1) --
61        projection (0,0,1) --
62        cycle
63    ) scaled 5cm ;
64
65    draw p withcolor .5white  ;
66
67    for i=0 upto length p :
68        draw point i of p withpen currentpen scaled 2mm withcolor "lightblue" ;
69    endfor ;
70\stopMPpage
71
72\stoptext
73