summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/metapost/featpost')
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/README.ctan29
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/README.featpost36
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/dosome.sh95
-rwxr-xr-xMaster/texmf-dist/doc/metapost/featpost/bashscript/eps2j.sh1
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/fpost1
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/insertinputcommands.sed5
-rwxr-xr-xMaster/texmf-dist/doc/metapost/featpost/bashscript/insertinputcommands.sh6
-rwxr-xr-xMaster/texmf-dist/doc/metapost/featpost/bashscript/laproof13
-rwxr-xr-xMaster/texmf-dist/doc/metapost/featpost/bashscript/lbproof16
-rwxr-xr-xMaster/texmf-dist/doc/metapost/featpost/bashscript/lcproof13
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/makelogo.sh9
-rwxr-xr-xMaster/texmf-dist/doc/metapost/featpost/bashscript/maketugboatart.sh8
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/nontextualpng.sh10
-rwxr-xr-xMaster/texmf-dist/doc/metapost/featpost/bashscript/procedurenames.sh8
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/remfi.sh32
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/removeinputcommand.sh9
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/replacetext.sh7
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh15
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/doc/doclicense.txt10
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/doc/featexamples.html163
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/doc/featpost.1.gzbin0 -> 1980 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/doc/featpost.sgml1623
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/doc/tug2004.pdfbin0 -> 413671 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/bugtrack/bughunt.mp57
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/bugtrack/gstr.mp9
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/highmemory/hiddenlinegraph.mp72
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp54
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/highmemory/par3Dplotexamples.mp149
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/borderframetest.mp28
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/conegetready.mp36
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/doitnow.mp33
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/electricpotential.mp151
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/emptylines.mp28
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/experimental.mp177
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/fieldlines.mp59
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/fis3prey.mp128
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/frustum.mp46
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/geom_casq.mp84
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/geom_freder.mp94
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/graphexample.mp16
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/lcurvature.mp114
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/mptoolcone.mp49
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/nembends.mp48
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/nemdirector.mp82
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/nemquira.mp60
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/nemquirapitch.mp69
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/nemuniax.mp61
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/pathernon.mp65
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/planpht.mp291
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/rigorcubo.mp36
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/rmnbob.mp45
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/sal.mp104
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/sfearschem.mp34
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/signalvertexSD.mp40
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/spherample.mp49
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/squareanglines.mp14
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/troncoconedef.mp54
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/twistnlc.mp54
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/twistroundbiax.mp62
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/twocyclestogether.mp113
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/repeated/twoupcones.mp51
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/anglinerigorouscircle.mp108
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/cartaxes.mp28
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/conicurv.mp94
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/cubicfacecentered.mp112
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/cubicfigures.mp44
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/cylimple.mp50
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/downloadicon.mp66
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/eemcsblabla.mp292
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/embroncordada.mp57
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/fakehole.mp59
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/featpostlogo.mp29
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/ffcbob.mp84
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/fieldlinesnorma.mp104
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/fis1prex.mp131
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/fis3prex.mp481
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/geombasic.mp82
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/geomfiguei.mp71
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/geommine.mp104
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/globe.mp32
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/halfcirclesfear.mp43
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/hexagonaltrimesh.mp25
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/hiddensurface.mp153
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/hiddensurfaces.mp65
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/inductionbob.mp116
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/joinedemptylines.mp47
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/kindofcube.mp81
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/labelconstruct.mp30
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/labelinspace.mp33
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/magneticflux.mp105
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/nembiaxi.mp64
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/nemsaddl.mp86
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/nsmetica.mp60
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/parafuso.mp100
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/pathofstraightline.mp29
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/photoreverse.mp242
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/polyhedr.mp191
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/positivecharge.mp28
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/resistcircuit.mp64
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/rigorouscircle.mp49
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/rigorouscone.mp36
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousdiscSD.mp49
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousdiscoptions.mp31
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousfearpath.mp66
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/rotatnlc.mp49
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/saturn.mp111
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/sharpraytrace.mp102
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/simplecar.mp25
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/simplecarparam.mp56
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/spatialhalfsfear.mp15
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/spltwiben.mp81
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/stageforthree.mp115
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/tangencypoint.mp38
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/tdarrow.mp26
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/thearchicon.mp59
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/thethreekindsofperspec.mp195
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/torus.mp297
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/trajectoryline.mp88
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/triangulartrimesh.mp39
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/tropicalglobe.mp23
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/tshirtfig.mp39
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/tuftescatter.mp83
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/twistflat.mp55
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/twoholes.mp31
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/unperfection.mp59
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/unperfectionremoved.mp34
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/vanallenbelt.mp51
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/verygoodcone.mp28
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/standard/xraycamera.mp117
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/cone.mp37
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/ellipticprism.mp39
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/intersection2D.mp46
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/kindofcube.mp57
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/newexperimental.mp157
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/perspec.mp77
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/planintersection.mp105
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/revolvers.mp112
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/tug04/tangency2D.mp56
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/galrey/galrey.rc75
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/galrey/galrey.sh6
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/galrey/galrey.tpl42
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/jpeg/cbxSmall.jpgbin0 -> 2537 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/jpeg/hiddenlinegraph1.jpgbin0 -> 30350 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/jpeg/mymetapostbackground.jpegbin0 -> 23535 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/jpeg/mymetapostclearback.jpegbin0 -> 4710 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/jpeg/par3Dplotexamples1.jpgbin0 -> 15400 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/jpeg/par3Dplotexamples2.jpgbin0 -> 27764 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/jpeg/planpau2.jpegbin0 -> 15711 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/latex/linuxdoc-sgml.sty117
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/latex/logofeatpost.tex18
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/latex/ltugboat.cls1225
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/latex/macroMan.tex1737
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/latex/mflogohack.sty31
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/latex/null.sty0
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/latex/qwertz.sty19
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/macro/README.macro13
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/cylimple.1.pngbin0 -> 8642 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/globe.1.pngbin0 -> 21110 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/rigorouscone.1.pngbin0 -> 11103 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/rigorousfearpath.1.pngbin0 -> 8984 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/rotatnlc.1.pngbin0 -> 37973 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/stageforthree.2.pngbin0 -> 34023 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/torus.5.pngbin0 -> 83805 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/torus.6.pngbin0 -> 62981 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/nontextualpng/triangulartrimesh.1.pngbin0 -> 95207 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/border140.pngbin0 -> 552 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/borderframetest.pngbin0 -> 291 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/composite.pngbin0 -> 264 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/downloadicon.pngbin0 -> 5494 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/experfilminifram.pngbin0 -> 23300 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/featpost2.pngbin0 -> 4763 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/inifram.pngbin0 -> 4412 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/lcdistortsallinifram.pngbin0 -> 43210 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/metapostlace.pngbin0 -> 20108 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/png/myicon.pngbin0 -> 237 bytes
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/typesetinspace/README.mpy21
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/typesetinspace/example.mp17
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/typesetinspace/exampleminimal.mp7
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/typesetinspace/makempy.pl365
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/typesetinspace/mp-grph.mp295
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/typesetinspace/mp-tool.mp2366
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/xcmd/README.xcmd10
-rwxr-xr-xMaster/texmf-dist/doc/metapost/featpost/xcmd/xmpost70
183 files changed, 17582 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/featpost/README.ctan b/Master/texmf-dist/doc/metapost/featpost/README.ctan
new file mode 100644
index 00000000000..5a7f3e02dd0
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/README.ctan
@@ -0,0 +1,29 @@
+I've uploaded the file
+ featpost.tgz
+to
+ ftp://dante.ctan.org/incoming/
+
+This file contains, among other files and directories:
+
+ -An installation script
+ bashscript/dosome.sh
+
+ -Documentation
+ doc/featpost.sgml
+ doc/tug2004.pdf
+
+ -One set of macros
+ macro/featpost3Dplus2D.mp
+
+ -And lots of example programs in
+ example/
+
+It is meant to replace the actual
+ graphics/metapost/contrib/macros/featpost
+sub-tree. The description of this package is:
+"FeatPost is an extension of the MetaPost language,
+works in two and three dimensions
+and has several features to facilitate
+the production of physics diagrams."
+
+No change was introduced in the licensing: GPL.
diff --git a/Master/texmf-dist/doc/metapost/featpost/README.featpost b/Master/texmf-dist/doc/metapost/featpost/README.featpost
new file mode 100644
index 00000000000..412e68a7f46
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/README.featpost
@@ -0,0 +1,36 @@
+If you've just unpacked FEATPOST it's time to do
+ bashscript/dosome.sh < /dev/null
+You'll see many text lines rolling up your scren,
+some of them containing error messages.
+DON'T PANIC. This will just take quite
+some time and about 80MB of disk space.
+It is supposed that you've got, at least,
+ImageMagick and Linuxdoc installed. Galrey, dog and
+textutils are also in order. All software is available
+as Debian GNU/Linux packages (except FEATPOST).
+Well, this is a bit complicated. The simple way is
+to copy the file
+ macro/featpost3Dplus2D.mp
+to
+ /usr/TeX/texmf-local/metapost/local/
+or
+ /usr/share/texmf/metapost/misc/
+or something appropriate and to do
+ texhash
+
+If you're returning you should remember to do
+ export TEX=latex
+ mpost -mem featpost example/standard/someexamplefile.mp
+ bashscript/laproof someexamplefile N
+ gv someexamplefile.N.eps &
+but, again, if you chose the simple way you must uncomment
+ %input featpost3Dplus2D;
+in someexamplefile.mp
+
+Good luck!
+
+P.S. - The cutting-edge feature is
+ "Automatic Perspective Tuning"
+as processed by the macro "photoreverse".
+If you want to know more about this:
+ nobre@lince.cii.fc.ul.pt
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/dosome.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/dosome.sh
new file mode 100644
index 00000000000..ff908c37ed9
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/dosome.sh
@@ -0,0 +1,95 @@
+#! /bin/bash
+# Execute this script with the command
+# bashscript/dosome.sh < /dev/null > dosome.log
+# (from the featpost root directory)
+# Don't worry about the error messages.
+# L. Nobre G.
+# IYP (2005)
+
+export TEX=latex
+mkdir alleps
+mkdir allpng
+mkdir allps
+mkdir ppm
+mkdir galreyimages
+cd macro
+mpost --ini featpost.mp
+cd ..
+ln -s macro/featpost.mem
+ln -s latex/mflogohack.sty
+echo \\documentclass[twocolumn]{article}\
+ \\usepackage[dvips]{epsfig}\
+ \\usepackage{mflogohack}\
+ \\begin{document}\
+ \\title{\\FP\\ Exemplifier}\
+ \\author{L.\\ Nobre G.}\
+ \\maketitle\
+ \\begin{center}\
+ > FeatPostExemplifier.tex
+for a in example/standard/*.mp
+do
+ b=`basename $a .mp`
+ mpost -mem featpost example/standard/$b
+ for c in $b.?
+ do
+ echo \\vfill\
+ \\begin\{tabular\}\{c\}\
+ \\epsfig\{file=$c\,width=0.9\\columnwidth\} \\\\\
+ \\texttt\{$c\}\
+ \\end\{tabular\} \\\\ >> FeatPostExemplifier.tex
+ echo \\documentclass{article}\\usepackage[dvips]{epsfig}\\begin{document}\\pagestyle{empty}\\epsfig{file=$c,width=0.9\\textwidth}\\end{document} > $c.latex
+ latex $c.latex
+ dvips -E -o $c.PS $c.dvi
+ epstopdf --nogs $c.PS > $c.eps
+ gs -q -sDEVICE=png256 -r120 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dCOLORSCREEN -dNOPAUSE -sOutputFile=$c.gs.png $c.eps
+# composite -filter Lanczos -geometry 300x300 -gravity Center $c.gs.png png/borderframetest.png ppm/t_$c.ppm
+ composite -filter Lanczos -geometry 120x120 -gravity Center $c.gs.png png/border140.png ppm/t_$c.ppm
+ done
+ for ((num=0;num<10;num=num+1))
+ do
+ cp $b.$num.gs.png galreyimages/$b$num.png
+ mv ppm/t_$b.$num.ppm ppm/t_$b$num.ppm
+ done
+done
+echo \\end{center}\\end{document} >> FeatPostExemplifier.tex
+latex FeatPostExemplifier.tex
+dvips -o FeatPostExemplifier.ps FeatPostExemplifier.dvi
+bzip2 FeatPostExemplifier.ps
+mv FeatPostExemplifier.ps.bz2 doc/
+rm FeatPostExemplifier.*
+rm mflogohack.sty
+rm *.?.PS *.?.aux *.?.latex *.?.dvi *.log *.?.mgk *.?.orig
+rm example/standard/*.mpx
+mv *.? allps/
+mv *.?.gs.png allpng/
+mv *.?.png nontextualpng/
+mv *.?.eps alleps/
+#animate -delay 125 ppm/* &
+cd doc
+linuxdoc -B html --split=2 --toc=2 featpost.sgml
+linuxdoc -B latex featpost.sgml
+mv featpost.tex ../latex/
+cd ../latex
+latex featpost.tex
+latex featpost.tex
+dvips -o featpost.ps featpost.dvi
+ps2pdf featpost.ps
+mv featpost.ps featpost.pdf ../doc/
+#sed 's/article/ltugboat/' featpost.tex > tugboatMan.tex
+#latex tugboatMan.tex
+#latex tugboatMan.tex
+#dvips -o ../doc/tugboatMan.ps tugboatMan.dvi
+cd ../galrey
+source galrey.sh
+cd ..
+for a in ppm/t_*.ppm
+do
+ convert $a galreyimages/`basename $a ppm`png
+done
+pwd
+
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/eps2j.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/eps2j.sh
new file mode 100755
index 00000000000..4fe6fd4265a
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/eps2j.sh
@@ -0,0 +1 @@
+gs -q -sDEVICE=jpeggray -dNOPAUSE -sOutputFile=eps.jpeg $1 </dev/null
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/fpost b/Master/texmf-dist/doc/metapost/featpost/bashscript/fpost
new file mode 100644
index 00000000000..63d3588a4c2
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/fpost
@@ -0,0 +1 @@
+mpost -mem featpost example/standard/$1 \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/insertinputcommands.sed b/Master/texmf-dist/doc/metapost/featpost/bashscript/insertinputcommands.sed
new file mode 100644
index 00000000000..6fe8c6ed0c2
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/insertinputcommands.sed
@@ -0,0 +1,5 @@
+4i\
+\
+%input featpost3D;\
+%input par3Dplotmacros; % Contributed by J. Schwaiger \
+%input featpost2D;
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/insertinputcommands.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/insertinputcommands.sh
new file mode 100755
index 00000000000..d562871aed7
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/insertinputcommands.sh
@@ -0,0 +1,6 @@
+for a in *.mp; do mv $a `basename $a mp`mpN; done
+for a in *.mpN
+ do sed -f ../bashscript/insertinputcommands.sed $a > `basename $a mpN`mp
+done
+#rm *.mpN
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/laproof b/Master/texmf-dist/doc/metapost/featpost/bashscript/laproof
new file mode 100755
index 00000000000..298e99a382e
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/laproof
@@ -0,0 +1,13 @@
+#!/bin/sh
+name=`basename $1 .mp`
+figname=$name.$2
+echo \\documentclass{article}\\usepackage[dvips]{epsfig}\\begin{document}\\pagestyle{empty}\\epsfig{file=$figname}\\end{document} > $figname.latex
+latex $figname.latex
+dvips -Pcmz -Pamz -E -o $figname.eps $figname.dvi
+# epstopdf -d --nogs $figname.eps > $name.eps
+# Modification of an original by J.M.C.Esteves
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/lbproof b/Master/texmf-dist/doc/metapost/featpost/bashscript/lbproof
new file mode 100755
index 00000000000..491bdb66a83
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/lbproof
@@ -0,0 +1,16 @@
+#!/bin/sh
+name=`basename $1 .mp`
+figname=$name.$2
+#mpost -mem featpost $name
+echo \\documentclass{article}\\usepackage[dvips]{epsfig}\\setlength{\\paperwidth}{8.2in}\\setlength{\\paperheight}{11.2in}\\setlength{\\textwidth}{8in}\\setlength{\\textheight}{11in}\\setlength{\\voffset}{-1in}\\setlength{\\hoffset}{-1in}\\setlength{\\topmargin}{0pt}\\setlength{\\headheight}{0pt}\\setlength{\\headsep}{0pt}\\setlength{\\oddsidemargin}{0pt}\\begin{document}\\pagestyle{empty}\\epsfig{file=$figname,width=\\columnwidth,clip=}\\end{document} > $figname.latex
+latex $figname.latex
+dvips -Pcmz -Pamz -E -o $figname.eps $figname.dvi
+#epstopdf -d --nogs $figname.eps > tmp.eps
+#gs -sDEVICE=jpeggray -dNOPAUSE -sOutputFile=$name.jpeg tmp.eps </dev/null
+#rm -v tmp.eps
+# Modification of an original by J.M.C.Esteves
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/lcproof b/Master/texmf-dist/doc/metapost/featpost/bashscript/lcproof
new file mode 100755
index 00000000000..27ba07313bf
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/lcproof
@@ -0,0 +1,13 @@
+#!/bin/sh
+name=`basename $1 .mp`
+figname=$name.$2
+echo \\documentclass{article}\\usepackage[dvips]{epsfig}\\setlength{\\paperwidth}{8.2in}\\setlength{\\paperheight}{11.2in}\\setlength{\\textwidth}{8in}\\setlength{\\textheight}{11in}\\setlength{\\voffset}{-1in}\\setlength{\\hoffset}{-1in}\\setlength{\\topmargin}{0pt}\\setlength{\\headheight}{0pt}\\setlength{\\headsep}{0pt}\\setlength{\\oddsidemargin}{0pt}\\begin{document}\\pagestyle{empty}\\epsfig{file=$figname,height=\\textheight,clip=}\\end{document} > $figname.latex
+latex $figname.latex
+dvips -Pcmz -Pamz -E -o $figname.eps $figname.dvi
+# epstopdf -d --nogs $figname.eps > $name.eps
+# Modification of an original by J.M.C.Esteves
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/makelogo.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/makelogo.sh
new file mode 100644
index 00000000000..7753995c94e
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/makelogo.sh
@@ -0,0 +1,9 @@
+#! /bin/bash
+cd latex
+latex logofeatpost.tex
+dvips -E -o logofeatpost.ps logofeatpost.dvi
+epstopdf -d -nogs logofeatpost.ps > featpost.eps
+gs -q -sDEVICE=png256 -r300x300 -dNOPAUSE -sOutputFile=featpost.png featpost.eps </dev/null
+cp featpost.png featpost2.png
+mogrify -geometry 25% featpost2.png
+cd ..
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/maketugboatart.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/maketugboatart.sh
new file mode 100755
index 00000000000..cb96f1a651a
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/maketugboatart.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+cd latex/
+sgml2latex ../doc/macroMan.sgml
+sed 's/article/ltugboat/' macroMan.tex > tugboatMan.tex
+latex tugboatMan.tex
+dvips -o ../doc/tugboatMan.ps tugboatMan.dvi
+rm -v tugboatMan.???
+cd ../ \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/nontextualpng.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/nontextualpng.sh
new file mode 100644
index 00000000000..aa86f2f943c
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/nontextualpng.sh
@@ -0,0 +1,10 @@
+#! /bin/bash
+# L. Nobre G.
+# IYP (2005)
+
+mkdir nontextualpng
+for a in allps/*
+do
+ convert -bordercolor white -border 20x20 -transparent white \
+ -format png $a nontextualpng/`basename $a`.png
+done
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/procedurenames.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/procedurenames.sh
new file mode 100755
index 00000000000..82629e1415b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/procedurenames.sh
@@ -0,0 +1,8 @@
+#! /bin/bash
+sed -n '/ def /p' macro/la3Dmacros.mp > la3Ddef.txt
+sed -n '/ vardef /p' macro/hlr3Dmacros.mp > hlr3Dvardef.txt
+sed -n '/ def /p' macro/hlr3Dmacros.mp > hlr3Ddef.txt
+cat la3Ddef.txt hlr3Dvardef.txt hlr3Ddef.txt > alldef.txt
+rm -v la3Ddef.txt hlr3Dvardef.txt hlr3Ddef.txt
+# there are two "vardefined" procedures:
+# makeline@# and makeface@#
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/remfi.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/remfi.sh
new file mode 100644
index 00000000000..cb37397d06b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/remfi.sh
@@ -0,0 +1,32 @@
+#! /bin/bash
+# remfi.sh
+# L. Nobre G.
+# IYP (2005)
+rm -fR alleps allpng allps ppm galreyimages
+rm macro/*~ example/standard/*.mpx example/standard/*~
+rm doc/*~ bashscript/*~ latex/*~ *~
+rm latex/featpost.*
+rm latex/tugboatMan.*
+rm latex/macroMan.dvi
+rm latex/macroMan.log
+rm latex/macroMan.aux
+rm doc/featpost.ps
+rm doc/featpost.pdf
+rm doc/featpost.html
+rm doc/featpost-*.html
+rm doc/tugboatMan.ps
+rm galrey/galrey.fn
+rm galrey/galrey.ls
+rm galrey/galrey.memo
+rm galrey/galrey.nms
+rm *.tex *.aux *.dvi *.log *.latex *.eps *.?
+rm macro/featpost.mem macro/featpost.log
+rm *.?.PS *.?.aux *.?.latex *.?.dvi *.log *.?.mgk *.?.orig
+rm *.?.gs.png *.?.png
+rm featpost.mem
+rm doc/featpost.sgml.flc
+rm macro/featpost3Dplus2D.mp.flc
+rm doc/FeatPostExemplifier.ps.bz2
+rm mflogohack.sty
+cd ..
+tar cvzf down/featpost.tgz featpost/
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/removeinputcommand.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/removeinputcommand.sh
new file mode 100644
index 00000000000..a1d41226431
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/removeinputcommand.sh
@@ -0,0 +1,9 @@
+for a in *; do cp $a $a.NEW; done
+for a in *.NEW
+do
+ b=`basename $a .NEW`
+ sed -e '/%input featpost2D;/d' $a > $b
+# echo $a ----- $b
+done
+rm *.NEW
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/replacetext.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/replacetext.sh
new file mode 100644
index 00000000000..2afdf6f28c4
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/replacetext.sh
@@ -0,0 +1,7 @@
+for a in *; do mv $a `basename $a`.NEW; done
+#for a in *.mp; do mv $a `basename $a mp`mpN; done
+for a in *.NEW
+ do sed -e 's/featpost3D/featpost3Dplus2D/' $a > `basename $a .NEW`
+done
+rm *.NEW
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh
new file mode 100644
index 00000000000..4cef12f11fb
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh
@@ -0,0 +1,15 @@
+prefwidth=640
+prefheigh=480
+prefratio=$(( 1000 * $prefwidth / $prefheigh ))
+tmpfilename=`mktemp simpleviewer.XXXXXX`
+epstopdf --nogs $1 > $tmpfilename
+epswidth=`identify $tmpfilename | cut -d " " -f 3 | cut -d x -f 1`
+epsheigh=`identify $tmpfilename | cut -d " " -f 3 | cut -d x -f 2`
+aspectra=$(( 1000 * $epswidth / $epsheigh ))
+if test $aspectra -ge $prefratio
+then resol=$(( 72 * $prefwidth / $epswidth ))
+else resol=$(( 72 * $prefheigh / $epsheigh ))
+fi
+echo " Resolution:" $resol "dpi."
+gs -q -r$resol -sDEVICE=x11 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 $tmpfilename
+rm $tmpfilename \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/doclicense.txt b/Master/texmf-dist/doc/metapost/featpost/doc/doclicense.txt
new file mode 100644
index 00000000000..caacdfcf042
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/doc/doclicense.txt
@@ -0,0 +1,10 @@
+ This document, FEATPOST macros,
+ is copyrighted (c) 2003 by L. Nobre G.
+ Permission is granted to copy, distribute and/or modify
+ this document under the terms of the
+ GNU Free Documentation License, Version 1.1 or any later
+ version
+ published by the Free Software Foundation; with no
+ Invariant Sections, with no Front-Cover Texts, and with
+ no Back-Cover Texts. A copy of the license is available
+ at <url url="http://www.gnu.org/copyleft/fdl.html">.
diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/featexamples.html b/Master/texmf-dist/doc/metapost/featpost/doc/featexamples.html
new file mode 100644
index 00000000000..43d119f304b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/doc/featexamples.html
@@ -0,0 +1,163 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+ <title>FeatPost Examples</title>
+ </head>
+ <body text="#000000" link="#0000ff" vlink="#ff5599" alink="#00ff00"
+ background="../jpeg/mymetapostclearback.jpeg" bgcolor="white">
+ <h1 align="center"><img src="../png/featpost2.png"
+ alt="FeatPost Examples">
+ </h1>
+
+ <p>
+ Most diagrams are done with sort-of-CAD packages. These packages
+ usually hide their language from the user and, probably, draw only
+ planar diagrams. FeatPost is an extension of the
+ <a href="http://cm.bell-labs.com/who/hobby/MetaPost.html">MetaPost</a>
+ language, works in three dimensions and has several features to
+ facilitate the production of physics diagrams. For the production of
+ animations see
+ <a href="http://matagalatlante.org/nobre/aneemate/nodocs/aneematepage.html">aneemate</a>.
+ </p>
+
+ <center>
+ <p>If you do not see any pictures on this page,
+ you may locally run the <a href="../bashscript/dosome.sh">installation
+ script</a> (after downloading) or visit
+ <a href="http://matagalatlante.org/nobre/featpost/doc/featexamples.html">http://matagalatlante.org/nobre/featpost/doc/featexamples.html</a></p>
+ <table>
+ <tbody>
+ <tr>
+ <td align="right" valign="middle">
+ Click on this icon to download:</td>
+ <td><a href="../../down/featpost.tgz">
+ <img src="../png/downloadicon.png" alt="Download Now! ">
+ </a></td>
+ <td align="left" valign="top">
+ <a href="./featpost.html">Online User's
+ Guide.</a><br>
+ <a href="./featpost.pdf">PDF User's
+ Guide.</a><br>
+ <a href="../galreyimages/index.html">Online Examples.</a><br>
+ <a href="./FeatPostExemplifier.ps.bz2">PostScript Examples.</a><br>
+ <a href="http://www.ctan.org/tex-archive/graphics/metapost/contrib/macros/featpost/">CTAN.</a><br>
+ <a href="http://matagalatlante.org/nobre/tug04/bundle/tug04handout.ps.bz2">TUG04 handout.</a>
+ </td>
+ </tr>
+ <tr>
+ <!-- one of (TD TH) -->
+ <td align="center" valign="top">
+
+ </td>
+ <td align="center">
+
+ </td>
+ <td align="center">
+
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <h4>Thick Lines</h4>
+ <a href="../example/standard/torus.mp">
+ <img src="../nontextualpng/torus.5.png" alt="torus.5.eps">
+ </a>
+ <h4>Vector Fields</h4>
+ <a href="../example/standard/rotatnlc.mp">
+ <img src="../nontextualpng/rotatnlc.1.png" alt="rotatnlc.1.eps">
+ </a>
+ <h4>Volumic Angles and Circles in Space</h4>
+ <a href="../example/standard/anglinerigorouscircle.mp">
+ <img src="../allpng/anglinerigorouscircle.1.gs.png"
+ alt="angline_rigorouscircle.1.eps">
+ </a>
+ <h4>Cones</h4>
+ <a href="../example/standard/rigorouscone.mp">
+ <img src="../nontextualpng/rigorouscone.1.png" alt="rigorouscone.1.eps">
+ </a>
+ <h4>Cylinders and Spherical Distortions</h4>
+ <a href="../example/standard/cylimple.mp">
+ <img src="../nontextualpng/cylimple.1.png" alt="cylimple.1.eps">
+ </a>
+ <h4>Globes</h4>
+ <a href="../example/standard/globe.mp">
+ <img src="../nontextualpng/globe.1.png"
+ alt="globe.1.eps">
+ </a>
+ <h4>Polyhedra</h4>
+ <a href="../example/standard/torus.mp">
+ <img src="../nontextualpng/torus.6.png" alt="torus.6.eps">
+ </a>
+ <h4>Generic Stuff</h4>
+ <a href="../example/standard/stageforthree.mp">
+ <img src="../nontextualpng/stageforthree.2.png"
+ alt="stageforthree.2.eps">
+ </a>
+ <h4>Molecular Structures</h4>
+ <a href="../example/standard/rigorousfearpath.mp">
+ <img src="../nontextualpng/rigorousfearpath.1.png"
+ alt="cubicfacecentered.1.eps">
+ </a>
+ <h4>Surfaces</h4>
+ <a href="../example/standard/triangulartrimesh.mp">
+ <img src="../nontextualpng/triangulartrimesh.1.png"
+ alt="triangulartrimesh.1.eps">
+ </a>
+ <h4>Parametric Surfaces</h4>
+ <p>Kindly contributed by
+ <a href="http://www-ang.kfunigraz.ac.at/~schwaige/">Jens Schwaiger</a>
+ </p>
+ <a href="../example/highmemory/par3Dplotexamples.mp">
+ <img src="../jpeg/par3Dplotexamples1.jpg"
+ alt="par3Dplotexamples.1.eps">
+ </a>
+ <h4>Automatic Perspective Tuning</h4>
+ <a href="../example/standard/photoreverse.mp">
+ <img src="../allpng/photoreverse.1.gs.png"
+ alt="photoreverse.1.eps">
+ </a>
+ <h4>Main Referers</h4>
+ <p>
+ <a href="http://www.tug.org/metapost.html">
+ TUG</a><br>
+ <a href="http://dmoz.org/Computers/Software/Typesetting/TeX/MetaPost/">
+ Open Directory</a><br>
+ <a href="http://www.cs.ucc.ie/~dongen/mpost/links.html">Marc
+ van Dongen</a><br>
+ <a href="http://www-math.univ-poitiers.fr/~phan/m3Dplain.html">
+ Anthony Phan</a><br>
+ <a href="http://asymptote.sourceforge.net/doc/featpost3D.html#featpost3D">
+ Asymptote</a>
+
+
+ </p>
+ </center>
+ <hr size="4">
+ <table>
+ <tbody>
+ <tr>
+ <td>
+ <a href="../../../oldindex.html">
+ <img border="0" src="../png/myicon.png" alt="Home." height="36" width="72">
+ </a>
+ </td>
+ <td align="center" valign="middle">
+ <a href="http://www.xemacs.org">
+ <img align="middle" border="0"
+ src="../jpeg/cbxSmall.jpg"
+ alt="Created by XEmacs."
+ height="36"
+ width="100">
+ </a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <!-- Created: Sun Sep 23 20:33:28 WEST 2001 -->
+ <!-- hhmts start -->
+Last modified: Mon Aug 29 11:22:26 WEST 2005
+<!-- hhmts end --> <br>
+ <br>
+ </body>
+</html>
diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/featpost.1.gz b/Master/texmf-dist/doc/metapost/featpost/doc/featpost.1.gz
new file mode 100644
index 00000000000..a98a55c9d06
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/doc/featpost.1.gz
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/featpost.sgml b/Master/texmf-dist/doc/metapost/featpost/doc/featpost.sgml
new file mode 100644
index 00000000000..5d3ab082321
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/doc/featpost.sgml
@@ -0,0 +1,1623 @@
+<!doctype linuxdoc system>
+<!-- macroMan.sgml
+ L. Nobre G.
+ 2004
+ -->
+<linuxdoc>
+ <article>
+ <titlepag>
+ <title>FEATPOST macros</title>
+ <author>L. Nobre G., <tt>http://matagalatlante.org</tt></name>
+ <date>December 2004</date>
+ <abstract>
+ This document intends to be an explanation of the MetaPost macros
+ defined in the <tt>FEATPOST</tt> package. Its purpose is to draw
+ two or three-dimensional physics diagrams.
+
+ The <tt>FEATPOST</tt> package is supposed to help you draw figures
+ containing 3D dots, vectors, flat arrows, angles, parametric
+ lines, circles, ellipses,
+ cones, cylinders, spheres,
+ globes, hemispheres, toruses,
+ elliptical frusta,
+ polygons, polyhedra, functional and parametric surfaces,
+ direction fields, field lines
+ and trajectories in vector fields,
+ schematic automobiles, electric charges,
+ etc.
+
+ The fact that it is a programming language instead of
+ Computer Aided Design (CAD)
+ helps the user to experiment different
+ figure layouts without changing specified geometric relationships
+ among figure elements.
+
+ Two of the intrinsic MetaPost features which may be important
+ for physics diagrams are: (i) the typesetting power of
+ TeX is easily called when needed and (ii) besides a sufficient
+ number of mathematical operators, geometric relationships may
+ be expressed by linear equations, without explicit assignements.
+ </abstract>
+ </titlepag>
+ <sect>
+ <heading>Introduction</heading>
+ <p>
+ 3D in MetaPost is not a new idea. Denis Roegel
+ contributed related packages to CTAN some years ago. It was the
+ subject of a 1997 TUGboat article (V18, N4, 274-283). Recently
+ he developed <url
+ url="http://www.loria.fr/~roegel/TeX/mousson2005.pdf"
+ name="MP2GL">. Anthony
+ Phan has been developing a very elegant package
+ called <url url="http://www-math.univ-poitiers.fr/~phan/m3Dplain.html" name="m3D">. Due to his skilled coding, <tt>m3D</tt> can
+ handle larger objects and can produce more realistic renderings than
+ <tt>FEATPOST</tt>. Other possibilities include <url
+ url="http://directory.fsf.org/GNU/3DLDF.html" name="GNU
+ 3DLDF">, <url
+ url="http://robert.silve.free.fr/latex/metapost3D/"
+ name="Bob's Info"> or <url
+ url="http://asymptote.sourceforge.net/"
+ name="Asymptote">.
+ In any case we are talking about vector-based abstract diagrams,
+ so the functionality of
+ these packages is nearer to <tt>GNUPLOT</tt> than to <tt>OpenGL</tt>.
+ We could also talk about <tt><url url="http://www.povray.org/" name="POV-ray"></tt> or
+ <tt><url url="http://www.blender3d.org/" name="blender"></tt> but these
+ are focused on ray-traced images, a completely different thing.
+ </p>
+ <p>
+ Regarding software <tt>FEATPOST</tt> requires only MetaPost but
+ recommends <tt>LaTeX, bash, ImageMagick, ghostscript,
+ Linuxdoc, Textutils, dvips, epstopdf, sed, gv, plaympeg, <url url="http://jl.photodex.com/dog/" name="dog">, <url url="http://www.flexer.it/galrey/" name="galrey"></tt> and <tt><url url="http://lince.cii.fc.ul.pt/xcmd/xcmd.html" name="xcmd"></tt>. Also, it is highly beneficial to
+ be able to understand and cope with MetaPost error messages as
+ <tt>FEATPOST</tt> has no protection against mistaken inputs. One
+ probable cause of errors is the use of variables with the name of
+ procedures, like
+ <tscreen><verb>X, Y, Z, N, rp, cb, ps</verb>
+ </tscreen>All other procedure names have six or more characters.
+ </p>
+ <p>
+ The user must be aware that MetaPost has a limited arithmetic power
+ and that the author has limited programming skills,
+ which may lead to unperfect 3D figures, very long processing
+ time or shear bugs.
+ It's advisable not to try very complex diagrams at first
+ and it's recommended to
+ keep 3D coordinates near order 1 (default MetaPost units).
+ </p>
+ <p>
+ All <tt>FEATPOST</tt> macros are build apon the MetaPost
+ <tt>color</tt> variable type. It looks like this:
+ <tscreen><verb>(red,green,blue)</verb>
+ </tscreen>Its components may, nevertheless,
+ be arbtitrary numbers, like:
+ <tscreen><verb>(X,Y,Z)</verb></tscreen>So, the
+ <tt>color</tt> type is adequate to define not only colors but
+ also 3D points and vectors.
+ </p>
+ </sect>
+ <sect>
+ <heading>Small Tutorial</heading>
+ <p>
+ One very minimalistic example program could be:
+ <tscreen><verb>
+beginfig(1);
+ cartaxes(1,1,1);
+endfig;
+end;</verb></tscreen>where <tt>cartaxes</tt> is a
+ <tt>FEATPOST</tt> macro that produces
+ the Cartesian referential.
+ </p>
+ <p>
+ One small example program may be:
+ <tscreen><verb>
+f := 5.4*(1.5,0.5,1);
+Spread := 30;
+beginfig(1);
+ numeric gridstep, sidenumber, i, j, coord, aa, ab, ac;
+ color pa;
+ gridstep = 0.9;
+ sidenumber = 10;
+ coord = 0.5*sidenumber*gridstep;
+ for i=0 upto sidenumber:
+ for j=0 upto sidenumber:
+ pa := (-coord+j*gridstep,-coord+i*gridstep,0);
+ aa := uniformdeviate(360);
+ ab := uniformdeviate(180);
+ ac := uniformdeviate(90);
+ kindofcube( false, false, pa, aa, ab, ac, 0.4, 0.4, 0.9 );
+ endfor;
+ endfor;
+endfig;
+end.</verb></tscreen>where <tt>kindofcube</tt>
+ is a <tt>FEATPOST</tt> macro that produces
+ a rectangular prism (cuboid).
+ </p>
+ <p>
+ <figure>
+ <eps file="../allps/kindofcube.1">
+ <img src="../allpng/kindofcube.1.gs.png">
+ <caption>Example that uses <tt>kindofcube</tt>.</caption>
+ </figure><label id="figkindofcube1">
+ </p>
+ <p>
+ The main variable of any three-dimensional figure is the
+ point of view. <tt>FEATPOST</tt> uses the variable <tt>f</tt>
+ as the point of view. <tt>Spread</tt> is another global
+ variable that controls the size of the projection.
+ </p>
+ <p>
+ Another example may be:
+ <tscreen>
+ <verb>
+f := (13,7,3.5);
+Spread := 35;
+beginfig(1);
+ numeric i, len, wang, reflen, frac, coordg;
+ numeric fws, NumLines, inray, outay;
+ path conepath, cira, cirb, ella, ellb, tuba, tubb, tubc;
+ color axe, aroc, cubevertex, conecenter, conevertex;
+ color allellaxe, ellaaxe, ellbaxe, pca, pea, pcb, peb;
+ frac := 0.5;
+ len := 0.6;
+ wang := 60;
+ axe := (0,cosd(90-wang),sind(90-wang));
+ fws := 4;
+ reflen := 0.2*fws;
+ outay := 0.45*fws;
+ inray := 0.7*outay;
+ coordg := frac*fws;
+ NumLines := 30;
+ HoriZon := -0.5*fws;
+ setthestage( 0.5*NumLines, 2*fws );
+ cubevertex = (0.12*fws,-0.5*fws,-0.5*fws);
+ kindofcube(false,true,cubevertex,180,0,0,0.65*fws,0.2*fws,fws);
+ aroc := outay*(0,cosd(wang),sind(wang))-0.5*(0,fws,fws);
+ rigorousdisc( inray, true, aroc, outay, axe*len );
+ allellaxe := reflen*( 0.707, 0.707, 0 );
+ ellaaxe := reflen*( 0.707, -0.707, 1.0 );
+ ellbaxe := reflen*( -0.707, 0.707, 1.0 );
+ conecenter = ( coordg, coordg, -0.5*fws );
+ pca := ( coordg, -coordg, -0.5*fws );
+ pcb := ( -coordg, coordg, -0.5*fws );
+ pea := ( coordg, -coordg, 0.9*fws );
+ peb := ( -coordg, coordg, 0.9*fws );
+ cira := goodcirclepath( pca, blue, reflen );
+ cirb := goodcirclepath( pcb, blue, reflen );
+ ella := ellipticpath( pea, allellaxe, ellaaxe );
+ ellb := ellipticpath( peb, allellaxe, ellbaxe );
+ tuba := twocyclestogether( cira, ella );
+ tubb := twocyclestogether( cirb, ellb );
+ tubc := twocyclestogether( ella, ellb );
+ unfill tubb; draw tubb;
+ unfill tubc; draw tubc;
+ unfill tuba; draw tuba;
+ conevertex = conecenter + ( -3.5*reflen, 0, 0.8*fws );
+ verygoodcone(false,conecenter,blue,reflen,conevertex);
+endfig;
+end.</verb></tscreen>where we find a <tt>rigorousdisc</tt>
+ and a <tt>verygoodcone</tt>
+ (the nicest <tt>FEATPOST</tt> macros) in addition to
+ <tt>setthestage</tt>, <tt>twocyclestogether</tt> and
+ <tt>kindofcube</tt>.
+ </p>
+ <p>
+ <figure>
+ <eps file="../allps/stageforthree.1">
+ <img src="../allpng/stageforthree.1.gs.png">
+ <caption>Example that uses <tt>rigorousdisc</tt> and
+ <tt>verygoodcone</tt>.</caption>
+ </figure><label id="figstageforthree">
+ </p>
+ <sect1>
+ <heading>Mechanics</heading>
+ <p>
+ The following is the sequence of steps necessary to produce
+ the diagrams.
+ <enum>
+ <item>There are two methods that one can use to instruct
+ MetaPost to process the TeX parts of the input file with
+ LaTeX instead of plain TeX. One is to put a first
+ line containing just <code>%&latex</code> in
+ the file. This is the simplest method, but it doesn't
+ work on all systems. Alternately, you can set the
+ environment variable <tt>TEX</tt> to "<tt>latex</tt>",
+ like: <code>export TEX=latex</code> or run
+ <tt>mpost</tt> with a command-line option, like:
+ <code>mpost --tex=latex myfile.mp</code> (this text was
+ originally written by Brooks Moses)
+ </item>
+ <item>
+ Make your MetaPost program know <tt>FEATPOST</tt> macros.
+ This may be accomplished in two ways:
+ <itemize>
+ <item>
+ Insert the line:
+ <tscreen><verb>input featpost3Dplus2D;</verb></tscreen>at
+ the beginning
+ of your program and
+ then enter the shell command
+ <code>mpost yourprogram.mp</code> or
+ </item>
+ <item>
+ Pre-compile the macros into a <tt>mem</tt> file,
+ for instance:
+ <code>mpost -ini featpost</code> and then run your
+ program with
+ <code>mpost -mem featpost yourprogram.mp</code>
+ </item>
+ </itemize>
+ </item>
+ <item>
+ If your program contains LaTeX text you may insert, at the
+ beginning, the lines
+ <tscreen><verb>
+verbatimtex
+\documentclass{article}
+\begin{document}
+etex</verb></tscreen>and at the end
+ <tscreen><verb>
+verbatimtex
+\end{document}
+etex</verb></tscreen>or make use of the
+<url url="http://www.ctan.org/tex-archive/graphics/metapost/contrib/macros/latexmp/" name="latexmp"> package.</item>
+ <item>
+ Pass the produced figure(s) through <tt>dvips</tt>
+ if they contain any text. You may do this with the provided
+ shell script <tt>laproof</tt>.
+ <code>laproof yourprogram N</code> where <tt>N</tt>
+ is the figure number. This
+ script produces an EPS figure that may be viewed with
+ <tt>gv</tt> but that should not be inserted in LaTeX
+ documents. Insert the original figure in LaTeX
+ documents. Instead of <tt>laproof</tt> you may just as
+ well use <url
+ url="http://www.ida.liu.se/~joned/download/mps2eps/"
+ name="MPS2EPS"> or <url
+ url="http://www.iee.et.tu-dresden.de/~fimmel/metapost.html" name="metapost.pl">.
+ </item>
+ </enum>
+ </p>
+ </sect1>
+ <sect1>
+ <heading>Main Features</heading>
+ <sect2>
+ <heading>Perspectives</heading>
+ <p>
+ <tt>FEATPOST</tt> can do three kinds of perspective.
+ <tscreen>
+ <verb>
+f := ( 1.2 , 2.0 , 1.6 );
+Spread := 75;
+
+V1 := (1,1,1);
+V2 := (-1,1,1);
+V3 := (-1,-1,1);
+V4 := (1,-1,1);
+V5 := (1,1,-1);
+V6 := (-1,1,-1);
+V7 := (-1,-1,-1);
+V8 := (1,-1,-1);
+makeface1(1,2,3,4);makeface2(5,6,7,8);
+makeface3(1,2,6,5);makeface4(2,3,7,6);
+makeface5(3,4,8,7);makeface6(4,1,5,8);
+makeline1(1,7);makeline2(2,8);
+makeline3(3,5);makeline4(4,6);
+
+beginfig(1);
+ ParallelProj := true;
+ SphericalDistortion := false;
+ draw_all_test(red,true);
+endfig;
+
+beginfig(2);
+ ParallelProj := false;
+ SphericalDistortion := false;
+ draw_all_test(green,true);
+endfig;
+
+beginfig(3);
+ ParallelProj := false;
+ SphericalDistortion := true;
+ PrintStep := 5;
+ draw_all_test(blue,true);
+endfig;
+
+end;</verb>
+ </tscreen>
+ </p>
+ <p>
+ <figure>
+ <eps file="../allps/cubicfigures.1">
+ <img src="../allpng/cubicfigures.1.gs.png">
+ <caption>Orthogonal perspective.</caption>
+ </figure><label id="figcubicfigures1">
+ </p>
+ <p>
+ <figure>
+ <eps file="../allps/cubicfigures.2">
+ <img src="../allpng/cubicfigures.2.gs.png">
+ <caption>Rigorous perspective.</caption>
+ </figure><label id="figcubicfigures2">
+ </p>
+ <p>
+ <figure>
+ <eps file="../allps/cubicfigures.3">
+ <img src="../allpng/cubicfigures.3.gs.png">
+ <caption>Fish-eye perspective.</caption>
+ </figure><label id="figcubicfigures3">
+ </p>
+ </sect2>
+ <sect2>
+ <heading>From 3D to 2D</heading>
+ <p>
+ The most important macro is <tt>rp</tt> that converts 3D points
+ to two-dimensional (2D) rigorous, orthogonal
+ or fish-eye projections. To draw a line in
+ 3D-space try
+ <tscreen><verb>draw rp(a)--rp(b);</verb></tscreen>where
+ <tt>a</tt> and <tt>b</tt> are points in space
+ (of <tt>color</tt> type).
+ But if you're going for fish-eye it's better to
+ <tscreen><verb>draw pathofstraightline(a,b);</verb></tscreen>If
+ you don't know, leave it as
+ <tscreen><verb>drawsegment(a,b);</verb></tscreen>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Angles</heading>
+ <p>
+ When <tt>FEATPOST</tt> was created its main ability was
+ to mark and to calculate angles. This is done with the
+ macros <tt>angline</tt> and <tt>getangle</tt> as in the
+ following program:
+ <tscreen>
+ <verb>
+f := (5,3.5,1);
+beginfig(2);
+ cartaxes(1,1,1);
+ color va, vb, vc, vd;
+ va = (0.29,0.7,1.0);
+ vb = (X(va),Y(va),0);
+ vc = N((-Y(va),X(va),0));
+ vd = (0,Y(vc),0);
+ drawarrow rp(black)--rp(va);
+ draw rp(black)--rp(vb)--rp(va) dashed evenly;
+ draw rp(vc)--rp(vd) dashed evenly;
+ drawarrow rp(black)--rp(vc);
+ squareangline( va, vc, black, 0.15 );
+ angline(va,red,black,0.75,decimal getangle(va,red),lft);
+endfig;</verb>
+ </tscreen><figure>
+ <eps file="../allps/cartaxes.2">
+ <img src="../allpng/cartaxes.2.gs.png">
+ <caption>Example that uses <tt>cartaxes</tt>,
+ <tt>angline</tt> and <tt>getangle</tt>.</caption>
+ </figure><label id="figcartaxes2">
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Intersections</heading>
+ <p>
+ The most advanced feature of <tt>FEATPOST</tt> is the
+ ability to calculate the intersections of planar and
+ convex polygons<footnote>Unfortunately, this is also the
+ most "bugged" feature.</footnote>. It can draw the visible
+ part of arbitrary sets of polygons as in
+ the following program:
+ <tscreen>
+ <verb>
+numeric phi;
+phi = 0.5*(1+sqrt(5));
+V1 := ( 1, phi,0);V2 := (-1, phi,0);
+V3 := (-1,-phi,0);V4 := ( 1,-phi,0);
+V5 := (0, 1, phi);V6 := (0,-1, phi);
+V7 := (0,-1,-phi);V8 := (0, 1,-phi);
+V9 := ( phi,0, 1);V10:= ( phi,0,-1);
+V11:= (-phi,0,-1);V12:= (-phi,0, 1);
+makeface1(1,2,3,4);makeface2(5,6,7,8);
+makeface3(9,10,11,12);
+beginfig(1);
+ sharpraytrace;
+endfig;
+end</verb></tscreen>
+ </p>
+ <p>
+ <figure>
+ <eps file="../allps/sharpraytrace.1">
+ <img src="../allpng/sharpraytrace.1.gs.png">
+ <caption>Example that uses <tt>sharpraytrace</tt>.</caption>
+ </figure><label id="figsharpraytrace">
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Coming back to 3D from 2D</heading>
+ <p>
+ It is now possible to do an "automatic perspective tuning"
+ with the aid of macro <tt>photoreverse</tt> which is under
+ development. Please, refer to example
+ <tt>photoreverse.mp</tt> and to <url url="http://matagalatlante.org/nobre/hyt/technicaldrawfromphoto.html" name="FeatPost Deeper Technicalities">.
+ </p>
+ <p>
+ <figure>
+ <eps file="../alleps/photoreverse.1.eps">
+ <img src="../allpng/photoreverse.1.gs.png">
+ <caption>Example that uses <tt>photoreverse</tt>. It may
+ not work when vertical lines are not vertical in
+ average on the photo.</caption>
+ </figure><label id="figphotoreverse">
+ </p>
+ <sect3>
+ <heading>Coming back to 3D from 1D</heading>
+ <p>
+ Using the same algorithm of <tt>photoreverse</tt>, the
+ macro <tt>improvertex</tt> allows one to approximate a
+ point in 3D-space with given distances from three other
+ points (an initial guess is required).
+ </p>
+ </sect3>
+ </sect2>
+ </sect1>
+ </sect>
+ <sect>
+ <heading>Reference Manual</heading>
+ <p>
+ Some words about notation.
+ The meaning of macro, function, procedure and routine is the same.
+ Global variables are presented like this:
+ <tscreen>
+ <verb>
+vartype var, anothervar
+anothervartype yetanothervar</verb>
+ </tscreen>Explanation of var, anothervar and
+ yetanothervar. vartype can be any one of
+ MetaPost types but the meaning
+ of <tt>color</tt> is a three-dimensional point or vector, not an
+ actual color like yellow, black or white. If the meaning is
+ an actual color then the type will be <tt>colour</tt>.
+ All global variables have default values.
+ </p>
+ <p>
+ Functions are presented like this:
+ <itemize>
+ <item>returntype <bf>function()</bf>
+ Explanation of function. returntype can be any one of MetaPost
+ types plus global, draw or drawlabel.
+ global means that the function
+ changes some of the global variables. draw means that
+ the function
+ changes the currentpicture. drawlabel means that the
+ function changes
+ the currentpicture and adds text to it.
+ <enum>
+ <item> <tt>type1</tt>
+ Explanation of the first argument. The type of
+ one argument can be any one
+ of MetaPost types plus <tt>suffix</tt> or
+ <tt>text</tt>.</item>
+ <item> <tt>type2</tt>
+ Explanation of the second argument.
+ There is the possibility that the
+ function has no arguments. In that case the
+ function is presented like
+ "returntype <bf>function</bf>".</item>
+ <item> Etc.</item>
+ </enum>
+ </item>
+ </itemize>
+ </p>
+ <sect1>
+ <heading>Global variables</heading>
+ <p>
+ <tscreen>
+ <verb>
+boolean ParallelProj
+boolean SphericalDistortion</verb>
+ </tscreen>Kind of projection calculated by <tt>rp</tt>.
+ By default projections
+ are rigorous but if <tt>ParallelProj</tt> is set
+ <tt>true</tt> then
+ parallel lines remain parallel in the projection.
+ It is the same as
+ placing the point of view infinitely far without loosing
+ sight.
+ If <tt>SphericalDistortion</tt> is set <tt>true</tt>
+ there will be a
+ distortion coming from: (i) the projection being done
+ on a sphere of
+ center <tt>f</tt> and (ii) this sphere being plaited
+ onto the paper page.
+ </p>
+ <p>
+ <figure>
+ <eps file="../allps/rigorousdiscSD.1">
+ <img src="../allpng/rigorousdiscSD.1.gs.png">
+ <caption>Figure that uses <tt>SphericalDistortion:=true</tt>
+ and <tt>rigorousdisc</tt>.</caption>
+ </figure><label id="sphericaldisc">
+ </p>
+ <p>
+ <tscreen>
+ <verb>
+color f, viewcentr</verb>
+ </tscreen>The point of view is <tt>f</tt>. The plane or sphere
+ of projection contains
+ the center of view <tt>viewcentr</tt>.
+ The axis parallel to zz that contains the
+ <tt>viewcentr</tt> is projected on a vertical line.
+ <tscreen>
+ <verb>
+numeric Spread
+pair ShiftV, OriginProjPagePos
+numeric PageWidth
+numeric PageHeight</verb>
+ </tscreen>These variables control
+ the placement of the projection on the
+ paper. <tt>Spread</tt> is the magnification
+ and <tt>ShiftV</tt> is the position of the
+ <tt>viewcentr</tt> projection on the
+ paper. But, if at some point in your program you introduce
+ <tt>produce_auto_scale</tt> then the
+ <tt>currentpicture</tt> will be
+ centered at <tt>OriginProjPagePos</tt>
+ and scaled to fit inside a rectangle of
+ <tt>PageWidth</tt> by <tt>PageHeight</tt>.
+ <tscreen>
+ <verb>
+color V[]
+color L[]p[]
+color F[]p[]</verb>
+ </tscreen>Vertexes, lines and faces.
+ The idea here is to draw
+ polygons and/or arbitrary lines in 3D space.
+ Defining the polygons and
+ the lines can be a bit tedious as <tt>FEATPOST</tt> is not
+ interactive. First, one defines a list of the
+ vertexes (<tt>V[]</tt>) that define the
+ polygons and/or the lines.
+ There is a list of polygons and a list of
+ lines. Each polygon (<tt>F[]p[]</tt>) or
+ line (<tt>L[]p[]</tt>) is itself a list of vertexes.
+ All vertexes of the same poligon should belong
+ to the same plane.
+ <tscreen>
+ <verb>
+numeric NL
+numeric npl[]
+numeric NF
+numeric npf[]</verb>
+ </tscreen>Number of lines, number of vertexes of each line,
+ number of faces, number of vertexes of each face.
+ <tscreen>
+ <verb>
+numeric PrintStep</verb>
+ </tscreen>
+ <tt>Printstep</tt> is the size of iterative jumps
+ along lines. Used by
+ <tt>lineraytrace</tt>, <tt>faceraytrace</tt> and
+ <tt>pathofstraightline</tt>.
+ Big <tt>Printstep</tt>s make fast raytracings.
+ <tscreen>
+ <verb>
+boolean FCD[]
+colour TableC[]
+numeric TableColors
+numeric FC[]
+colour HigColor
+colour SubColor
+color LightSource</verb>
+ </tscreen><tt>FCD</tt> means "face color defined". The
+ <tt>draw_invisible</tt> macro draws
+ polygons in colour, if it is defined. The colour must be
+ selected from the table of colours <tt>TableC</tt> that has
+ as many as <tt>TableColors</tt>. The colour <tt>FC</tt>
+ of each polygon will depend on its position relatively to
+ <tt>LightSource</tt> where we suppose there is a lamp that
+ emits light coloured <tt>HigColor</tt>. Furthermore the
+ colour of each polygon may be modified if it belongs to a
+ functional or parametric surface. In this case, if we are
+ looking at the polygon from below than <tt>SubColor</tt> is
+ subtracted from its colour.
+ <tscreen>
+ <verb>
+numeric RopeColorSeq[]
+numeric RopeColors</verb>
+ </tscreen>
+ These are used by <tt>ropepattern</tt>.
+ <tscreen>
+ <verb>
+numeric TDAtiplen
+numeric TDAhalftipbase
+numeric TDAhalfthick</verb>
+ </tscreen>
+ These control the shape of Three-Dimensional Arrows.
+ <tscreen>
+ <verb>
+boolean ShadowOn
+numeric HoriZon</verb>
+ </tscreen>
+ When <tt>ShadowOn</tt> is set <tt>true</tt>, some objects can
+ cast a black shadow on a horizontal plane of <tt>Z</tt>
+ coordinate equal to <tt>HoriZon</tt> (an area from
+ this plane may be drawn with <tt>setthestage</tt>) as if
+ there is a punctual source of light at
+ <tt>LightSource</tt>.
+ The macros that can produce shadows, in addition to their
+ specific production, are<itemize>
+ <item><tt>emptyline</tt></item>
+ <item><tt>rigorousdisc</tt></item>
+ <item><tt>verygoodcone</tt></item>
+ <item><tt>tropicalglobe</tt></item>
+ <item><tt>whatisthis</tt></item>
+ <item><tt>kindofcube</tt></item>
+ <item><tt>draw_all_test</tt></item>
+ <item><tt>fill_faces</tt></item>
+ <item><tt>positivecharge</tt></item>
+ </itemize>
+ All macros that contain <bf>shadow</bf> in their name
+ calculate the location of shadows (using <tt>cb</tt>).
+ <tscreen>
+ <verb>
+path VGAborder</verb>
+ </tscreen>
+ This path and the macro <tt>produce_vga_border</tt> are
+ meant to help you clip the <tt>currentpicture</tt> to a 4:3
+ rectangle as in a movie frame.
+ <tscreen>
+ <verb>
+pair PhotoPair[]
+color PhotoPoint[]
+numeric PhotoMarks</verb>
+ </tscreen>
+ These are used by <tt>photoreverse</tt>.
+ <tscreen>
+ <verb>
+pen ForePen, BackPen
+path CLPath
+numeric NCL</verb>
+ </tscreen>
+ These are used by <tt>closedline</tt>.
+ </p>
+ </sect1>
+ <sect1>
+ <heading>Definitions</heading>
+ <p>
+ <itemize>
+ <item>global makeline@&num;( text1)</item>
+ <item>global makeface@&num;( text1)</item>
+ </itemize>
+ Both of these functions ease the task of
+ defining lines and polygons. Just
+ provide a list of vertexes in the right
+ sequence for each polygon and/or
+ line. Suppose a tetrahedron
+ <tscreen><verb>
+V3:=(+1,-1,-1);V2:=(-1,+1,-1);
+V4:=(+1,+1,+1);V1:=(-1,-1,+1);
+makeface2(1,2,3);makeface3(1,2,4);
+makeface1(3,4,1);makeface4(3,4,2);</verb></tscreen>The
+ number in the last makeface or last
+ makeline procedure name must be the
+ number of polygons or lines. All polygons and lines from 1 upto this
+ number must be defined but the sorting may be any of your liking.
+ </p>
+ </sect1>
+ <sect1>
+ <heading>Macros</heading>
+ <sect2>
+ <heading>Very Basic Macros</heading>
+ <p>
+ <itemize>
+ <item>numeric <bf>X()</bf>
+ Returns the first coordinate of a point or vector (of
+ color type). Replaces <tt>redpart</tt>.
+ </item>
+ <item>numeric <bf>Y()</bf>
+ Returns the second coordinate of a point or vector.
+ Replaces <tt>greenpart</tt>.
+ </item>
+ <item>numeric <bf>Z()</bf>
+ Returns the second coordinate of a point or vector.
+ Replaces <tt>bluepart</tt>.
+ </item>
+ <item>draw <bf>produce_auto_scale</bf>
+ The currentpicture is centered in, and adjusted
+ to the size of, an A4
+ paper page. This avoids the control of <tt>Spread</tt> and
+ <tt>ShiftV</tt>.
+ </item>
+ <item>string <bf>cstr()</bf> Converts a color into its
+ string. Usefull in combination with <tt>getready</tt>.
+ </item>
+ <item>string <bf>bstr()</bf> Converts a boolean
+ expression into its
+ string. Usefull in combination with <tt>getready</tt>.
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Vector Calculus</heading>
+ <p>
+ <itemize>
+ <item>color <bf>N()</bf> Unit vector. Returns
+ <tt>black</tt> (the null vector) when the argument has
+ null norm. The "N" means "normalized".</item>
+ <item>numeric <bf>cdotprod()</bf> Dot product of two
+ vectors.</item>
+ <item>color <bf>ccrossprod()</bf> Cross product of two
+ vectors.</item>
+ <item>numeric <bf>ndotprod()</bf> Cossine of the angle
+ beetween two vectors.</item>
+ <item>color <bf>ncrossprod()</bf> Normalized cross product
+ of twovectors.</item>
+ <item>numeric <bf>conorm()</bf> Euclidean norm of a
+ vector.</item>
+ <item>numeric <bf>getangle()</bf> Angle beetween two
+ vectors.</item>
+ <item>pair <bf>getanglepair()</bf> Orientation angles
+ of a vector. The first angle (<tt>xpart</tt>) is
+ measured beetween the vector projection on the <tt>XY</tt>
+ plane and the <tt>X</tt> axis. The second angle
+ (<tt>ypart</tt>)is measured
+ beetween the vector and its projection on the <tt>XY</tt>
+ plane. This may be usefull to find the arguments of
+ <tt>kindofcube</tt></item>
+ <item>color <bf>eulerrotation()</bf> Three-dimensional
+ rotation of a vector. See the figure explaining
+ <tt>kindofcube</tt> to visualize the following
+ movement: (i) grab the <tt>X</tt> component of the
+ vector; (ii) rotate it on the <tt>XY</tt> plane as
+ much as the first argument;
+ (iii) raise it up as much as the second argument; and
+ (iv) turn it around as much as the third argument.
+ <enum>
+ <item><tt>numeric</tt> Angle of rotation around the
+ <tt>Z</tt> component.</item>
+ <item><tt>numeric</tt> Angle of rotation around the
+ rotated <tt>Y</tt> component.</item>
+ <item><tt>numeric</tt> Angle of rotation around the
+ two times rotated <tt>X</tt> component.</item>
+ <item><tt>color</tt> Vector to be rotated.</item>
+ </enum>
+ </item>
+ <item>color <bf>randomfear</bf> Generates a randomly
+ oriented unit vector.
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Projection Macros</heading>
+ <p>
+ <itemize>
+ <item>pair <bf>rp()</bf> Converts spatial positions into
+ planar positions on the paper page. The conversion
+ considers the values of the following global
+ variables: <tt>viewcentr</tt>,
+ <tt>ParallelProj</tt>, <tt>SphericalDistortion</tt>,
+ <tt>Spread</tt> and <tt>ShiftV</tt>. When both
+ <tt>ParallelProj</tt> and <tt>SphericalDistortion</tt>
+ are <tt>false</tt> it won't work if either (i) the
+ vectors <tt>f-viewcentr</tt> and <tt>f-R</tt> are
+ perpendicular (<tt>R</tt> is the argument) or (ii)
+ <tt>f</tt> and <tt>viewcentr</tt> share the same
+ <tt>X</tt> and <tt>Y</tt> coordinates. <enum>
+ <item><tt>color</tt> Spatial position.</item>
+ </enum>
+ </item>
+ <item>color <bf>cb()</bf> Calculates the position of the
+ shadow of a point. Uses <tt>HoriZon</tt> and
+ <tt>LightSource</tt>.
+ <enum>
+ <item><tt>color</tt> Point position.</item>
+ </enum>
+ </item>
+ <item>color <bf>projectpoint()</bf> Calculates the
+ intersection beetween a plane and a straight
+ line. The plane contains a given point and is
+ perpendicular to the line connecting the
+ <tt>LightSource</tt> and this same point.
+ The line is defined by another given point and the
+ <tt>LightSource</tt>. Summary: <tt>projectpoint</tt>
+ returns the projection of the second argument on a
+ plane that contains the first argument. Can be used to
+ draw shadows cast on generic planes.
+ <enum>
+ <item><tt>color</tt> Origin of the projection plane.</item>
+ <item><tt>color</tt> Point to be projected.</item>
+ </enum>
+ </item>
+ <item>color <bf>lineintersectplan()</bf> Calculates the
+ intersection beetween a generic plane and a straight
+ line. The plane contains a given point and is
+ perpendicular to a given vector.
+ The line contains a given point and is parallel to
+ a given vector.
+ <enum>
+ <item><tt>color</tt> Point of the line.</item>
+ <item><tt>color</tt> Vector parallel to the line.</item>
+ <item><tt>color</tt> Point of the projection plane.</item>
+ <item><tt>color</tt> Vector perpendicular to the
+ projection plane.</item>
+ </enum>
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Plain Basic Macros</heading>
+ <p>
+ <itemize>
+ <item>draw <bf>signalvertex()</bf> Draws a dot
+ sized inversely proportional to its distance from
+ the viewpoint <tt>f</tt>.
+ <enum>
+ <item><tt>color</tt> Location.</item>
+ <item><tt>numeric</tt> Factor of proportionality
+ ("size of the dot").</item>
+ <item><tt>colour</tt> Colour of the dot.</item>
+ </enum>
+ <figure>
+ <eps file="../allps/torus.1">
+ <img src="../allpng/torus.1.gs.png">
+ <caption>Figure that uses <tt>signalvertex</tt>.</caption>
+ </figure>
+ </item>
+ <item>path <bf>pathofstraightline()</bf> When using
+ <tt>SphericalDistortion:=true</tt>, straight lines
+ look like curves. This macro returns the curved path
+ of a straight line beetween two points. This path will
+ have a greater <tt>length</tt> ("time") when
+ <tt>PrintStep</tt> is made smaller.</item>
+ <item>draw <bf>drawsegment()</bf> Alternative
+ <tt>pathofstraightline</tt> that avoids the
+ calculation of all the intermediate points when
+ <tt>SphericalDistortion:=false</tt>.
+ <item>drawlabel <bf>cartaxes()</bf>
+ Cartesean axis with prescribed lenghtes and apropriate labels.
+ <enum>
+ <item><tt>numeric</tt> Length of the <tt>X</tt> axis.</item>
+ <item><tt>numeric</tt> Length of the <tt>Y</tt> axis.</item>
+ <item><tt>numeric</tt> Length of the <tt>Z</tt> axis.</item>
+ </enum>
+ </item>
+ <item>draw <bf>emptyline()</bf> This procedure produces
+ a sort of a tube that can cross over itself. It
+ facilitates the drawing of, for instance, thick
+ helical curves but it won't
+ look right if the curves are drawn getting apart from
+ the point of view. Please, accept this inconveniance.
+ As like many other <tt>FEATPOST</tt> macros this one
+ can produce visually correct diagrams only in limited
+ conditions. Can cast a shadow.
+ <enum>
+ <item><tt>boolean</tt> Choose <tt>true</tt> to join
+ this line with a previously drawn line.</item>
+ <item><tt>numeric</tt> Factor of proportionality
+ ("diameter of the tube"). The tubes are just
+ sequences of dots drawn by <tt>signalvertex</tt>.</item>
+ <item><tt>colour</tt> Colour of the tube border.</item>
+ <item><tt>colour</tt> Colour of the tube.</item>
+ <item><tt>numeric</tt> Total number of dots on the
+ tube line.</item>
+ <item><tt>numeric</tt> Fraction of the tube diameter
+ that is drawn with the tube colour.</item>
+ <item><tt>numeric</tt> This is the number of dots
+ that are redrawn with the colour of the tube for
+ each drawn dot with the color of the tube
+ border. Usually 1 or 2 are enough.</item>
+ <item><tt>text</tt> This is the name a function
+ that returns a 3D point of the line for each value
+ of a parameter in beetween 0 and 1.
+ </item>
+ </enum>
+ <figure>
+ <eps file="../allps/joinedemptylines.1">
+ <img src="../allpng/joinedemptylines.1.gs.png">
+ <caption>Figure that uses <tt>emptyline</tt>.
+ The junction point of two different lines is indicated
+ by an arrow. Note the unperfection on the top
+ right, inside the upper turn. </caption>
+ </figure><label id="joinedemptylines">
+ </item>
+ <item>draw <bf>closedline()</bf> This procedure produces
+ a tube that can cross over itself. It
+ facilitates the drawing of, for instance, thick
+ helical curves but it won't
+ look right as its thickness does not change with the
+ distance from the point of view. The drawing is
+ entirely done in two dimensions, so the tube diameter
+ depends on the global variables <tt>ForePen</tt> and
+ <tt>BackPen</tt>. There can be more than one
+ line in a figure but all get the same diameter.
+ When calling <tt>closedline()</tt> in different
+ figures of the same program you must reinitialize both
+ <tt>NCL</tt> and <tt>Nobjects</tt> (because
+ <tt>closedline()</tt> uses <tt>getready()</tt>).
+ <enum>
+ <item><tt>boolean</tt> Value of "the line is closed".
+ </item>
+ <item><tt>numeric</tt> Total number of path segments
+ on the tube line.</item>
+ <item><tt>numeric</tt> Use 0.5 or more.</item>
+ <item><tt>numeric</tt> Use 0.75 or more.</item>
+ <item><tt>text</tt> This is the name of a function
+ that returns a 3D point of the line for each value
+ of a parameter in beetween 0 and 1.
+ </item>
+ </enum>
+ </item>
+ <item>drawlabel <bf>angline()</bf>
+ Draws an arch beetween two straight lines with a
+ common point and places a label
+ near the middle of the arch (marks an
+ angle). Note that the arch is not circular.
+ <enum>
+ <item><tt>color</tt> Point of one line.</item>
+ <item><tt>color</tt> Point ot the other line.</item>
+ <item><tt>color</tt> Common point.</item>
+ <item><tt>numeric</tt> Distance beetween the arch and
+ the common point.</item>
+ <item><tt>picture</tt> Label.</item>
+ <item><tt>suffix</tt> Position of the label relatively
+ to the middle of the arch. May
+ be one of <tt>lft, rt, top, bot, ulft, urt,
+ llft</tt> and <tt>lrt</tt>.</item>
+ </enum>
+ </item>
+ <item>drawlabel <bf>anglinen()</bf>
+ The same as the previous function but the
+ sixth argument is numeric:
+ 0=<tt>rt</tt>;
+ 1=<tt>urt</tt>;
+ 2=<tt>top</tt>;
+ 3=<tt>ulft</tt>;
+ 4=<tt>lft</tt>;
+ 5=<tt>llft</tt>;
+ 6=<tt>bot</tt>;
+ 7=<tt>lrt</tt>;
+ any other number places the label
+ on the middle of the arch.</item>
+ <item>draw <bf>squareangline()</bf>
+ This is supposed to mark 90 degree angles
+ but works for any angle value.
+ <enum>
+ <item><tt>color</tt> Point of one line.</item>
+ <item><tt>color</tt> Point ot the other line.</item>
+ <item><tt>color</tt> Common point.</item>
+ <item><tt>numeric</tt> Distance beetween the "arch"
+ and the common point.</item>
+ </enum>
+ </item>
+ <item>path <bf>rigorouscircle()</bf>
+ 3D circle. The total "time" of this path is 8. This
+ small number makes it easy to select parts of the
+ path. The circle is drawn using the
+ "left-hand-rule". If you put your left-hand thumb
+ parallel the circle axis then the other left-hand
+ fingers curl in the same sense as the circle
+ path. This path allways starts, approching the view
+ point, from a point on a diameter of the
+ circle that projects orthogonaly to its axis, and
+ rotating around the axis in the way of the left-hand-rule.
+ <enum>
+ <item><tt>color</tt> Center of the circle.</item>
+ <item><tt>color</tt> Direction orthogonal to the
+ circle (circle axis).</item>
+ <item><tt>numeric</tt> Radius of the circle.</item>
+ </enum>
+ <figure>
+ <eps file="../allps/anglinerigorouscircle.1">
+ <img src="../allpng/anglinerigorouscircle.1.gs.png">
+ <caption>Figure that uses <tt>anglinen</tt>
+ and <tt>rigorouscircle</tt>.</caption>
+ </figure>
+ </item>
+ <item>draw <bf>tdarrow()</bf> Draws a flat arrow that
+ begins at the first argument and ends at the second.
+ The shape of the arrow is controled by the global
+ variables <tt>TDAtiplen, TDAhalftipbase, TDAhalfthick</tt>.
+ </item>
+ <item>path <bf>twocyclestogether()</bf> This macro
+ allows you to draw any solid that has no vertexes
+ and that has two, exactly two, planar cyclic edges.
+ In fact, it doesn't need to be a solid. Just
+ provide the pathes of both cyclic edges as arguments
+ but note that the returned path is polygonal.
+ In order to complete
+ the drawing of this solid you have to choose one of
+ the edges to be drawn immediatly afterwards. This is
+ done automatically by the <tt>whatisthis</tt> macro
+ for the case of two parallel and concentric ellipses.
+ </item>
+ <item>path <bf>ellipticpath()</bf> Produces an elliptic
+ path in 3D space.
+ <enum>
+ <item><tt>color</tt> Position of the center.</item>
+ <item><tt>color</tt> Major or minor axis.</item>
+ <item><tt>color</tt> The other axis.</item>
+ </enum>
+ </item>
+ <item>drawlabel <bf>labelinspace()</bf> Draw some 2D
+ <tt>picture</tt> on some 3D plane (only when
+ <tt>ParallelProj:=true</tt>).
+ <enum>
+ <item><tt>color</tt> Position for the lower-left
+ corner. </item>
+ <item><tt>color</tt> Orientation of the picture's
+ bottom edge.</item>
+ <item><tt>color</tt> Orientation of the picture's
+ letf edge.</item>
+ <item><tt>text</tt> 2D picture's name.</item>
+ </enum>
+ <figure>
+ <eps file="../allps/labelinspace.1">
+ <img src="../allpng/labelinspace.1.gs.png">
+ <caption>Example that uses <tt>labelinspace</tt>.</caption>
+ </figure>
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Standard Objects</heading>
+ <p>
+ <itemize>
+ <item>path <bf>goodcirclepath()</bf>
+ Another 3D circle macro. More rigorous
+ than <tt>rigorouscircle</tt> but when
+ the direction ortogonal to the circle is almost
+ orthogonal to the line <tt>viewpoint--center</tt>
+ it doesn't work correctly.
+ The total "time" of this path is 36.
+ <enum>
+ <item><tt>color</tt> Center of the circle.</item>
+ <item><tt>color</tt> Direction ortogonal to
+ the circle.</item>
+ <item><tt>numeric</tt> Radius of the
+ circle.</item>
+ </enum>
+ </item>
+ <item>draw <bf>spatialhalfsfear()</bf> An
+ hemisphere. Doesn't work with <tt>f</tt> inside it.
+ <enum>
+ <item><tt>color</tt> Center.</item>
+ <item><tt>color</tt> Vector ortogonal to
+ the frontier circle and pointing
+ out of the concavity.</item>
+ <item><tt>numeric</tt> Radius of the
+ (hemi)sphere.</item>
+ </enum>
+ </item>
+ <item>path <bf>spatialhalfcircle()</bf>
+ And yet another 3D circle macro. Only the visible or the hidden
+ part. This is usefull to mark sections of
+ cylinders or spherical major circles.
+ <enum>
+ <item><tt>color</tt> Center of the circle.</item>
+ <item><tt>color</tt> Direction ortogonal to the
+ circle.</item>
+ <item><tt>numeric</tt> Radius of the circle.</item>
+ <item><tt>boolean</tt> The visible part is selected with
+ <tt>true</tt> and the hidden
+ with <tt>false</tt>.</item>
+ </enum>
+ </item>
+ <item>draw <bf>rigorousdisc()</bf>
+ 3D opaque cylinder with/without a hole. Can cast a
+ shadow (without the hole).
+ <enum>
+ <item><tt>numeric</tt> Ray of an axial hole.</item>
+ <item><tt>boolean</tt> Option for completly opaque cylinder
+ (<tt>true</tt>) or partial
+ pipe (<tt>false</tt>) when there is no hole. When
+ the cylinder has an hole this option should be
+ <tt>true</tt>.</item>
+ <item><tt>color</tt> Center of one circular base.</item>
+ <item><tt>numeric</tt> Radius of both circular bases.</item>
+ <item><tt>color</tt> Vector that defines the length and
+ orientation of the
+ cylinder. The addition the third and fifth
+ arguments should give the
+ position of the center of the other circular base.
+ </item>
+ </enum>
+ </item>
+ <item>draw <bf>verygoodcone()</bf> 3D cone. Can cast a shadow.
+ <enum>
+ <item><tt>bolean</tt> Option to draw dashed evenly
+ the invisible edge (<tt>true</tt>) or not
+ (<tt>false</tt>).</item>
+ <item><tt>color</tt> Center of the circular base.</item>
+ <item><tt>color</tt> Direction ortogonal to the
+ circular base.</item>
+ <item><tt>numeric</tt> Radius of the circular base.</item>
+ <item><tt>color</tt> Position of the vertex</item>
+ </enum>
+ </item>
+ <item>path <bf>rigorousfearpath()</bf>
+ 3D sphere. Simple but hard.
+ <enum>
+ <item><tt>color</tt> Center position.</item>
+ <item><tt>numeric</tt> Radius.</item>
+ </enum>
+ </item>
+ <item>draw <bf>tropicalglobe()</bf> Globe with
+ minor circles. Can cast a shadow.
+ <enum>
+ <item><tt>numeric</tt> Number of marked latitudes.</item>
+ <item><tt>color</tt> Center position.</item>
+ <item><tt>numeric</tt> Radius</item>
+ <item><tt>color</tt> Axis orientation.</item>
+ </enum>
+ <figure>
+ <eps file="../allps/tropicalglobe.1">
+ <img src="../allpng/tropicalglobe.1.gs.png">
+ <caption>Figure that uses <tt>tropicalglobe</tt>.
+ </caption>
+ </figure>
+ </item>
+ <item>draw <bf>whatisthis()</bf> An elliptic
+ frustum. Both edges are elliptic an have the same
+ orientation but one may be greater than the other.
+ Can cast a shadow.
+ <enum>
+ <item><tt>color</tt> Reference edge center.</item>
+ <item><tt>color</tt> Major or minor axis.</item>
+ <item><tt>color</tt> The other axis.</item>
+ <item><tt>numeric</tt> Length of the original
+ cylinder.</item>
+ <item><tt>numeric</tt> Edges axis length ratio.</item>
+ </enum>
+ </item>
+ <item>draw <bf>kindofcube()</bf> Polyhedron with six
+ orthogonal faces (cuboid).
+ <enum>
+ <item><tt>boolean</tt> Also draw the invisible edges
+ <tt>dashed evenly</tt> (<tt>true</tt>) or do not.</item>
+ <item><tt>boolean</tt> The reference point may be a
+ vertex (<tt>true</tt>) or the center(<tt>false</tt>).</item>
+ <item><tt>color</tt> Reference point.</item>
+ <item><tt>numeric</tt> Alpha1.</item>
+ <item><tt>numeric</tt> Alpha2.</item>
+ <item><tt>numeric</tt> Alpha3.</item>
+ <item><tt>numeric</tt> L1. Length of the first side.</item>
+ <item><tt>numeric</tt> L2. Length of the second side.</item>
+ <item><tt>numeric</tt> L3. Length of the third side.</item>
+ </enum>
+ These arguments are represented in the next figure.
+ <figure>
+ <eps file="../allps/kindofcube.2">
+ <img src="../allpng/kindofcube.2.gs.png">
+ <caption>Figure that uses and explains
+ <tt>kindofcube</tt>. Note that the three indicated
+ angles may be used as arguments of <tt>eulerrotation</tt>.</caption>
+ </figure><label id="kindofcube2">
+ </item>
+ <item>draw <bf>setthestage()</bf> Produces an horizontal
+ square made of squares. Its <tt>Z</tt> coordinate is defined by
+ <tt>HoriZon</tt>.
+ <enum>
+ <item><tt>numeric</tt> Number of squares in each side.</item>
+ <item><tt>numeric</tt> Size of each side.</item>
+ </enum>
+ </item>
+ <item>draw <bf>setthearena()</bf> Produces an horizontal
+ circle made of circles. Its <tt>Z</tt> coordinate is defined by
+ <tt>HoriZon</tt>. Due to the fact that the center of a
+ circle is not on the center of its central perspective
+ projection, this may look a bit strange.
+ <enum>
+ <item><tt>numeric</tt> Number of circles on a
+ diameter.</item>
+ <item><tt>numeric</tt> Diameter.</item>
+ </enum>
+ </item>
+ <item>draw <bf>smoothtorus()</bf> Toxic donut (not to be
+ eaten). Produces an error message when <tt>f</tt> is
+ close to the table.
+ <enum>
+ <item><tt>color</tt> Center.</item>
+ <item><tt>color</tt> Direction orthogonal to the
+ torus plane.</item>
+ <item><tt>numeric</tt> Big ray.</item>
+ <item><tt>numeric</tt> Small ray.</item>
+ </enum>
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Composed Objects</heading>
+ <p>
+ <itemize>
+ <item>draw <bf>positivecharge()</bf> Draws a sphere with a
+ plus or minus sign on the surface. The horizontal
+ segment of the sign is drawn on the horizontal plane
+ that contains the sphere center. The middle point of
+ this segment is on a vertical plane containing the
+ viewpoint.
+ <enum>
+ <item><tt>boolean</tt> Selects the sign (<tt>true</tt>
+ means positive).</item>
+ <item><tt>color</tt> Position of the center.</item>
+ <item><tt>numeric</tt> Sphere ray.</item>
+ </enum>
+ <figure>
+ <eps file="../allps/positivecharge.1">
+ <img src="../allpng/positivecharge.1.gs.png">
+ <caption>Figure that uses <tt>positivecharge</tt>,
+ <tt>getready</tt> and <tt>doitnow</tt>.
+ </caption>
+ </figure></item>
+ <item>draw <bf>simplecar()</bf> Draws a cuboid and four
+ discs in a configuration ressembling an automobile. The
+ first three arguments of <tt>simplecar</tt> are the same
+ as the the last seven arguments of <tt>kindofcube</tt>
+ but grouped in colors.
+ <enum>
+ <item><tt>color</tt> Center of the cuboid that
+ constitutes the body of the car..</item>
+ <item><tt>color</tt> Angles defining the orientation
+ of the car (see <tt>kindofcube</tt>).</item>
+ <item><tt>color</tt> Dimensions of the car.</item>
+ <item><tt>color</tt> Characteristics of the front
+ wheels. <tt>redpart</tt>-distance from the
+ front. <tt>greenpart</tt>-width of the front wheels (length
+ of the cylinders). <tt>bluepart</tt>-wheel ray.</item>
+ <item><tt>color</tt> Same as above for the rear wheels</item>
+ </enum>
+ <figure>
+ <eps file="../allps/simplecar.1">
+ <img src="../allpng/simplecar.1.gs.png">
+ <caption>Figure that uses <tt>setthearena</tt> and
+ <tt>simplecar</tt>.
+ </caption>
+ </figure></item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Shadow Pathes</heading>
+ <p>
+ <itemize>
+ <item>draw <bf>signalshadowvertex()</bf> Draws the
+ shadow of a <tt>signalvertex</tt> dot.
+ <enum>
+ <item><tt>color</tt> Location of the light-blocking dot.</item>
+ <item><tt>numeric</tt> Factor of proportionality
+ ("size of the dot").</item>
+ <item><tt>colour</tt> Colour of the dot.</item>
+ </enum>
+ </item>
+ <item>path <bf>ellipticshadowpath()</bf> Produces the
+ shadow of an elliptic path.
+ <enum>
+ <item><tt>color</tt> Position of the center.</item>
+ <item><tt>color</tt> Major or minor axis.</item>
+ <item><tt>color</tt> The other axis.</item>
+ </enum>
+ </item>
+ <item>path <bf>circleshadowpath()</bf> Produces the
+ shadow of a circle.
+ <enum>
+ <item><tt>color</tt> Center of the circle.</item>
+ <item><tt>color</tt> Direction ortogonal to
+ the circle.</item>
+ <item><tt>numeric</tt> Radius of the
+ circle.</item>
+ </enum>
+ </item>
+ <item>path <bf>rigorousfearshadowpath()</bf>
+ 3D sphere shadow.
+ <enum>
+ <item><tt>color</tt> Center position.</item>
+ <item><tt>numeric</tt> Radius.</item>
+ </enum>
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Differential Equations</heading>
+ <p>
+ Before we proceed, be aware that solving differential
+ equations (DE) is mainly an experimental activity. The most
+ probable result of a procedure that atempts to solve a DE
+ is garbage. The procedure may be unstable, the solution
+ may be littered with singularities or something may go
+ wrong. If you don't have a basic understanding of
+ differential equations then skip this section, please.
+ </p>
+ <p>
+ <itemize>
+ <item>path <bf>fieldlinepath()</bf> A vectorial field line is
+ everywhere tangent to the field vectors.
+ Two different parallel fields
+ have the same field lines. So the field only
+ constrains the direction of the field lines, not any kind
+ of "speed" and, therefore, it is recommended to
+ normalize the field before using this macro that
+ contains a second-order Runge-Kutta method
+ implementation.
+ <enum>
+ <item><tt>numeric</tt> Total number of steps.</item>
+ <item><tt>color</tt> Initial position.</item>
+ <item><tt>numeric</tt> Step (arc)length.</item>
+ <item><tt>text</tt> Name of the function that
+ returns a field vector for each 3D position.</item>
+ </enum>
+ </item>
+ <item>path <bf>trajectorypath()</bf> The acceleration of a
+ particle in a conservative force field is equal to the
+ ratio (conservative force)/(particle mass). The
+ acceleration is also equal to the second order time
+ derivative of the particle position. This produces a
+ second order differential equation that we solve using a
+ second-order Runge-Kutta method implementation.
+ <enum>
+ <item><tt>numeric</tt> Total number of steps.</item>
+ <item><tt>color</tt> Initial position.</item>
+ <item><tt>color</tt> Initial velocity.</item>
+ <item><tt>numeric</tt> Time step.</item>
+ <item><tt>text</tt> Name of the function that
+ returns a (force/mass) vector for each 3D position.</item>
+ </enum>
+ </item>
+ <item>path <bf>magnetictrajectorypath()</bf> The
+ acceleration of a
+ charged particle in a magnetic field is equal to the
+ ratio (magnetic force)/(particle mass) but the magnetic
+ force depends on both the velocity and the magnetic field. The
+ acceleration is also equal to the second order time
+ derivative of the particle position. This produces a
+ second order differential equation that we solve using a
+ fourth-order Runge-Kutta method implementation.
+ <enum>
+ <item><tt>numeric</tt> Total number of steps.</item>
+ <item><tt>color</tt> Initial position.</item>
+ <item><tt>color</tt> Initial velocity.</item>
+ <item><tt>numeric</tt> Time step.</item>
+ <item><tt>text</tt> Name of the function that
+ returns a (charge)*(magnetic field)/(partcle mass)
+ vector for each 3D position.</item>
+ </enum>
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Renderers</heading>
+ <p>
+ <itemize>
+ <item>draw <bf>sharpraytrace</bf> Heavy procedure that
+ draws only the visible part of all edges of all defined
+ faces. There's no point in using this procedure when
+ there are no intersections beetween faces. Any how
+ this will not work for non-convex faces nor when
+ <tt>SphericalDistortion:=true</tt>.
+ </item>
+ <item>draw <bf>lineraytrace()</bf> Draws only the
+ visible part of all defined lines using sequences of dots
+ (<tt>signalvertex</tt> and <tt>PrintStep</tt>).
+ <enum>
+ <item><tt>numeric</tt> Dot size.</item>
+ <item><tt>colour</tt> Dot colour.</item>
+ </enum>
+ </item>
+ <item>draw <bf>faceraytrace()</bf> Draws only the
+ visible part of all edges of all defined faces
+ using sequences of dots
+ (<tt>signalvertex</tt> and <tt>PrintStep</tt>).
+ <enum>
+ <item><tt>numeric</tt> Dot size.</item>
+ <item><tt>colour</tt> Dot colour.</item>
+ </enum>
+ </item>
+ <item>draw <bf>draw_all_test()</bf> Draws all defined
+ edges (and lines) in a correct way independently of
+ the kind of projection used. Can cast a shadow (but
+ the shadow is not correct when
+ <tt>SphericalDistortion:=true</tt>).
+ <enum>
+ <item><tt>boolean</tt> If <tt>true</tt> the lines
+ are also drawn.</item>
+ </enum>
+ </item>
+ <item>draw <bf>fill_faces()</bf> Unfills and draws all
+ faces in the order they were defined (without
+ sorting). Can cast a shadow.
+ <enum>
+ <item><tt>text</tt> Like the argument of
+ <tt>drawoptions</tt> but used only inside this
+ macro and only for the edges.</item>
+ </enum>
+ </item>
+ <item>draw <bf>draw_invisible()</bf> This is a fast way
+ of removing hidden lines that doesn't
+ allow for intersecting polygons nor
+ polygons of very different area. It works by
+ sorting all polygons by
+ distance to <tt>f</tt> and then by "filling" the
+ polygons. This routine may be used to draw graphs
+ of 3D surfaces.
+ <enum>
+ <item><tt>boolean</tt> If <tt>true</tt> polygons are
+ sorted relatively to
+ nearest vertex and, if <tt>false</tt>, relatively to their
+ mass center. Choose <tt>false</tt> for surface
+ plots.</item>
+ <item><tt>boolean</tt> If <tt>false</tt> then the
+ polygons are painted with their <tt>FC</tt> colour
+ modified by <tt>LightSource</tt>. If <tt>true</tt>
+ then the next two arguments are used and the
+ polygons are darkened proportionaly to their
+ distance from <tt>f</tt>.</item>
+ <item><tt>colour</tt> Colour of faces.</item>
+ <item><tt>colour</tt> Colour of the edges.</item>
+ </enum>
+ </item>
+ <item>global <bf>getready()</bf> When you don't want to
+ edit the source of the MetaPost program, to resort the
+ objects so they'll be drawn correctly, use this macro
+ and the next.
+ <enum>
+ <item><tt>string</tt> Command line that would draw
+ some object. For instance:
+ <tt>"rigorousfearpath(black,1);"</tt>.</item>
+ <item><tt>color</tt> Reference position of that
+ object.</item>
+ </enum>
+ </item>
+ <item>draw <bf>doitnow</bf> The reference positions
+ given as arguments of previous <tt>getready</tt> calls
+ are used to sort and draw the objects also given as
+ string arguments to previous <tt>getready</tt>
+ calls. Remember to initialize <tt>Nobjects:=0;</tt>
+ before a second figure.
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Nematics (Direction Fields)</heading>
+ <p>
+ Nematics are the least ordered liquid crystals. Their
+ configurations can be described by direction fields
+ (vector fields without arrows). The two following routines
+ ease the task of representing their configurations.
+ </p>
+ <p>
+ <itemize>
+ <item>global <bf>generatedirline()</bf> Defines a single
+ straight line segment in a given position and with a
+ given orientation.
+ <enum>
+ <item><tt>numeric</tt> Line index number.</item>
+ <item><tt>numeric</tt> Angle beetween the <tt>X</tt>
+ axis and the projection of the line on the
+ <tt>XY</tt> plane.</item>
+ <item><tt>numeric</tt> Angle beetween the line
+ and the <tt>XY</tt> plane.</item>
+ <item><tt>numeric</tt> Line (arc)length.</item>
+ <item><tt>color</tt> Position of the line middle
+ point.</item>
+ </enum>
+ </item>
+ <item>draw <bf>director_invisible()</bf> This is a
+ direction field renderer that can sort direction
+ lines. This routine
+ draws straight lines of given "thickness" beetween the
+ first all the points
+ of all the <tt>L[]p[]</tt> lines. It is supposed to
+ help you draw vector fields
+ without arrows but taking care of invisibility.
+ The lines may be
+ generated by <tt>generatedirline</tt> or by other macros.
+ <enum>
+ <item><tt>boolean</tt> When there is no need to sort
+ lines you may use <tt>false</tt> here.
+ </item>
+ <item><tt>numeric</tt> "Thickness" of the
+ direction lines</item>
+ <item><tt>boolean</tt> Use <tt>true</tt> for cyclic
+ "direction" lines.</item>
+ </enum>
+ </item>
+ </itemize>
+ <figure>
+ <eps file="../allps/twistflat.1">
+ <img src="../allpng/twistflat.1.gs.png">
+ <caption>Figure that uses <tt>director_invisible</tt>
+ and <tt>generatedirline</tt>.</caption>
+ </figure>
+ </p>
+ </sect2>
+ <sect2>
+ <heading>Surface Plots</heading>
+ <p>
+ Many powerfull plotting packages like
+ <tt><url url="http://www.gnuplot.info/" name="gnuplot"></tt> and
+ <tt><url url="http://gri.sourceforge.net/" name="gri"></tt>
+ are freely available. Because of this, <tt>FEATPOST</tt>
+ surface plots are geared towards unusual features like
+ equilateral triangular grid, hexagonal domain and merging
+ together functional and parametric surface descriptions.
+ </p>
+ <p>
+ <itemize>
+ <item>draw <bf>hexagonaltrimesh()</bf> Plots a
+ functional surface on a triangular or hexagonal
+ domain. Uses the <tt>LightSource</tt>.
+ <enum>
+ <item><tt>boolean</tt> Select the kind of
+ domain. <tt>true</tt> for hexagonal and
+ <tt>false</tt> for triangular. The domain is
+ centered on the origin (<tt>black</tt>). When the
+ domain is hexagonal two of its corners are on the
+ <tt>-YY</tt> axis. When the
+ domain is triangular one of its corners is on the
+ <tt>X</tt> axis. </item>
+ <item><tt>numeric</tt> Number of small triangles on
+ each side of the triangular domain or three times
+ the number of small triangles on
+ each side of the hexagonal domain.</item>
+ <item><tt>numeric</tt> Length of the triangular
+ domain side or three times the hexagonal domain
+ side.</item>
+ <item><tt>text</tt> Name of the function that
+ returns the <tt>Z</tt> coordinate of a surface
+ point of coordinates <tt>X</tt> and <tt>Y</tt>.</item>
+ </enum>
+ <figure>
+ <eps file="../allps/hexagonaltrimesh.1">
+ <img src="../allpng/hexagonaltrimesh.1.gs.png">
+ <caption>Figure that uses <tt>hexagonaltrimesh</tt>.
+ </caption>
+ </figure>
+ </item>
+ <item>global <bf>partrimesh()</bf> Defines a parametric
+ surface that can be drawn with
+ <tt>draw_invisible</tt>. In the following descriptions
+ <tt>S</tt> and <tt>T</tt> are the parameters. Remember
+ to initialize <tt>NF</tt>. The surface is defined so
+ that quadrangles are used whenever possible. If
+ impossible, two triangles are used but their
+ orientation is selected to maximize the surface
+ smoothness. Also note that, unlike
+ <tt>hexagonaltrimesh()</tt>, the spatial range you
+ require to be visible is always first reshaped into a
+ cube and second compressed or extended vertically. How
+ much the cube is compressed or extended depends on the
+ last <tt>numeric</tt> argument, the compression factor
+ for <tt>Z</tt>, meaning that the final height of the
+ cube is 2/(compression factor). Thanks to Sebastian
+ Sturm for pointing the need to explain this.
+ <enum>
+ <item><tt>numeric</tt> Number of <tt>T</tt> steps.</item>
+ <item><tt>numeric</tt> Number of <tt>S</tt> steps.</item>
+ <item><tt>numeric</tt> Minimal <tt>T</tt> value.</item>
+ <item><tt>numeric</tt> Maximal <tt>T</tt> value.</item>
+ <item><tt>numeric</tt> Minimal <tt>S</tt> value.</item>
+ <item><tt>numeric</tt> Maximal <tt>S</tt> value.</item>
+ <item><tt>numeric</tt> Minimal <tt>X</tt> value.</item>
+ <item><tt>numeric</tt> Maximal <tt>X</tt> value.</item>
+ <item><tt>numeric</tt> Minimal <tt>Y</tt> value.</item>
+ <item><tt>numeric</tt> Maximal <tt>Y</tt> value.</item>
+ <item><tt>numeric</tt> Minimal <tt>Z</tt> value.</item>
+ <item><tt>numeric</tt> Maximal <tt>Z</tt> value.</item>
+ <item><tt>numeric</tt> Compression factor for <tt>Z</tt>
+ values.</item>
+ <item><tt>text</tt> Name of the function that
+ returns a surface point (of <tt>color</tt> type)
+ for each pair (<tt>S</tt>,<tt>T</tt>).</item>
+ </enum>
+ </item>
+ </itemize>
+ </p>
+ </sect2>
+ </sect1>
+ </sect>
+ </article>
+</linuxdoc>
diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/tug2004.pdf b/Master/texmf-dist/doc/metapost/featpost/doc/tug2004.pdf
new file mode 100644
index 00000000000..078fe7ef720
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/doc/tug2004.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/bugtrack/bughunt.mp b/Master/texmf-dist/doc/metapost/featpost/example/bugtrack/bughunt.mp
new file mode 100644
index 00000000000..2afa2bcd62d
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/bugtrack/bughunt.mp
@@ -0,0 +1,57 @@
+% bughunt.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+%SphericalDistortion := true;
+%f := 0.3*(5,4,2);
+%Spread := 40;
+%ShiftV := (200,200);
+
+SphericalDistortion := false;
+f := 3.3*(5,4,2);
+Spread := 70;
+ShiftV := (250,250);
+
+beginfig(1);
+ color nalfa, gammacnt, vertex;
+ numeric altura, grids, radius, aux, i, numc, slope;
+
+ altura = 1;
+ radius = 0.3;
+ grids = 1;
+ numc = 8;
+ slope = 15;
+
+ for i=1 upto numc:
+ aux := (i-1-0.5*(numc-1))*grids;
+ gammacnt := (0,aux,0);
+ vertex := gammacnt+0.1*(f-gammacnt)+(0,0,aux/slope);
+ nalfa := vertex - gammacnt;
+ rigorousdisc( 0, true, gammacnt, radius, nalfa );
+ endfor;
+endfig;
+
+beginfig(2);
+ path cpath;
+ color vert;
+ numeric i;
+ f := (4,0,0.5);
+ vert = 0.5*(0,1,1);
+ cpath = rigorouscone(true, black, blue, 1, vert);
+% draw rp(vert);
+ draw cpath; show length cpath;
+ for i=0 upto length cpath:
+ dotlabel.top( decimal(i),point i of cpath);
+ endfor;
+% cpath := rigorouscircle( black, blue, 1);
+% draw cpath;
+% for i=0 upto length cpath:
+% dotlabel.bot( decimal(i),point i of cpath);
+% endfor;
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/bugtrack/gstr.mp b/Master/texmf-dist/doc/metapost/featpost/example/bugtrack/gstr.mp
new file mode 100644
index 00000000000..b0cf81a4674
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/bugtrack/gstr.mp
@@ -0,0 +1,9 @@
+
+beginfig(1);
+ boolean tb;
+ tb = true;
+ draw origin;
+ show bstr( tb );
+endfig;
+end.
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/highmemory/hiddenlinegraph.mp b/Master/texmf-dist/doc/metapost/featpost/example/highmemory/hiddenlinegraph.mp
new file mode 100644
index 00000000000..efa5cea3727
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/highmemory/hiddenlinegraph.mp
@@ -0,0 +1,72 @@
+% hiddenlinegraph.mp
+% L. Nobre G.
+% 2003
+% The application of the big nice trick to draw 3D hidden line surfaces
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+def zsurfaci( expr xc, yc ) =
+ begingroup
+ numeric zout;
+ zout = yc**4-xc*yc*(1-yc**2);
+ ( ( xc, yc, zout ) )
+ endgroup
+enddef;
+
+def zsurface( expr xc, yc ) =
+ ( xc, yc, cosd(xc*57)*cosd(yc*57)+4*mexp(-(xc**2+yc**2)*6.4) )
+enddef;
+
+def zsurfaca( expr xc, yc ) =
+ ( xc, yc, 1.5-0.2*xc )
+enddef;
+
+%f := (6,1,0);
+f := (5,1.5,3);
+Spread := 147;
+NF := 0;
+LightSource := (1,-1,2);
+
+beginfig(1);
+ numeric nx, ny, lowx, higx, lowy, higy,
+ facz, lowz, higz, base, topo;
+ path chair;
+ nx = 22;
+ ny = 22;
+ lowy = -7;
+ higy = 7;
+ lowx = -7;
+ higx = 7;
+ facz = 2;
+ lowz = -1;
+ higz = 5;
+% lowy = -2.5;
+% higy = 1;
+% lowx = 1.5;
+% higx = 3;
+% facz = 3;
+% lowz = -1.5;
+% higz = 1.5;
+ partrimesh( nx,ny,lowx,higx,lowy,higy,
+ lowx,higx,lowy,higy,lowz,higz,facz,zsurface);
+ partrimesh( nx,ny,lowx,higx,lowy,higy,
+ lowx,higx,lowy,higy,lowz,higz,facz,zsurfaca);
+ base = -1/facz;
+ topo = 1/facz;
+ chair = rp((-1,-1,base))--rp((1,-1,base))--rp((1,1,base))
+ --rp((-1,1,base))--rp((-1,-1,base))--rp((-1,-1,topo))
+ --rp((-1,1,topo))--rp((-1,1,base))--cycle;
+ draw chair;
+% fill_faces( withcolor blue );
+ draw_invisible( false, false, green, blue );
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp b/Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp
new file mode 100644
index 00000000000..d4ab2a9e4cf
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp
@@ -0,0 +1,54 @@
+% mainmemtest.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3D;
+
+beginfig(1);
+
+ f := (2,1,1);
+
+ Spread := 500;
+
+ color gridvec, sizevec, currpos, starpos, bordpos;
+ numeric i, j, k, counter, theta, phi, thetamin,
+ thetamax, thetastp, long, base;
+% It works with sizevec := (8,6,1);
+% with (9,6,1) and sharpraytrace it says
+% ! MetaPost capacity exceeded, sorry [main memory size=2199001].
+ sizevec := (7,6,1);
+ gridvec := (0.05,0.1,0.1);
+ thetamin := 55;
+ thetamax := 125;
+ long := 0.08;
+ base := 0.01;
+ thetastp := (thetamax-thetamin)/(X(sizevec)-1);
+ starpos := ( -0.5*X(gridvec)*(X(sizevec)-1) ,
+ -0.5*Y(gridvec)*(Y(sizevec)-1) ,
+ -0.5*Z(gridvec)*(Z(sizevec)-1) );
+ bordpos := starpos - 0.5*gridvec;
+ npf1 := 4;
+ F1p1 := bordpos;
+ F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
+ counter := 2;
+ for i=1 upto X(sizevec):
+ for j=1 upto Y(sizevec):
+ for k=1 upto Z(sizevec):
+ phi := 90;
+ theta := thetamin+(i-1)*thetastp;
+ currpos := starpos+( (i-1)*X(gridvec) ,
+ (j-1)*Y(gridvec) ,
+ (k-1)*Z(gridvec) );
+ generatedirface( counter, phi, theta, long, base, currpos );
+ counter := incr(counter);
+ endfor;
+ endfor;
+ endfor;
+ NF := decr(counter);
+ sharpraytrace;
+endfig;
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/highmemory/par3Dplotexamples.mp b/Master/texmf-dist/doc/metapost/featpost/example/highmemory/par3Dplotexamples.mp
new file mode 100644
index 00000000000..6b05682918a
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/highmemory/par3Dplotexamples.mp
@@ -0,0 +1,149 @@
+% J. Schwaiger with help of
+% FEATPOST and the macropackages
+% la3Dmacros.mp and hlr3Dmacros.mp
+% by L. Nobre G.
+% 2003
+
+% Figure (2) retouched in 2004 by L. Nobre G.
+
+verbatimtex
+\documentclass[a4paper,12pt]{article}
+\usepackage[T1]{fontenc}
+\usepackage[latin1]{inputenc}
+\usepackage{euler}
+\usepackage{graphicx}
+\begin{document}
+etex
+
+% for trigonometric functions when angles are measured in rad
+%
+ def sinrad( expr t)=sind(t/3.145*180) enddef;
+ def cosrad( expr t)=cosd(t/3.145*180) enddef;
+
+ def parsurface( expr tc,sc )=
+ (%
+ (4 cosrad(tc) - sinrad(sc)*cosrad(tc),%
+ 4 sinrad(tc) - sinrad(sc)*sinrad(tc),%
+ cosrad(sc))%
+ )% A torus
+ enddef;
+
+ def parsurfacetwo( expr tc,sc )=
+ (%
+ (4+4cosrad(tc) - sinrad(sc)*cosrad(tc),%
+ cosrad(sc),
+ 4sinrad(tc) - sinrad(sc)*sinrad(tc)%
+ )%
+ )% Another torus
+ enddef;
+
+ def parsurfacethree( expr tc,sc )=
+% 0<=sc<=2pi,-2<=tc<=2
+%xmin=-1.4, xmax=1.4
+%ymin=-0.7, ymax=2
+%zmin=-2.5,zmax=2.5
+ (%
+ (1.414213562*cosrad(sc)*cosrad(tc)
+ -2*sinrad(sc)*sinrad(tc))/(2*(abs(tc) + 1)) + sinrad(tc),%
+ cosrad(tc) - (1.414213562*cosrad(sc)*sinrad(tc)
+ + 2*sinrad(sc)*cosrad(tc))/(2*(abs(tc) + 1)),%
+ tc - 2*cosrad(sc)/(2*(abs(tc) + 1))
+ )%
+% A space tube governed by a helix
+ enddef;
+
+def zsurface( expr xc, yc ) =
+ ( xc, yc, cosd(xc*57)*cosd(yc*57)+4*mexp(-(xc**2+yc**2)*6.4) )
+enddef;
+
+f:=(8,1.5,1.5);
+Spread := 127;
+
+
+beginfig(1);
+ numeric Ns, Nt, lows, higs, lowt, higt, lowx, highx, lowy, highy,
+ facz, lowz, higz, base, topo;
+ path chair;
+ % for torus
+ f:=(4,1.5,1.5);
+ Spread:=150;
+ Ns = 16;
+ Nt= 16;
+ lows := 3.145*0.25;
+ higs := 3.145*1.75;
+ lowt = -3.145;
+ higt = 3.145;
+ facz=1;
+ lowz = -5;
+ higz = 5;
+ lowx:=-5;
+ lowy:=-5;
+ higx:=10;
+ higy:=7;
+%
+ NF:=0; %Initialize number of faces;
+%
+ partrimesh( Ns,Nt,lowt,higt,lows,higs,
+ lowx,higx,lowy,higy,lowz,higz,facz,parsurfacetwo );
+ lows := 3.145*0.5;
+ higs := 2.25*3.145; % new parameters and new surface
+ partrimesh( Ns,Nt,lowt,higt,lows,higs,
+ lowx,higx,lowy,higy,lowz,higz,facz,parsurface );
+ base = -1/facz;
+ topo = 1/facz;
+ chair = rp((-1,-1,base))--rp((1,-1,base))--rp((1,1,base))
+ --rp((-1,1,base))--rp((-1,-1,base))--rp((-1,-1,topo))
+ --rp((-1,1,topo))--rp((-1,1,base))--cycle;
+ draw_invisible( false,true,(blue+0.5green),0.6white);
+ draw bbox currentpicture;
+endfig;
+
+beginfig(2);
+ numeric Ns, Nt, lows, higs, lowt, higt, lowx, highx, lowy, highy,
+ facz, lowz, higz, base, topo;
+ path chair;
+
+ f := (6,0.5,3);
+ Spread:=150;
+
+ Ns = 19;
+ Nt= 19;
+ lows := -3.145;
+ higs := 3.145;
+ lowt = -3.145;
+ higt = 3.145;
+ facz = 2;
+ lowz = -2;
+ higz = 2;
+ lowx:=-5;
+ lowy:=-5;
+ higx:=5;
+ higy:=5;
+ NF:=0; %Initialize number of faces;
+%
+ partrimesh( Ns,Nt,lowt,higt,lows,higs,
+ lowx,higx,lowy,higy,lowz,higz,facz,parsurface );
+
+ nx := 27;
+ lowy := -7;
+ higy := 7;
+ lowx := -7;
+ higx := 7;
+ facz := 2;
+ lowz := -1;
+ higz := 5;
+ partrimesh( nx,nx,lowx,higx,lowy,higy,
+ lowx,higx,lowy,higy,lowz,higz,facz,zsurface);
+ base = -1/facz;
+ topo = 1/facz;
+ chair = rp((-1,-1,base))--rp((1,-1,base))--rp((1,1,base))
+ --rp((-1,1,base))--rp((-1,-1,base))--rp((-1,-1,topo))
+ --rp((-1,1,topo))--rp((-1,1,base))--cycle;
+ fill chair withcolor 0.9 blue+0.6white;
+ draw chair withcolor 0.1white ;
+ draw_invisible( false,false,(red+0.32blue),0.6white);
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/borderframetest.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/borderframetest.mp
new file mode 100644
index 00000000000..1c2331bdc17
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/borderframetest.mp
@@ -0,0 +1,28 @@
+% borderframetest.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(0);
+ Spread := 45;
+
+ numeric theframefrach, theframefracw, Shifts;
+ path theframebord;
+ Shifts := 105mm;
+ theframefrach = 0.2927;
+ theframefracw = 0.39;
+ z1 = Shifts*(1-theframefracw,1-theframefrach);
+ z2 = Shifts*(1+theframefracw,1-theframefrach);
+ z3 = Shifts*(1+theframefracw,1+theframefrach);
+ z4 = Shifts*(1-theframefracw,1+theframefrach);
+ theframebord = z1--z2--z3--z4--cycle;
+ show z1;
+ show z2;
+ show z3;
+ show z4;
+ draw theframebord withcolor background withpen pencircle scaled 0;
+ clip currentpicture to theframebord;
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/conegetready.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/conegetready.mp
new file mode 100644
index 00000000000..17e7fea51b3
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/conegetready.mp
@@ -0,0 +1,36 @@
+% conegetready.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ numeric radiusin, fac, i, xcoor, ycoor, radc, numc, baz;
+ color refvec;
+ string rv, mrv, vgc, stra, strb, lrv;
+
+ f := (5,0.3,1.5);
+ Spread := 70;
+ radiusin = 0.3;
+ baz = 0.08;
+ fac = 3;
+ numc = 9;
+ radc = (fac-1)*radiusin*sind(180/numc);
+
+ i = 155;
+ xcoor := -radiusin*cosd(i);
+ ycoor := radiusin*sind(i);
+ refvec := (xcoor,-ycoor,baz);
+ rv := cstr( refvec );
+ mrv := cstr( -refvec );
+ lrv := cstr( (2*fac-1)*refvec );
+ vgc :="verygoodcone(true,fac*";
+ stra := vgc & rv & "," & mrv & "," & decimal(radc) & "," & rv & ")";
+ getready( stra, 0.5*(fac+1)*refvec );
+ strb := vgc & rv & "," & rv & "," & decimal(radc) & "," & lrv & ")";
+ getready( strb, 0.5*(3*fac-1)*refvec );
+ doitnow;
+ produce_vga_border;
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/doitnow.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/doitnow.mp
new file mode 100644
index 00000000000..7cfec23a39d
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/doitnow.mp
@@ -0,0 +1,33 @@
+% doitnow.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+f := 1.5*(1.5,0,1);
+Spread := 100;
+
+beginfig(1);
+ numeric stagelevel, holediam, outerdiam, stagemargin;
+ numeric numberofstagesidesquares, stagesidesize;
+ numeric centercoord;
+ color centerposdisc, centerpostorus, centerstage;
+ pickup pencircle scaled 3pt;
+ stagelevel = 0.2;
+ holediam = 0.6;
+ stagemargin = 0.2;
+ numberofstagesidesquares = 10;
+ centerstage = (-X(f),-Y(f),-stagelevel);
+ outerdiam = holediam+4*stagelevel;
+ stagesidesize = 2*( outerdiam + stagemargin );
+ centercoord = 0.3535*outerdiam;
+ HoriZon := -stagelevel;
+ centerpostorus = ( centercoord, -centercoord, 0 );
+ centerposdisc = ( -centercoord, centercoord, HoriZon );
+ getready("setthestage( numberofstagesidesquares, stagesidesize );",
+ centerstage);
+ getready("smoothtorus( centerpostorus, blue,0.5*holediam+stagelevel, stagelevel );",centerpostorus);
+ getready("rigorousdisc( 0.5*holediam, true, centerposdisc,0.5*outerdiam, 1.5*stagelevel*blue );",centerposdisc);
+ doitnow;
+endfig;
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/electricpotential.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/electricpotential.mp
new file mode 100644
index 00000000000..01caaab0c5e
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/electricpotential.mp
@@ -0,0 +1,151 @@
+% electricpotential.mp
+% L. Nobre G.
+% 2004
+% PAY ATTENTION: THESE FIGURES ARE INDEPENDANT. CONDUCTOR SURFACE POTENTIAL
+% CHANGES UNDER THE INFLUENCE OF EXTERNAL CHARGES.
+
+%input featpost3Dplus2D;
+
+f := 16*(4,1,1);
+Spread := 35;
+LightSource := 10*(4,-3,4);
+ActuC := 2;
+
+numeric potlim, cac, cbc, ccc, cdc;
+potlim = 2;
+cac = 2;
+cbc = -2;
+ccc = 4;
+cdc = 1.5;
+pair cap, cbp, ccp;
+cap = (-2,-4);
+ccp = (-2,4);
+cbp = (2,0);
+numeric np, ssize;
+np = 56;
+ssize = 18;
+
+def zi( expr xc, yc ) =
+ 0
+enddef;
+
+def za( expr xc, yc ) =
+ begingroup
+ save out;
+ numeric dist, out;
+ dist = abs( (xc,yc)-cap );
+ if abs(dist) < 0.005:
+ if cac<0:
+ out = -potlim;
+ else:
+ out = potlim;
+ fi;
+ else:
+ out = cac/dist;
+ fi;
+ if out > potlim:
+ out := potlim;
+ elseif out < -potlim:
+ out := -potlim;
+ fi;
+ (out)
+ endgroup
+enddef;
+
+def zb( expr xc, yc ) =
+ begingroup
+ save out;
+ numeric dist, out;
+ dist = abs( (xc,yc)-cbp );
+ if abs(dist) < 0.005:
+ if cbc<0:
+ out = -potlim;
+ else:
+ out = potlim;
+ fi;
+ else:
+ out = cbc/dist + za( xc, yc );
+ fi;
+ if out > potlim:
+ out := potlim;
+ elseif out < -potlim:
+ out := -potlim;
+ fi;
+ (out)
+ endgroup
+enddef;
+
+def zc( expr xc, yc ) =
+ begingroup
+ save out;
+ numeric dist, out;
+ dist = abs( (xc,yc)-ccp );
+ if abs(dist) < 0.005:
+ if ccc<0:
+ out = -potlim;
+ else:
+ out = potlim;
+ fi;
+ else:
+ out = ccc/dist + zb( xc, yc );
+ fi;
+ if out > potlim:
+ out := potlim;
+ elseif out < -potlim:
+ out := -potlim;
+ fi;
+ (out)
+ endgroup
+enddef;
+
+def zd( expr xc, yc ) =
+ begingroup
+ save out;
+ numeric dist, out, i, tmp;
+ pair poi;
+ tmp = 0;
+ for i=0 upto np:
+ poi := (i/np)[cap,ccp];
+ dist := abs( (xc,yc)-poi );
+ if abs(dist) < 0.005:
+ if cdc<0:
+ out := -potlim;
+ else:
+ out := potlim;
+ fi;
+ else:
+ out := cdc/dist/np;
+ fi;
+ tmp := tmp+out;
+ endfor;
+ tmp := tmp + zc( xc, yc );
+ if tmp > potlim:
+ tmp := potlim;
+ elseif tmp < -potlim:
+ tmp := -potlim;
+ fi;
+ (tmp)
+ endgroup
+enddef;
+
+beginfig(0);
+ hexagonaltrimesh( false, np, ssize, zi );
+endfig;
+
+beginfig(1);
+ hexagonaltrimesh( false, np, ssize, za );
+endfig;
+
+beginfig(2);
+ hexagonaltrimesh( false, np, ssize, zb );
+endfig;
+
+beginfig(3);
+ hexagonaltrimesh( false, np, ssize, zc );
+endfig;
+
+beginfig(4);
+ hexagonaltrimesh( false, np, ssize, zd );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/emptylines.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/emptylines.mp
new file mode 100644
index 00000000000..df8e02695dd
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/emptylines.mp
@@ -0,0 +1,28 @@
+% emptylines.mp
+% L. Nobre G.
+% 2001
+
+%input featpost3Dplus2D;
+
+
+def closec( expr TheVal ) =
+ begingroup
+ numeric par[], cred, cblu, param;
+ par1 = 360;
+ par2 = 0.3;
+ param = 360*TheVal;
+ cred = par2*cosd( param );
+ cblu = par2*sind( param );
+ ( (cred,cblu,1) )
+ endgroup
+enddef;
+
+f := (4,3,2);
+Spread := 170;
+ShadowOn := true;
+
+beginfig(1);
+ emptyline( true, 1, black, 0.5background, 360, 0.88, 2, closec );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/experimental.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/experimental.mp
new file mode 100644
index 00000000000..106e7574f2a
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/experimental.mp
@@ -0,0 +1,177 @@
+% experimental.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+%verbatimtex
+%\documentclass{article}
+%\usepackage{beton}
+%\usepackage{concmath}
+%\usepackage{ccfonts}
+%\begin{document}
+%etex
+
+verbatimtex
+\documentclass{article}
+\usepackage{palatino}
+\begin{document}
+etex
+
+f := (4.5,-6,5);
+
+beginfig(1);
+ numeric len[], ray[];
+ color axe[], pos[], fix[], lab[];
+ color reflabpos, reflabpoi, lincolor;
+ picture txt[], dashpatt;
+ numeric inclang, aberang, sampang, stepang;
+ numeric squside, sqlevel, ul, outermagpos;
+ numeric innerray, polesep, fracone, fracsam;
+ numeric labelscale;
+ path tmpath, aupath, copath;
+
+ pickup pencircle scaled 1.2pt;
+ dashpatt = evenly scaled 3;
+ inclang = 150;
+ aberang = 17;
+ sampang = 30;
+ stepang = 20;
+ ul = 0.1;
+ labelscale = 5;
+ outermagpos = 30ul;
+ squside = outermagpos;
+ sqlevel = -20ul;
+ polesep = 15ul;
+ fracone = 0.33;
+ fracsam = 0.86;
+ ray1 = 10ul;
+ ray2 = 6ul;
+ ray3 = 8ul;
+ ray4 = 1.5ul;
+ ray5 = 4ul;
+ ray6 = 3ul;
+ ray7 = 3.5ul;
+ ray8 = 2ul;
+ len3 = 7ul;
+ len4 = 20ul;
+ len5 = 3ul;
+ len7 = 3.5ul;
+ len8 = 7ul;
+ lincolor = 0.5background;
+
+ reflabpos = ( -squside, 0, -sqlevel );
+ reflabpoi = ( -squside, squside, -sqlevel );
+ V1 := (squside,squside,sqlevel);
+ V2 := (-squside,squside,sqlevel);
+ V3 := (-squside,-squside,sqlevel);
+ V4 := (squside,-squside,sqlevel);
+% makeface1(1,2,3,4);
+
+ len1 = (1-fracone)*(outermagpos-ray5-polesep);
+ pos1 = (-outermagpos,0,0);
+ rigorousdisc( 0, true, pos1, ray1, len1*(1,0,0) );
+
+ len2 = fracone*(outermagpos-ray5-polesep);
+ pos2 = (len1-outermagpos,0,0);
+ tmpath := goodcirclepath( pos2, (1,0,0), ray1 );
+ aupath := goodcirclepath( (-ray5-polesep,0,0), (1,0,0), ray2 );
+ copath := twocyclestogether( tmpath, aupath );
+ unfill copath;
+ draw copath;
+ draw aupath;
+ lab2 = reflabpos;
+ txt2 = thelabel.top( btex magneto etex scaled labelscale, rp( lab2 ) );
+ draw txt2;
+ fix2 = (-outermagpos+0.5len1,0,ray1);
+ draw llcorner txt2--lrcorner txt2--rp(fix2) withcolor lincolor;
+
+ axe3 = ( 0, cosd( inclang ), sind( inclang ) );
+ pos3 = -( len3 + len4 + len5 )*axe3;
+ rigorousdisc( 0, true, pos3, ray3, len3*axe3 );
+ lab3 = (1-fracone)*reflabpoi+fracone*V1;
+ txt3 = thelabel.rt( btex rotor etex scaled labelscale, rp( lab3 ) );
+ draw txt3;
+
+ axe4 = axe3;
+ pos4 = -( len4 + len5 )*axe4;
+ rigorousdisc( 0, true, pos4, ray4, len4*axe4 );
+
+ fix3 = pos4+fracsam*ray3*(0,cosd( inclang -90 ),sind( inclang -90 ));
+ draw lrcorner txt3--llcorner txt3--rp(fix3) withcolor lincolor;
+
+ axe5 = axe3;
+ pos5 = -( len5 )*axe5;
+ rigorousdisc( 0, true, pos5, ray5, len5*axe5 );
+ lab5 = (1-fracone)*reflabpoi+fracone*V2;
+ txt5 = thelabel.rt( btex porta-amostras etex scaled labelscale, rp( lab5 ) );
+ draw txt5;
+ fix5 = fracsam*ray5*(0,cosd( inclang -90 ),sind( inclang -90 ));
+ draw lrcorner txt5--llcorner txt5--rp(fix5) withcolor lincolor;
+
+ V5 := fracsam*ray5*( sind( sampang ),
+ cosd( sampang )*cosd( inclang -90 ),
+ cosd( sampang )*sind( inclang -90 ) );
+ V6 := fracsam*ray5*( -sind( sampang ),
+ cosd( sampang )*cosd( inclang -90 ),
+ cosd( sampang )*sind( inclang -90 ) );
+ V8 := fracsam*ray5*( sind( sampang ),
+ -cosd( sampang )*cosd( inclang -90 ),
+ -cosd( sampang )*sind( inclang -90 ) );
+ V7 := fracsam*ray5*( -sind( sampang ),
+ -cosd( sampang )*cosd( inclang -90 ),
+ -cosd( sampang )*sind( inclang -90 ) );
+ draw rp(V5)--rp(V6)--rp(V7)--rp(V8)--cycle;
+
+ axe6 = ( 0, cosd( inclang+aberang ), sind( inclang+aberang ) );
+ pos6 = ray1*axe6;
+ len6 = len4;
+ axe7 = ( 0, cosd( inclang-aberang ), sind( inclang-aberang ) );
+ pos7 = ( ray1 + 0.5len6 )*axe7;
+ draw rp(pos6)--rp((0,0,0))--rp(pos7) dashed dashpatt;
+ rigorousdisc( 0, true, pos6, ray6, len6*axe6 );
+ lab6 = fracone*reflabpos+(1-fracone)*V3;
+ txt6 = thelabel.lft( btex telemicrosc\'{o}pio etex scaled labelscale, rp( lab6 ) );
+ draw txt6;
+ fix6 = pos6+len6*axe6;
+ draw llcorner txt6--lrcorner txt6--rp(fix6) withcolor lincolor;
+
+ pos8 = pos7+len7*axe7;
+ tmpath := goodcirclepath( pos7, axe7, ray7 );
+ aupath := goodcirclepath( pos8, axe7, ray8 );
+ copath := twocyclestogether( tmpath, aupath );
+ unfill copath;
+ draw copath;
+ draw aupath;
+
+ axe8 = axe7;
+ rigorousdisc( 0, true, pos8, ray8, len8*axe8 );
+ lab8 = (1-fracone)*reflabpos+fracone*V3;
+ txt8 = thelabel.lft( btex l\^{a}mpada etex scaled labelscale, rp( lab8 ) );
+ draw txt8;
+ fix8 = pos8+len8*axe8;
+ draw llcorner txt8--lrcorner txt8--rp(fix8) withcolor lincolor;
+
+ len9 = len2;
+ pos9 = (ray5+polesep,0,0);
+ ray9 = ray2;
+ ray10 = ray1;
+ tmpath := goodcirclepath( pos9, (1,0,0), ray9 );
+ pos10 = pos9+len9*(1,0,0);
+ aupath := goodcirclepath( pos10, (1,0,0), ray10 );
+ copath := twocyclestogether( tmpath, aupath );
+ unfill copath;
+ draw copath;
+ draw aupath;
+
+ len10 = len1;
+ rigorousdisc( 0, true, pos10, ray10, len10*(1,0,0) );
+
+ produce_auto_scale;
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/fieldlines.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/fieldlines.mp
new file mode 100644
index 00000000000..bcb018a0f7f
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/fieldlines.mp
@@ -0,0 +1,59 @@
+% fieldlines.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+Spread := 30;
+f := (10,0,0);
+
+color posa, posb;
+numeric kfac;
+posa = -5*green;
+posb = 5*green;
+kfac = 2.5;
+
+def vecfunc( expr posit )=
+ begingroup
+ save modula, modulb, field;
+ color field;
+ numeric modula, modulb;
+ modula = conorm( posit-posa );
+ modulb = conorm( posit-posb );
+ field = ( posit-posa )/(modula**3)+kfac*( posit-posb )/(modulb**3);
+ ( field )
+ endgroup
+enddef;
+
+beginfig(1);
+ numeric i, lena, lenb, numa, numb, sa, sb, diffstep, ray;
+ color stp;
+ path oneline;
+ pen grossa, fina;
+ grossa = pencircle scaled 3pt;
+ fina = pencircle scaled 2pt;
+ lena = 105;
+ lenb = 145;
+ numa = 72;
+ numb = 30;
+ diffstep = 1;
+ ray = 0.5;
+ sa = 36;
+ sb = 75;
+ for i=sa step numa until (360+sa):
+ stp := posa+( 0, ray*cosd(i), ray*sind(i) );
+ oneline := fieldlinepath( lena, stp, diffstep, vecfunc );
+ draw oneline withpen grossa;
+% draw oneline withpen fina withcolor background;
+ endfor;
+ for i=sb step numb until (360+sb):
+ stp := posb+( 0, ray*cosd(i), ray*sind(i) );
+ oneline := fieldlinepath( lenb, stp, diffstep, vecfunc );
+ draw oneline withpen grossa;
+% draw oneline withpen fina withcolor background;
+ endfor;
+ draw rp(posa) withpen grossa;
+ draw rp(posb) withpen grossa;
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/fis3prey.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/fis3prey.mp
new file mode 100644
index 00000000000..c1b32219687
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/fis3prey.mp
@@ -0,0 +1,128 @@
+% fis3prey.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ Spread := 50;
+ f := (4,6,3.5);
+ path malhacub, rama, ramb, ramc, malhatet;
+ pen grossa, nuclear, negat;
+ color p[];
+ numeric lengax, lscal, arrowmarg, arrowshift;
+ pair tx, ty, tz;
+ lengax = 0.7;
+ lscal = 2;
+ arrowshift = 0.85;
+ arrowmarg = 0.13;
+ grossa = pencircle scaled 2.7pt;
+ nuclear = pencircle scaled 2.1pt;
+ negat = pencircle scaled 1.8pt;
+ p1 = (1,1,-1);
+ p2 = (-1,1,-1);
+ p3 = (-1,-1,-1);
+ p4 = (1,-1,-1);
+ p5 = (1,1,1);
+ p6 = (-1,1,1);
+ p7 = (-1,-1,1);
+ p8 = (1,-1,1);
+
+ p0 = p2 + arrowshift*N((1,0,1)) + arrowmarg*N((-1,0,1));
+ p9 = p5 - arrowshift*N((1,0,1)) + arrowmarg*N((-1,0,1));
+
+ z1 = rp(p1);
+ z2 = rp(p2);
+ z3 = rp(p3);
+ z4 = rp(p4);
+ z5 = rp(p5);
+ z6 = rp(p6);
+ z7 = rp(p7);
+ z8 = rp(p8);
+
+ z0 = rp(p0);
+ z9 = rp(p9);
+
+ tx = rp( p1 - (lengax,0,0) );
+ ty = rp( p1 - (0,lengax,0) );
+ tz = rp( p1 + (0,0,lengax) );
+
+ malhacub = z1--z2--z3--z4--z1--z5--z6--z7--z8--z5;
+ malhatet = z2--z7--z4--z5--cycle;
+ rama = z2--z6;
+ ramb = z3--z7;
+ ramc = z4--z8;
+ drawoptions( dashed evenly );
+ draw malhacub;
+ draw rama;
+ draw ramb;
+ draw ramc;
+ drawoptions( withpen grossa );
+ draw malhatet;
+
+ drawarrow z1--tx withpen negat;
+ drawarrow z1--ty withpen negat;
+ drawarrow z1--tz withpen negat;
+ label.lrt(btex $x$ etex scaled lscal, tx);
+ label.llft(btex $y$ etex scaled lscal, ty);
+ label.lft(btex $z$ etex scaled lscal, tz);
+ drawarrow z0--z9 withpen negat;
+endfig;
+
+beginfig(2);
+ Spread := 50;
+ f := 2.3*(6,2,3.5);
+ numeric lang, cray, lpos, llen, smar;
+ path circ, rigcirc, lone, ltwo, carrpath;
+ pen pena, penb, penc;
+ pena = pencircle scaled 1.3mm;
+ penb = pencircle scaled 0.95mm;
+ penc = pencircle scaled 0.4mm;
+ color outcol, incol;
+ outcol = black;
+ incol = 0.876white;
+ lang = 30;
+ cray = 1;
+ lpos = 0.57;
+ llen = 2.2;
+ smar = 0.15;
+ circ = goodcirclepath( black, green, cray );
+ rigcirc = rigorouscircle( black, green, cray+smar );
+ carrpath = subpath (3.2,4.5) of rigcirc;
+ lone = rp((-lpos,llen*cosd(lang),llen*sind(lang)))
+ --rp(-(lpos,llen*cosd(lang),llen*sind(lang)));
+ ltwo = rp((lpos,-llen*cosd(lang),llen*sind(lang)))
+ --rp((lpos,llen*cosd(lang),-llen*sind(lang)));
+ drawarrow carrpath withpen penc withcolor outcol;
+ draw circ withpen pena withcolor outcol;
+ draw circ withpen penb withcolor incol;
+ draw rp((-cray,0,0))--rp((-lpos,0,0)) dashed evenly;
+ draw lone withpen pena withcolor outcol;
+ draw lone withpen penb withcolor incol;
+ draw rp((lpos,0,0))--rp((-lpos,0,0)) dashed evenly;
+ draw rp((0,0,-cray))--rp((0,0,cray)) dashed evenly;
+ draw ltwo withpen pena withcolor outcol;
+ draw ltwo withpen penb withcolor incol;
+ draw rp((cray,0,0))--rp((lpos,0,0)) dashed evenly;
+ draw subpath (1,15) of circ withpen pena withcolor outcol;
+ draw subpath (0,16) of circ withpen penb withcolor incol;
+
+
+
+% label.top( btex $+$ etex, point 3 of rigcirc );
+
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/frustum.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/frustum.mp
new file mode 100644
index 00000000000..90da3d74440
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/frustum.mp
@@ -0,0 +1,46 @@
+% frustum.mp
+% L. Nobre G.
+% IYP (2005)
+
+verbatimtex
+\documentclass{article}
+\begin{document}
+{\sffamily
+etex
+
+beginfig(1);
+% f := (5,3,4);
+ f := (5,3,0.4);
+% f := (5,3,-0.4);
+ numeric labscal;
+ picture labsa, labba, labsb, labd, labc;
+ labscal = 2;
+ ahlength := 8pt;
+ ahangle := 30;
+ labc = btex $\vec{c}$ etex scaled labscal;
+ labsa = btex $\vec{S}_1$ etex scaled labscal;
+ labsb = btex $\vec{S}_2$ etex scaled labscal;
+ labba = btex $\vec{B}_1$ etex scaled labscal;
+ labd= btex $D$ etex scaled labscal;
+ drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue );
+ whatisthis( black, 0.5red, green, 0.85, 0.8 );
+ drawoptions( withpen pencircle scaled 1.3pt );
+ drawdblarrow rp(black)--rp(0.85blue);
+ label.rt( labd, rp(0.4blue) );
+ drawarrow rp(black)--rp(0.5red);
+ label.ulft( labsa, rp(0.25red) );
+ drawarrow rp(black)--rp(green);
+ label.top( labba, rp((0,0.5,0)) );
+ drawarrow rp(0.85blue)--rp(0.8*0.5*red+0.85blue);
+ label.ulft( labsb, rp(0.2red+0.85blue) );
+ dotlabel.bot( labc, rp(black) );
+endfig;
+
+verbatimtex
+}
+\end{document}
+etex
+
+end.
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/geom_casq.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/geom_casq.mp
new file mode 100644
index 00000000000..bdc52c58d89
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/geom_casq.mp
@@ -0,0 +1,84 @@
+% geom_casq.mp
+% L. Nobre G.
+% 1999
+
+%input featpost3Dplus2D;
+
+%input la3Dmacros;
+%input hlr3Dmacros;
+%input plan2Dmacros;
+%
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+
+ f := (1.7,1.2,1);
+
+ Spread := 150;
+
+ color gridvec, sizevec, currpos, starpos, bordpos, orig, axxc, ayyc, azzc;
+ numeric alphamax, long, base, thetamax;
+ axxc = (0.8,0,0);
+ ayyc = (0,0.7,0);
+ azzc = (0,0,0.4);
+ sizevec := (11,9,9);
+ gridvec := (0.1,0.1,0.1);
+ thetamax := 50;
+ alphamax := 70;
+ long := 0.65;
+ base := 0.3;
+ starpos := ( -0.5*X(gridvec)*(X(sizevec)-1) ,
+ -0.5*Y(gridvec)*(Y(sizevec)-1) ,
+ -0.5*Z(gridvec)*(Z(sizevec)-1) );
+ bordpos := starpos - 0.5*gridvec;
+ orig := starpos + 0.5*gridvec + (0.05,0,-0.1);
+ npf1 := 4;
+ F1p1 := bordpos;
+ F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
+ npf2 := 4;
+ F2p1 := (X(bordpos),Y(bordpos), -Z(bordpos));
+ F2p2 := (X(bordpos),-Y(bordpos), -Z(bordpos));
+ F2p3 := (-X(bordpos),-Y(bordpos), -Z(bordpos));
+ F2p4 := (-X(bordpos),Y(bordpos), -Z(bordpos));
+ NF := 2;
+
+ pickup pencircle scaled 1pt;
+ drawarrow rp(orig)..rp(orig+axxc);
+ drawarrow rp(orig)..rp(orig+ayyc);
+ drawarrow rp(orig)..rp(orig+azzc);
+ label.bot(btex z etex,rp(orig+axxc));
+ label.bot(btex x etex,rp(orig+ayyc));
+ label.lft(btex y etex,rp(orig+azzc));
+ pickup pencircle scaled 1.5pt;
+
+ starpos := (base,0,0)+orig;
+ drawarrow rp(orig)..rp(starpos);
+ label.bot(btex $\vec{n}_0$ etex,rp(starpos));
+
+ currpos := starpos;
+ starpos := long*(cosd(alphamax),sind(alphamax),0)+orig;
+ drawarrow rp(orig)..rp(starpos);
+ label.bot(btex $\vec{H}$ etex,rp(starpos));
+ angline(starpos,currpos,orig,0.55,btex $\alpha$ etex,bot);
+
+ starpos := base*(cosd(thetamax),sind(thetamax),0)+orig;
+ drawarrow rp(orig)..rp(starpos);
+ label.bot(btex $\vec{n}$ etex,rp(starpos));
+ angline(starpos,currpos,orig,0.2,btex $\theta$ etex,bot);
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/geom_freder.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/geom_freder.mp
new file mode 100644
index 00000000000..9a834001aab
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/geom_freder.mp
@@ -0,0 +1,94 @@
+% geom_freder.mp
+% L. Nobre G.
+% 2000
+
+%input featpost3Dplus2D;
+
+verbatimtex \documentclass{article} \usepackage{beton} \usepackage{concmath} \usepackage{ccfonts} \begin{document} etex
+
+beginfig(1);
+
+ f := (1.7,1.2,1);
+
+ Spread := 250;
+
+ color gridvec, sizevec, currpos, starpos, bordpos;
+ numeric i, j, k, counter, theta, phi, long, base, thetamax;
+ path closingface;
+ sizevec := (11,9,7);
+ gridvec := (0.1,0.1,0.1);
+ thetamax := 50;
+ long := 0.08;
+ base := 0.1;
+ starpos := ( -0.5*X(gridvec)*(X(sizevec)-1) ,
+ -0.5*Y(gridvec)*(Y(sizevec)-1) ,
+ -0.5*Z(gridvec)*(Z(sizevec)-1) );
+ bordpos := starpos - 0.5*gridvec;
+ npf1 := 4;
+ F1p1 := bordpos;
+ F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
+ npf2 := 4;
+ F2p1 := (X(bordpos),Y(bordpos), -Z(bordpos));
+ F2p2 := (X(bordpos),-Y(bordpos), -Z(bordpos));
+ F2p3 := (-X(bordpos),-Y(bordpos), -Z(bordpos));
+ F2p4 := (-X(bordpos),Y(bordpos), -Z(bordpos));
+ NF := 2;
+ draw facepath(1);
+ counter := 1;
+ for i= X(sizevec) upto X(sizevec):
+ for j=1 upto Y(sizevec):
+ for k=1 upto Z(sizevec):
+ phi := 0;
+ theta := 0;
+ currpos := starpos+( (i-1)*X(gridvec) ,
+ (j-1)*Y(gridvec) ,
+ (k-1)*Z(gridvec) );
+ phi := thetamax*cosd(90*Z(currpos)/abs(Z(starpos)));
+ theta := 90+thetamax*cosd(90*Z(currpos)/abs(Z(starpos)));
+ generatedirline( counter, phi, theta, long, currpos );
+ counter := incr(counter);
+ endfor;
+ endfor;
+ endfor;
+ for i=1 upto X(sizevec)-1:
+ for j=Y(sizevec) upto Y(sizevec):
+ for k=1 upto Z(sizevec):
+ phi := 0;
+ theta := 0;
+ currpos := starpos+( (i-1)*X(gridvec) ,
+ (j-1)*Y(gridvec) ,
+ (k-1)*Z(gridvec) );
+ phi := thetamax*cosd(90*Z(currpos)/abs(Z(starpos)));
+ theta := 90+thetamax*cosd(90*Z(currpos)/abs(Z(starpos)));
+ generatedirline( counter, phi, theta, long, currpos );
+ counter := incr(counter);
+ endfor;
+ endfor;
+ endfor;
+ NL := decr(counter);
+ director_invisible( true, base, false );
+ closingface = facepath(2);
+ fill closingface withcolor background;
+ draw closingface;
+ pickup pencircle scaled 1pt;
+ currpos := (-X(bordpos)+X(gridvec),Y(bordpos), Z(bordpos));
+ starpos := (-X(bordpos)+X(gridvec),Y(bordpos)+4*Y(gridvec), Z(bordpos));
+ drawarrow rp(currpos)..rp(starpos);
+ label.bot(btex $y$ etex,rp(starpos));
+ currpos := (-X(bordpos)+X(gridvec),Y(bordpos), Z(bordpos));
+ starpos := (-X(bordpos)+X(gridvec),Y(bordpos), Z(bordpos)+4*Z(gridvec));
+ drawarrow rp(currpos)..rp(starpos);
+ label.lft(btex $z$ etex,rp(starpos));
+ currpos := (X(bordpos),-Y(bordpos)+Y(gridvec), Z(bordpos));
+ starpos := (X(bordpos)+4*X(gridvec),-Y(bordpos)+Y(gridvec), Z(bordpos));
+ drawarrow rp(currpos)..rp(starpos);
+ label.bot(btex $x$ etex,rp(starpos));
+
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/graphexample.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/graphexample.mp
new file mode 100644
index 00000000000..6591ed5d0f9
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/graphexample.mp
@@ -0,0 +1,16 @@
+% graphexample.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+input mp-tool;
+
+beginfig(1);
+ path thezigzag;
+ thezigzag = zigzagfrontier( origin, (200,200), 17,
+ 4, 20, 16, 12, blue, background );
+ draw thezigzag;
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/lcurvature.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/lcurvature.mp
new file mode 100644
index 00000000000..ca6d5670457
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/lcurvature.mp
@@ -0,0 +1,114 @@
+% lcurvature.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ f := (5,3,4);
+ Spread := 70;
+ numeric gridstep, anglstep, cylength, cyradius, numcylis;
+ numeric i, j, curcoord, vcx, vcy, vcz, curangle, curnorma;
+ numeric major, othcoord, othangle;
+ color base, lenvec;
+ cylength := 0.1;
+ cyradius := 0.3;
+ gridstep := cyradius*2.2;
+ anglstep := 10;
+ numcylis := 5;
+ major := 0.35*gridstep*numcylis;
+ for i=1 upto numcylis: % bend
+ curnorma := i-0.5*(numcylis+1);
+ curangle := curnorma*anglstep;
+ vcx := cylength*cosd(curangle);
+ vcy := 0;
+ vcz := cylength*sind(curangle);
+ base := major*(sind(curangle),-1,-cosd(curangle));
+ lenvec := (vcx,vcy,vcz);
+ rigorousdisc( 0, true,base,cyradius,lenvec);
+ endfor;
+ for i=1 upto numcylis: % twist
+ curnorma := i-0.5*(numcylis+1);
+ curcoord := curnorma*gridstep;
+ curangle := curnorma*anglstep;
+ vcx := 0;
+ vcy := cylength*sind(curangle);
+ vcz := cylength*cosd(curangle);
+ base := (curcoord,-vcy/2-major,-vcz/2+major);
+ lenvec := (vcx,vcy,vcz);
+ rigorousdisc( 0, true,base,cyradius,lenvec);
+ endfor;
+ for i=1 upto numcylis: % splay
+ curnorma := i-0.5*(numcylis+1);
+ curcoord := curnorma*gridstep;
+ curangle := curnorma*anglstep;
+ vcx := cylength*sind(curangle);
+ vcy := 0;
+ vcz := -cylength*cosd(curangle);
+ lenvec := (vcx,vcy,vcz);
+ for j=1 upto numcylis:
+ othcoord := (j-0.5*(numcylis+1))*gridstep;
+ base := major*(0,1,-cosd(curangle));
+ base := base +(curcoord,othcoord,0);
+ rigorousdisc( 0, true,base,cyradius,lenvec);
+ endfor;
+ endfor;
+ for i=1 upto numcylis: % saddle
+ curnorma := i-0.5*(numcylis+1);
+ curcoord := curnorma*gridstep;
+ curangle := curnorma*anglstep;
+ vcx := cylength*sind(curangle);
+ for j=1 upto numcylis:
+ othcoord := (j-0.5*(numcylis+1))*gridstep;
+ othangle := (j-0.5*(numcylis+1))*anglstep;
+ vcy := -cylength*sind(othangle);
+ vcz := -cylength*cosd(curangle)*cosd(othangle);
+ base := major*(0,1,1-cosd(curangle)+cosd(othangle));
+ base := base + (curcoord,othcoord,0);
+ lenvec := (vcx,vcy,vcz);
+ rigorousdisc( 0, true,base,cyradius,lenvec);
+ endfor;
+ endfor;
+endfig;
+
+beginfig(2);
+ f := (5,3,4);
+ Spread := 70;
+ numeric gridstep, cylength, cyradius, numcylis;
+ numeric i, j, curcoord, curangle, curnorma;
+ numeric othcoord, othangle, zcoord, coef, othnorma;
+ color base, lenvec;
+ cylength := 0.1;
+ cyradius := 0.3;
+ gridstep := cyradius*2.2;
+ numcylis := 5;
+ coef := 0.32;
+ for i=1 upto numcylis: % splay
+ curnorma := i-0.5*(numcylis+1);
+ curcoord := curnorma*gridstep;
+ curangle := -curcoord*2*coef;
+ for j=1 upto numcylis:
+ othnorma := j-0.5*(numcylis+1);
+ othcoord := othnorma*gridstep;
+ othangle := -othcoord*2*coef;
+ zcoord := -coef*(othcoord**2+curcoord**2);
+ base := (curcoord,othcoord,zcoord);
+ lenvec := cylength*N((-curangle,-othangle,1));
+ rigorousdisc( 0, true,base,cyradius,lenvec);
+ endfor;
+ endfor;
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/mptoolcone.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/mptoolcone.mp
new file mode 100644
index 00000000000..4053632efb5
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/mptoolcone.mp
@@ -0,0 +1,49 @@
+% mptoolcone.mp
+% L. Nobre G.
+% Y2K
+
+%input featpost3Dplus2D;
+
+input mp-tool;
+
+ defaultscale := 1.1;
+% defaultfont := "putr8r";
+ defaultfont := "bchr8r";
+
+beginfig(0);
+ color orig, axxc, ayyc, azzc;
+ color nalfa, gammacnt;
+ path gamma, cone, mybox;
+ numeric theta, radius, xxsize, yysize, zzsize;
+ picture mypict;
+
+ f := (3,4,2);
+ Spread := 100;
+ xxsize = 0.8;
+ yysize = 0.8;
+ zzsize = 1.0;
+ theta = 25;
+
+ orig = (0,0,0);
+ mypict = thelabel("Texto com acentuação.",rp(orig));
+ mybox = bbox mypict;
+ draw mypict;
+ draw mybox;
+ axxc = (xxsize,0,0);
+ ayyc = (0,yysize,0);
+ azzc = (0,0,zzsize);
+ nalfa = (0,sind(theta),cosd(theta));
+ gammacnt = cosd(theta)*cosd(theta)*nalfa;
+ radius := cosd(theta)*sind(theta);
+ gamma = rigorouscircle( gammacnt, nalfa, radius );
+ cone = rigorouscone(true, gammacnt, nalfa, radius, (xxsize,yysize,0) );
+ draw gamma dashed evenly;
+ draw cone;
+ drawarrow rp(orig)..rp(axxc);
+ drawarrow rp(orig)..rp(ayyc);
+ drawarrow rp(orig)..rp(azzc);
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/nembends.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nembends.mp
new file mode 100644
index 00000000000..5900e88d187
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nembends.mp
@@ -0,0 +1,48 @@
+% nembends.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+%input mp-tool;
+
+beginfig(1);
+ f := 2*(5,3,4);
+ Spread := 70;
+
+ numeric hsdev, basestep, basxstep, basesdev;
+ numeric i, j, k, coesdev, cylength, cyradius, basen;
+ numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, aone;
+ numeric atwo, zcurr, coestep, angsdev, basxsdev;
+ color lenvec, currpos;
+
+
+ coestep := -0.15;
+ cylength := 0.6;
+ cyradius := 0.1;
+ basen := 3;
+ basestep := cylength*1.6;
+ basxstep := cyradius*4;
+ basesdev := basestep*0.001;
+ basxsdev := basxstep*0.001;
+ hsdev := 0.005;
+ coesdev := 0.001;
+ angsdev := 0.02;
+ for i=-basen upto basen:
+ for j=-basen upto basen:
+ xcurr := i*basxstep + basxsdev*normaldeviate;
+ ycurr := j*basestep + basesdev*normaldeviate;
+ zcurr := ycurr**2*coestep + coesdev*normaldeviate;
+ aone := angsdev*normaldeviate;
+ atwo :=angle(1,ycurr*2*coestep)+angsdev*normaldeviate;
+ vcz := cosd( aone )*sind( atwo );
+ vcy := cosd( aone )*cosd( atwo );
+ vcx := sind( aone );
+ currpos := ( xcurr, ycurr, zcurr );
+ lenvec := cylength*( vcx, vcy, vcz );
+ rigorousdisc(0,true,currpos-0.5*lenvec,cyradius,lenvec);
+ endfor;
+ endfor;
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemdirector.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemdirector.mp
new file mode 100644
index 00000000000..4c1d88fe095
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemdirector.mp
@@ -0,0 +1,82 @@
+% nemdirector.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+%\usepackage{mathpazo}
+\begin{document}
+etex
+
+beginfig(1);
+ f := 2*(5,3,4);
+ Spread := 70;
+
+ numeric cylength, cyradius, zoneradi, zoneleng;
+ numeric i, angsdev, halfnum, directlen, arrthick;
+ numeric vcx, vcy, vcz, xcurr, ycurr, thickfact;
+ numeric atwo, zcurr, aone, apos;
+ color lenvec, currpos, tippos;
+ path arrpath;
+ picture tmppict;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Nu
+ cylength := 0.45;
+ cyradius := 0.1;
+ zoneradi := 2;
+ zoneleng := 4;
+ directlen := 5.6;
+ angsdev := 12;
+ halfnum := 130;
+ thickfact := 5;
+ arrthick := Spread*ps( (0,0,0), thickfact );
+ tippos := (0,0,0.5*directlen);
+ arrpath := rp(-tippos)--rp(tippos);
+ ahlength := 3*arrthick;
+ ahangle := 40;
+ for i=1 upto halfnum:
+ zcurr := -0.5*zoneleng+uniformdeviate( zoneleng );
+ apos := uniformdeviate( 180 );
+ xcurr := -zoneradi*cosd( apos )*uniformdeviate( 1 );
+ ycurr := zoneradi*sind( apos )*uniformdeviate( 1 );
+ aone := uniformdeviate( 360 );
+ atwo := angsdev*normaldeviate;
+ vcz := cosd( atwo );
+ vcy := sind( atwo )*sind( aone );
+ vcx := sind( atwo )*cosd( aone );
+ currpos := ( xcurr, ycurr, zcurr );
+ lenvec := cylength*( vcx, vcy, vcz );
+ generatedirline( i, aone, 90-atwo, cylength, currpos );
+ endfor;
+ NL:= halfnum;
+ director_invisible( true, thickfact, false );
+ drawarrow arrpath withpen pencircle scaled arrthick;
+ for i=1 upto halfnum:
+ zcurr := -0.5*zoneleng+uniformdeviate( zoneleng );
+ apos := uniformdeviate( 180 );
+ xcurr := zoneradi*cosd( apos )*uniformdeviate( 1 );
+ ycurr := zoneradi*sind( apos )*uniformdeviate( 1 );
+ aone := uniformdeviate( 360 );
+ atwo := angsdev*normaldeviate;
+ vcz := cosd( atwo );
+ vcy := sind( atwo )*sind( aone );
+ vcx := sind( atwo )*cosd( aone );
+ currpos := ( xcurr, ycurr, zcurr );
+ lenvec := cylength*( vcx, vcy, vcz );
+ generatedirline( i, aone, 90-atwo, cylength, currpos );
+ endfor;
+ NL:= halfnum;
+ director_invisible( true, thickfact, false );
+ label.ulft(btex $\vec{n}$ etex scaled 8.5 rotated 90, rp(tippos) );
+ tmppict := currentpicture rotated -90;
+ currentpicture := nullpicture;
+ draw tmppict;
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemquira.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemquira.mp
new file mode 100644
index 00000000000..41caf4578a6
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemquira.mp
@@ -0,0 +1,60 @@
+% nemquira.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+
+
+beginfig(1);
+ f := 7*(1,2,1);
+ Spread := 70;
+
+ numeric hstep, hmax, hsdev, basestep, basemax, basesdev;
+ numeric i, j, k, angsdev, cylength, cyradius, basen, hn;
+ numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, hbase, aone;
+ numeric atwo, zcurr, angstep, counter;
+ color lenvec, currpos;
+
+ angstep := 20;
+ cylength := 0.45;
+ cyradius := 0.1;
+ basen := 4.5;
+ hn := 1;
+ basestep := cylength*1.37;
+ hstep := basestep;
+ basesdev := basestep*0.05;
+ hsdev := basesdev;
+ hbase := -0.8;
+ angsdev := 4;
+
+ basemax := basen*basestep;
+ hmax := hn*hstep;
+ counter := 0;
+ for i=-basen upto basen:
+ for j=-basen upto basen:
+ hcurr := hbase;
+ forever:
+ exitunless hcurr < hmax+hbase;
+ hcurr := hcurr + hstep;
+ zcurr := hcurr + hsdev*normaldeviate;
+ xcurr := i*basestep + basesdev*normaldeviate;
+ ycurr := j*basestep + basesdev*normaldeviate;
+ aone := angsdev*normaldeviate;
+ atwo := j*angstep + angsdev*normaldeviate;
+ vcz := sind( atwo+90 );
+ vcy := cosd( atwo+90 )*sind( aone );
+ vcx := cosd( atwo+90 )*cosd( aone );
+ currpos := ( xcurr, ycurr, zcurr );
+ lenvec := cylength*( vcx, vcy, vcz );
+% rigorousdisc( 0, true, currpos-0.5*lenvec, cyradius, lenvec);
+ counter := incr(counter);
+ generatedirline( counter, aone, 90+atwo, cylength, currpos );
+ endfor;
+ endfor;
+ endfor;
+ NL := counter;
+ director_invisible( true, 5, false );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemquirapitch.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemquirapitch.mp
new file mode 100644
index 00000000000..d29f0ffeb10
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemquirapitch.mp
@@ -0,0 +1,69 @@
+% nemquirapitch.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ f := 7*(1,2,1);
+ Spread := 70;
+ ahlength := 3mm;
+ ahangle := 48;
+
+ numeric hsdev, basestep, basemax, basesdev, xpos;
+ numeric i, j, angsdev, cylength, cyradius, basen;
+ numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, aone;
+ numeric atwo, zcurr, angstep, counter, linelen;
+ color lenvec, currpos;
+
+ angstep := 20;
+ cylength := 0.45;
+ cyradius := 0.1;
+ basen := 4.5;
+ basestep := cylength*1.37;
+ basesdev := basestep*0.05;
+ hsdev := basesdev;
+ angsdev := 4;
+ linelen := cylength;
+
+ basemax := basen*basestep;
+ xpos := -(basen+1)*basestep;
+ draw rp((-xpos-0.5*cylength,-basemax,0))--rp((-xpos+0.5*cylength,-basemax,0));
+ draw rp((-xpos-0.5*cylength,basemax,0))--rp((-xpos+0.5*cylength,basemax,0));
+ drawdblarrow rp((-xpos,-basemax,0))--rp((-xpos,basemax,0));
+ label.urt( btex $\frac{p}{2}$ etex scaled 2.5, rp((-xpos,0,0)) );
+ counter := 0;
+ for i=-basen upto basen:
+ for j=-basen upto basen:
+ zcurr := hsdev*normaldeviate;
+ xcurr := i*basestep + basesdev*normaldeviate;
+ ycurr := j*basestep + basesdev*normaldeviate;
+ aone := angsdev*normaldeviate;
+ atwo := j*angstep + angsdev*normaldeviate;
+ vcz := sind( atwo+90 );
+ vcy := cosd( atwo+90 )*sind( aone );
+ vcx := cosd( atwo+90 )*cosd( aone );
+ currpos := ( xcurr, ycurr, zcurr );
+ lenvec := cylength*( vcx, vcy, vcz );
+% rigorousdisc( 0, true, currpos-0.5*lenvec, cyradius, lenvec);
+ counter := incr(counter);
+ generatedirline( counter, aone, 90+atwo, cylength, currpos );
+ endfor;
+ endfor;
+ NL := counter;
+ director_invisible( true, 5, false );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemuniax.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemuniax.mp
new file mode 100644
index 00000000000..b2ebec11c8f
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/nemuniax.mp
@@ -0,0 +1,61 @@
+% nemuniax.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ f := 2*(5,3,4);
+ Spread := 70;
+
+ numeric hstep, hmax, hsdev, basestep, basemax, basesdev;
+ numeric i, j, k, angsdev, cylength, cyradius, basen, hn;
+ numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, hbase, aone;
+ numeric atwo, zcurr, counter;
+ color lenvec, currpos;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Nu
+ cylength := 0.6;
+ cyradius := 0.1;
+ basen := 12;
+ hn := 5;
+ basestep := cyradius*3.1;
+ hstep := cylength*1.5;
+ basesdev := cyradius*0.1;
+ hsdev := hstep*0.2;
+ hbase := -0.8;
+ angsdev := 12;
+
+ basemax := basen*basestep;
+ hmax := hn*hstep;
+ counter := 0;
+ for i=1 upto basen:
+ for j=1 upto basen:
+ hcurr := hbase;
+ forever:
+ exitunless hcurr < hmax+hbase;
+ hcurr := hcurr + hstep;
+ zcurr := hcurr + hsdev*normaldeviate;
+ xcurr := i*basestep + basesdev*normaldeviate;
+ ycurr := j*basestep + basesdev*normaldeviate;
+ aone := uniformdeviate( 360 );
+ atwo := angsdev*normaldeviate;
+ vcz := cosd( atwo );
+ vcy := sind( atwo )*sind( aone );
+ vcx := sind( atwo )*cosd( aone );
+ currpos := ( xcurr, ycurr, zcurr );
+ lenvec := cylength*( vcx, vcy, vcz );
+% rigorousdisc( 0, true, currpos-0.5*lenvec, cyradius, lenvec);
+ counter := incr( counter );
+ generatedirline( counter, aone, 90-atwo, cylength, currpos );
+% generateonebiax( counter, aone, 90-atwo, cylength,
+% -60, 0.25*cylength, currpos );
+ endfor;
+ endfor;
+ endfor;
+ NL := counter;
+ director_invisible( true, 5, false );
+% director_invisible( false, 5, true );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/pathernon.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/pathernon.mp
new file mode 100644
index 00000000000..8b3d8b56140
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/pathernon.mp
@@ -0,0 +1,65 @@
+% pathernon.mp
+% L. Nobre G.
+% 2004
+
+beginfig(0);
+ f := (4.8,3,3.65);
+ viewcentr := black;
+ Spread := 50;
+ horiZon := 0;
+ ShadowOn := false;
+ LightSource := (1,-1,7);
+ SphericalDistortion := true;
+ OverRidePolyhedricColor := true;
+ numeric side, coluheight, blocheight, roofheight, coluray, fact;
+ numeric acroside, acronum, auxa, raya, rayb , poshemi, lena, lenb;
+ color roofcenter, ba, bb, bc, bd, coluvec, colucen, auxb, auxc, auxd;
+ side = 1;
+ roofheight = 0.1;
+ coluheight = 0.7;
+ acroside = 4;
+ acronum = 20;
+ coluray = 0.06;
+ blocheight = 0.1;
+ poshemi = 0.25*side;
+ raya = 0.08;
+ rayb = 0.12;
+ lena = 0.13;
+ lenb = 0.26;
+ fact = 1.3;
+ auxa = 0.5*side-coluray;
+ coluvec = blue*coluheight;
+ colucen = 0.5*coluvec;
+ auxc = (0,-poshemi,0);
+ auxd = (0,-poshemi,raya+rayb);
+ setthestage( acronum, acroside );
+ V1 := (0.5*side,-0.5*side,coluheight+blocheight);
+ V2 := (0.5*side,0.5*side,coluheight+blocheight);
+ V3 := (-0.5*side,0.5*side,coluheight+blocheight);
+ V4 := (-0.5*side,-0.5*side,coluheight+blocheight);
+ V5 := (0,-0.5*side,coluheight+roofheight+blocheight);
+ V6 := (0,0.5*side,coluheight+roofheight+blocheight);
+ makeface1(1,4,5);
+ makeface2(1,2,6,5);
+ makeface3(2,3,6);
+ makeface4(3,4,5,6);
+ ba = (auxa,-auxa,0);
+ bb = (auxa,auxa,0);
+ bc = (-auxa,auxa,0);
+ bd = (-auxa,-auxa,0);
+ roofcenter = (V1+V2+V3+V4+V5+V6)/6;
+ auxb = roofcenter-blue*blocheight;
+ V7 := (-0.5*side,-0.5*side,coluheight);
+ getready( "draw_invisible( false, false, white, black )", roofcenter );
+ getready( "rigorousdisc( 0, true, ba, coluray, coluvec )", ba+colucen);
+ getready( "rigorousdisc( 0, true, bb, coluray, coluvec )", bb+colucen);
+ getready( "rigorousdisc( 0, true, bc, coluray, coluvec )", bc+colucen);
+ getready( "rigorousdisc( 0, true, bd, coluray, coluvec )", bd+colucen);
+ getready("kindofcube(false,true,V7,0,0,0,side,side,blocheight)",auxb);
+ getready( "whatisthis(auxc,lenb*red,lena*green,raya,fact)", auxc );
+ getready( "spatialhalfsfear( auxd, blue, rayb )", auxd );
+ doitnow;
+ produce_vga_border;
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/planpht.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/planpht.mp
new file mode 100644
index 00000000000..dac34577eff
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/planpht.mp
@@ -0,0 +1,291 @@
+% planpht.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+% Planification wise 3D figures
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1); % phtpbq
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Definition of the 3D-figure
+ V1 := (1,0,0);
+ V2 := (0,1,0);
+ V5 := (0,0,1);
+ V3 := (-1,0,0);
+ V4 := (0,-1,0);
+ makeface1(1,2,3,4);
+ makeface2(1,2,5);
+ makeface3(2,3,5);
+ makeface4(3,4,5);
+ makeface5(4,1,5);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ f := (3,5,4);
+ Spread := 50;
+ pickup pencircle scaled 1pt;
+ sharpraytrace;
+endfig;
+
+beginfig(2); % phtdpbp
+ numeric altura, raio, xp, xs, yp, ys;
+ altura = 0.5257311;
+ raio = 0.8506508;
+ yp = 0.80901699;
+ ys = 0.5;
+ xp = 0.2628655;
+ xs = -0.6881909;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Definition of the 3D-figure
+ V1 := (raio,0,0);
+ V2 := (xp,yp,0);
+ V3 := (xs,ys,0);
+ V4 := (xs,-ys,0);
+ V5 := (xp,-yp,0);
+ V6 := (0,0,altura);
+ V7 := (0,0,-altura);
+ makeface1(1,2,6);
+ makeface2(5,1,6);
+ makeface3(2,3,6);
+ makeface4(3,4,6);
+ makeface5(4,5,6);
+ makeface6(1,2,7);
+ makeface7(5,1,7);
+ makeface8(2,3,7);
+ makeface9(3,4,7);
+ makeface10(4,5,7);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ f := (3,5,1.8);
+ Spread := 50;
+ pickup pencircle scaled 1pt;
+ sharpraytrace;
+endfig;
+
+beginfig(3); % phtcubo eps
+ defaultscale := 1;
+ defaultfont := "ccr10";
+ V1 := (1,1,1);
+ V2 := (-1,1,1);
+ V3 := (-1,-1,1);
+ V4 := (1,-1,1);
+ V5 := (1,1,-1);
+ V6 := (-1,1,-1);
+ V7 := (-1,-1,-1);
+ V8 := (1,-1,-1);
+ makeface1(1,2,3,4);
+ makeface2(5,6,7,8);
+ makeface3(1,2,6,5);
+ makeface4(2,3,7,6);
+ makeface5(3,4,8,7);
+ makeface6(4,1,5,8);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ f := (3,5,3);
+ Spread := 50;
+ pickup pencircle scaled 1pt;
+ sharpraytrace;
+ label.lft("A", rp(V8) );
+ label.top("B", rp(V1) );
+ label.top("C", rp(V3) );
+ label.lft("D", rp(V4) );
+ label.rt("E", rp(V2) );
+ label.rt("F", rp(V6) );
+endfig;
+
+beginfig(4); % phtptq
+ numeric high, low;
+ high = sqrt(2);
+ low = sqrt(2)-1.6818;
+ V1 := (1,1,high);
+ V2 := (-1,1,high);
+ V3 := (-1,-1,high);
+ V4 := (1,-1,high);
+ V5 := (high,0,low);
+ V6 := (0,high,low);
+ V7 := (-high,0,low);
+ V8 := (0,-high,low);
+ V9 := (0,0,0);
+ makeface1(5,6,7,8);
+ makeface2(6,1,2);
+ makeface3(7,2,3);
+ makeface4(8,3,4);
+ makeface5(5,4,1);
+ makeface6(5,6,1);
+ makeface7(6,7,2);
+ makeface8(7,8,3);
+ makeface9(8,5,4);
+ makeface10(9,1,2);
+ makeface11(9,2,3);
+ makeface12(9,3,4);
+ makeface13(9,4,1);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ f := (2,6,5);
+ Spread := 50;
+ pickup pencircle scaled 1pt;
+ sharpraytrace;
+endfig;
+
+beginfig(5); % phtnonrec
+ numeric tro;
+ tro = 2;
+ V1 := (tro,0,0);
+ V2 := (0,tro,0);
+ V3 := (-tro,0,0);
+ V4 := (0,-tro,0);
+ V5 := (1,1,1);
+ V6 := (-1,1,1);
+ V7 := (-1,-1,1);
+ V8 := (1,-1,1);
+ V9 := (1,1,-1);
+ V10 := (-1,1,-1);
+ V11 := (-1,-1,-1);
+ V12 := (1,-1,-1);
+ V13 := (0,0,tro);
+ V14 := (0,0,-tro);
+ makeface1(1,5,13,8);
+ makeface2(2,6,13,5);
+ makeface3(3,7,13,6);
+ makeface4(4,8,13,7);
+ makeface5(1,5,2,9);
+ makeface6(2,6,3,10);
+ makeface7(3,7,4,11);
+ makeface8(4,8,1,12);
+ makeface9(1,9,14,12);
+ makeface10(2,10,14,9);
+ makeface11(3,11,14,10);
+ makeface12(4,12,14,11);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ f := 2*(5,3,1.5);
+ Spread := 50;
+ pickup pencircle scaled 1pt;
+ sharpraytrace;
+endfig;
+
+beginfig(6); % pauphtflex eps
+ defaultscale := 1;
+ defaultfont := "ccr10";
+ color A, B, C, D, E, F, G;
+ numeric tro, Adist;
+ tro = sqrt(3)/2;
+ Adist = 0.88854;
+ V1 := (-1.8,0,0);
+ V2 := (-1.8,0.6,1.2*tro);
+ V3 := (1,0.6,1.2*tro);
+ V4 := (1,0,0);
+ V5 := (1,2.5,0);
+ V6 := (-1.8,2.5,0);
+ V7 := (0,0,0);
+ V8 := (0,0.707,0);
+ V9 := (0,0.707/4,0.707*tro/2);
+ V10:= (0.21928,Adist/2,tro*Adist);
+ V11:= (-0.37392,0.39638,0);
+ V12:= (-1.2125,Adist,0);
+ makeface1(1,2,3,4);
+ makeface2(4,5,6,1);
+ makeface3(7,8,9);
+ makeface4(8,9,10);
+ makeface5(8,10,11);
+ makeface6(10,11,12);
+ A = (0,1.3,0);
+ B = (0,1.3+sqrt(0.75),0);
+ C = (-0.5,1.3+sqrt(0.75),0);
+ D = (E+B)/2;
+ E = (sqrt(0.75),1.3,0);
+ F = ((1+sqrt(3))/4,1.3+(1+sqrt(3))/4,0);
+ G = (-1.5,1.3+sqrt(0.75),0);
+ f := 3*(2,5,2);
+ Spread := 100;
+ draw rp(A)--rp(B)--rp(E)--cycle;
+ draw rp(F)--rp(B)--rp(E)--cycle;
+ draw rp(A)--rp(B)--rp(C)--cycle;
+ draw rp(A)--rp(C)--rp(G)--cycle;
+ draw rp(A)--rp(F) dashed evenly;
+ pickup pencircle scaled 1pt;
+ sharpraytrace;
+ draw rp(V7)--rp(V9);
+ draw rp(V10)--rp(V9);
+ draw rp(V12)--rp((-1.2125,0,0)) dashed evenly;
+ label.urt("Adist", rp((V12+(-1.2125,0,0))/2) );
+ label.lft("A", rp(V10) );
+ label.bot("B", rp(V8) );
+ label.bot("B", rp(B) );
+ label.lrt("C", rp(V11) );
+ label.lft("D", rp(V9) );
+ label.bot("D", rp(D) );
+ label.llft("F", rp(V7) );
+ label.bot("F", rp(F) );
+ label.rt("G", rp(V12) );
+ angline(V6, V2, V1, 0.6, btex $\alpha$ etex, rt);
+ angline(V10, 2*V9, V9, 0.7, btex $\theta$ etex, bot);
+ draw rp(V9+N(V10-V9)*0.65)--rp(V9+N(V10-V9)*0.8);
+ draw rp(V9+N(V9)*0.5)--rp(V9+N(V9)*0.8);
+ label.bot(btex $p$ etex, rp((F+B)/2) );
+ label.ulft(btex $q$ etex, rp((D+B)/2) );
+ label.lft(btex $r$ etex, rp((D+A)/2) );
+ label.llft(btex $s$ etex, rp((A+B)/2) );
+ label.llft(btex $t$ etex, rp((A+C)/2) );
+ label.bot(btex $t$ etex, rp((G+C)/2) );
+ label.bot(btex $u$ etex, rp((C+B)/2) );
+ label.top(btex $v$ etex, rp((A+G)/2) );
+endfig;
+
+beginfig(7); % pauphttoro eps
+ defaultscale := 1;
+ defaultfont := "ccr10";
+ numeric sinthe, costhe, ux, uz, lx, lz, co;
+ costhe = (4*sqrt(5)-sqrt(3))/11;
+ sinthe = sqrt(1-costhe**2);
+ ux = costhe*sqrt(2)/2;
+ uz = sinthe/2;
+ lx = sqrt(4/3)*sinthe;
+ lz = -sqrt(2/3)*costhe;
+ co = sqrt(2)*(2*sqrt(5)+5*sqrt(3))/22;
+ V1 := (ux,0,-uz);
+ V2 := (lx,0,-lz);
+ V3 := (0,ux,uz);
+ V4 := (0,lx,lz);
+ V5 := (co,co,0);
+ V6 := (-ux,0,-uz);
+ V7 := (-lx,0,-lz);
+ V8 := (-co,co,0);
+ makeface1(1,2,3);
+ makeface2(1,2,5);
+ makeface3(2,3,5);
+ makeface4(3,4,5);
+ makeface5(3,4,1);
+ makeface6(1,4,5);
+ makeface7(3,6,7);
+ makeface8(3,7,8);
+ makeface9(6,7,8);
+ makeface10(3,8,4);
+ makeface11(4,6,8);
+ makeface12(3,4,6);
+ Spread := 100;
+% f := (1,-0.4,3);
+ f := 2*(2,1,2.8);
+ draw_invisible( false, false, TableC6, black );
+% cartaxes(0.2,0.2,0.2);
+ draw rp(V2)--rp(V1)--rp(V4) dashed evenly;
+ draw rp(V3)--rp(V1)--rp(V5) dashed evenly;
+ draw rp(V6)--rp(V4) dashed evenly;
+ draw rp(V6)--rp(V8) dashed evenly;
+% pickup pencircle scaled 1pt;
+% sharpraytrace;
+ label.rt("A", rp(V5) );
+ label.rt("C", rp(V3+(0,0.05,0)) );
+ label.rt("B", rp(V4) );
+ label.rt("D", rp(V8) );
+ label.lft("E", rp(V2) );
+ label.llft("F", rp(V1) );
+ label.lft("G", rp(V7) );
+ label.lft("H", rp(V6) );
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/rigorcubo.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/rigorcubo.mp
new file mode 100644
index 00000000000..831861fc9b6
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/rigorcubo.mp
@@ -0,0 +1,36 @@
+% rigorcubo.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(0);
+ defaultscale := 3;
+ defaultfont := "ccr10";
+ Spread := 50;
+ V1 := (1,1,1);
+ V2 := (-1,1,1);
+ V3 := (-1,-1,1);
+ V4 := (1,-1,1);
+ V5 := (1,1,-1);
+ V6 := (-1,1,-1);
+ V7 := (-1,-1,-1);
+ V8 := (1,-1,-1);
+ makeface1(1,2,3,4);
+ makeface2(5,6,7,8);
+ makeface3(1,2,6,5);
+ makeface4(2,3,7,6);
+ makeface5(3,4,8,7);
+ makeface6(4,1,5,8);
+ f := (3,5,3);
+ pickup pencircle scaled 1pt;
+ sharpraytrace;
+ label.lft("A", rp(V8) );
+ label.top("B", rp(V1) );
+ label.top("C", rp(V3) );
+ label.lft("D", rp(V4) );
+ label.rt("E", rp(V2) );
+ label.rt("F", rp(V6) );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/rmnbob.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/rmnbob.mp
new file mode 100644
index 00000000000..54d568c1e49
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/rmnbob.mp
@@ -0,0 +1,45 @@
+
+Spread := 70;
+f := (5,7,10);
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ numeric i, r[], stepr, len, Numr, Minn, Maxn;
+ numeric fws, NumLines, linex;
+ path aro[], oneline;
+ color centre, axe, baseone, basetwo;
+
+ stepr := 0.1;
+ len := 3;
+ Numr := 5;
+ Minn := 5;
+ centre := (0,0,0);
+ axe := (1,0,0);
+ fws := 2;
+ NumLines := 30;
+ for i=0 upto NumLines:
+ linex := fws*(i/NumLines-0.5);
+ oneline := rp((linex,0.5*fws,-0.5*fws))
+ --rp((linex,-0.5*fws,-0.5*fws))
+ --rp((linex,-0.5*fws,0.5*fws));
+ draw oneline withcolor (0.7*background);
+ endfor;
+ baseone := centre+0.5*len*axe;
+ basetwo := centre-0.5*len*axe;
+ Maxn := Minn+Numr;
+ for i=Minn upto Maxn:
+ r[i] := i*stepr;
+ aro[i] := rigorouscircle(baseone,axe,r[i]);
+ endfor;
+ rigorousdisc( 0, true, baseone, r[Maxn], -len*axe );
+ drawoptions( dashed evenly );
+ rigorousdisc( 0, true, baseone, r[Minn], -len*axe );
+ for i=Maxn downto Minn:
+ filldraw aro[i] withcolor ((0.5+0.3*normaldeviate)*background);
+ endfor;
+ drawoptions( );
+ draw aro[Maxn];
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/sal.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/sal.mp
new file mode 100644
index 00000000000..e2c447a27a9
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/sal.mp
@@ -0,0 +1,104 @@
+% Cesium Cloride Crystal Structure and EBG fields together
+% L. Nobre G.
+% 2002
+
+verbatimtex
+\documentclass{article}
+\begin{document}
+etex
+
+beginfig(1);
+ numeric sfr, radfac, ind;
+ color xv, yv, zv;
+ path p[];
+ f := 3*(5,2,3);
+ Spread := 50;
+ sfr := 0.2;
+ radfac := 2.0;
+ xv := (sfr,0,0);
+ yv := (0,sfr,0);
+ zv := (0,0,sfr);
+ V1 := (-1,-1,-1);
+ V2 := (-1,1,-1);
+ V3 := (1,-1,-1);
+ V4 := (1,1,-1);
+ V5 := (-1,-1,1);
+ V6 := (-1,1,1);
+ V7 := (1,-1,1);
+ V8 := (1,1,1);
+ V9 := (0,0,0);
+ for ind=1 upto 8:
+ p[ind] := rigorousfearpath( V[ind], sfr );
+ endfor;
+ p9 := rigorousfearpath( V9, sfr*radfac );
+ unfill p1;
+ draw p1;
+ draw rp(V1+yv)--rp(V2-yv);
+ draw rp(V1+xv)--rp(V3-xv);
+ unfill p2;
+ draw p2;
+ unfill p3;
+ draw p3;
+ draw rp(V4-yv)--rp(V3+yv);
+ draw rp(V4-xv)--rp(V2+xv);
+ unfill p4;
+ draw p4;
+ draw rp(V1+zv)--rp(V5-zv);
+ draw rp(V2+zv)--rp(V6-zv);
+ unfill p9;
+ draw p9;
+ draw rp(V3+zv)--rp(V7-zv);
+ draw rp(V4+zv)--rp(V8-zv);
+ unfill p5;
+ draw p5;
+ draw rp(V5+yv)--rp(V6-yv);
+ draw rp(V5+xv)--rp(V7-xv);
+ unfill p6;
+ draw p6;
+ unfill p7;
+ draw p7;
+ draw rp(V8-yv)--rp(V7+yv);
+ draw rp(V8-xv)--rp(V6+xv);
+ unfill p8;
+ draw p8;
+ label( btex Cs${}^{+}$ etex, rp( V8 ) );
+ label( btex Cl${}^{-}$ etex, rp( V9 ) );
+endfig;
+
+beginfig(2);
+ numeric inc, ind, tep, larg, altr, lene;
+ path efld, velv, arch, auxi;
+ picture bfld;
+ pair vpos, cent;
+ tep = 1cm;
+ larg = 4;
+ altr = 3;
+ lene = larg*tep;
+ bfld = btex $\times$ etex;
+% bfld := bfld shifted -(center bfld);
+ efld = origin--(lene,0);
+ for ind = 0 upto altr:
+ drawarrow efld shifted (0,ind*tep);
+ endfor;
+ auxi = efld shifted (0,tep);
+ for ind = 1 upto altr:
+ for inc = 1 step 2 until 2*larg:
+ label( bfld, (0.5*inc*tep,(ind-0.5)*tep) );
+ endfor;
+ endfor;
+ vpos = (tep,0.5tep);
+ label.lft( btex $\vec{B}$ etex, (0.5tep,(altr-0.5)*tep) );
+ label.lft( btex $\vec{E}$ etex, origin );
+ label.top( btex $\vec{v}$ etex, vpos );
+ velv = vpos--((larg-1)*tep,(altr-0.5)*tep);
+ drawarrow velv;
+ cent = auxi intersectionpoint velv;
+ arch = ((fullcircle scaled (altr*tep*0.87)) shifted cent) cutafter velv;
+ draw arch;
+ label.rt( btex $\theta$ etex, point 0.5*length arch of arch );
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/sfearschem.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/sfearschem.mp
new file mode 100644
index 00000000000..a9f2ea6a344
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/sfearschem.mp
@@ -0,0 +1,34 @@
+% sfearchem.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+defaultfont:="cmssu30";
+
+beginfig(1);
+ f := (4,2,1.5);
+ cartaxes( 1.5,1.5,0.75 );
+ drawoptions( withcolor red withpen pencircle scaled 1.3pt );
+ draw goodcirclepath( (0,0,0), (0,0,1), 1 );
+ drawoptions();
+ draw rigorouscircle( (0,0,0), (0,0,1), 1 );
+ draw spatialhalfcircle( (0,0,0), (0,0,1), 0.5, true );
+ draw spatialhalfcircle( (0,0,0), (0,0,1), 0.5, false ) dashed evenly;
+ draw rigorousfearpath( (0,0,0), 0.5 );
+ draw rp((0,0,0.5)) withpen pencircle scaled 1.3pt;
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/signalvertexSD.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/signalvertexSD.mp
new file mode 100644
index 00000000000..dfc5eb3f501
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/signalvertexSD.mp
@@ -0,0 +1,40 @@
+% signalvertexSD.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+% Draw a torus with NP dots, a section of 3.14*RS^2
+% and a total diameter of 2*(RB+RS). The dots are placed
+% on a single closed line that turns around the $z$ axis
+% NB times and around the section NS times.
+
+f := 0.45f;
+
+%SphericalDistortion := true; Spread := 11;
+
+beginfig(1);
+ NP:=2000;
+ RB:=1;
+ RS:=0.2;
+ R3:=0.0;
+ NB:=8;
+ NS:=5;
+ jB:=360*NB/NP;
+ jS:=360*NS/NP;
+ for i=1 upto NP:
+ phi :=i*jS;
+ theta :=i*jB;
+ first :=(RB+(RS+R3*sind(4*theta))*cosd(phi))*cosd(theta);
+ second:=(RB+(RS+R3*sind(4*theta))*cosd(phi))*sind(theta);
+ third := (RS+R3*sind(4*theta))*sind(phi);
+ signalvertex( (first,second,third), 1, black );
+ endfor;
+endfig;
+
+end;
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/spherample.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/spherample.mp
new file mode 100644
index 00000000000..39352e6ba02
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/spherample.mp
@@ -0,0 +1,49 @@
+% spherample.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+SphericalDistortion := true;
+
+beginfig(1);
+ color orig, axxc, ayyc, azzc;
+ color nalfa, gammacnt, vertex;
+ numeric altura, grids, radius, xxsize, aux,
+ yysize, zzsize, i, numc, slope;
+ path sfear;
+
+ f := (5,4,2);
+ Spread := 120;
+ ShiftV := (200,200);
+ altura = 1;
+ radius = 0.3;
+ grids = 1;
+ numc = 9;
+ slope = 3;
+
+ for i=1 upto numc:
+ aux := (i-1-0.5*(numc-1))*grids;
+ gammacnt := (0,aux,0);
+ vertex := (aux/slope,aux,altura);
+ nalfa := vertex - gammacnt;
+ sfear := rigorousfearpath(gammacnt,radius);
+ unfill sfear;
+ draw sfear;
+ draw spatialhalfcircle(gammacnt,nalfa,radius,true);
+ endfor;
+ xxsize = radius;
+ yysize = 0.5*(numc-1)*grids;
+ zzsize = altura;
+ orig = (0,0,0);
+ axxc = (xxsize,0,0);
+ ayyc = (0,yysize,0);
+ azzc = (0,0,zzsize);
+% drawarrow rp(orig)..rp(axxc);
+% drawarrow rp(orig)..rp(ayyc);
+% drawarrow rp(orig)..rp(azzc);
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/squareanglines.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/squareanglines.mp
new file mode 100644
index 00000000000..769f2af8721
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/squareanglines.mp
@@ -0,0 +1,14 @@
+% squareanglines.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ cartaxes(1,1,1);
+ squareangline( red, green, black, 0.4);
+ squareangline( green, blue, black, 0.6);
+ squareangline( blue, red, black, 0.8);
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/troncoconedef.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/troncoconedef.mp
new file mode 100644
index 00000000000..0429ac4533f
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/troncoconedef.mp
@@ -0,0 +1,54 @@
+% troncoconedef.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+f := (5,0,3);
+
+def twoclicpathesinapen( expr CycleA, CycleB )=
+ begingroup
+ numeric TheLengthOfA, TheLengthOfB, TheMargin;
+ path SubPathA, SubPathB;
+ TheMargin = 0.02;
+ TheLengthOfA = ( length CycleA ) - TheMargin;
+ TheLengthOfB = ( length CycleB ) - TheMargin;
+ SubPathA = subpath ( 0, TheLengthOfA ) of CycleA;
+ SubPathB = subpath ( 0, TheLengthOfB ) of CycleB;
+ ( makepath makepen ( SubPathA--SubPathB--cycle ) )
+ endgroup
+enddef;
+
+beginfig(0);
+ numeric rayo, rayt;
+ path onec, twoc, botc;
+ color axec, baso, bast;
+ rayo = 1;
+ rayt = 0.7;
+ axec = red;
+ baso = black;
+ bast = (1,1,1);
+ onec = goodcirclepath( baso, axec, rayo );
+ twoc = goodcirclepath( bast, axec, rayt );
+ botc = twoclicpathesinapen( onec, twoc );
+ fill botc withcolor green;
+ draw onec;
+ draw twoc;
+ draw botc;
+ dotlabel.bot( btex onec0 etex, point 0 of onec );
+ dotlabel.bot( btex twoc0 etex, point 0 of twoc );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/twistnlc.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/twistnlc.mp
new file mode 100644
index 00000000000..b3611cfbb14
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/twistnlc.mp
@@ -0,0 +1,54 @@
+% explvis2
+% L. Nobre G.
+% 1999
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+
+ f := (2,1,1);
+
+ Spread := 250;
+
+ color gridvec, sizevec, currpos, starpos, bordpos;
+ numeric i, j, k, counter, theta, phi, thetamin,
+ thetamax, thetastp, long, base, radius, polar;
+ sizevec := (4,36,1);
+ gridvec := (0.14,0.1,0.3);
+ thetamin := 90;
+ thetamax := 150;
+ long := 0.08;
+ base := 0.02;
+ thetastp := (thetamax-thetamin)/(X(sizevec)-1);
+ starpos := ( -X(gridvec)*X(sizevec) ,
+ -X(gridvec)*X(sizevec) ,
+ 0 );
+ bordpos := starpos;
+ npf1 := 4;
+ F1p1 := bordpos;
+ F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
+ counter := 2;
+ for i=1 upto X(sizevec):
+ radius := (i-1)*X(gridvec);
+ polar := i*floor(Y(sizevec)/X(sizevec));
+ for j=1 upto polar:
+ for k=1 upto Z(sizevec):
+ phi := 360*(j-1)/polar;
+ theta := thetamin+(i-1)*thetastp;
+ currpos := radius*(cosd(phi-90),sind(phi-90),0)
+ +(k-1)*(0,0,Z(gridvec));
+ generatedirface( counter, phi, theta, long, base, currpos );
+ counter := incr(counter);
+ endfor;
+ endfor;
+ endfor;
+ NF := decr(counter);
+ draw_all_test(false);
+% sharpraytrace;
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/twistroundbiax.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/twistroundbiax.mp
new file mode 100644
index 00000000000..59a47907a88
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/twistroundbiax.mp
@@ -0,0 +1,62 @@
+% twistroundbiax.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+
+
+beginfig(1);
+
+ f := (2,1,1);
+
+ Spread := 250;
+
+ color gridvec, sizevec, currpos, starpos, bordpos;
+ numeric i, j, k, counter, theta, phi, gamma, thetamin, innercircle,
+ thetamax, thetastp, long, base, radius, polar, larg;
+ sizevec := (4,36,1);
+ gridvec := (0.143,0.1,0.1);
+ thetamin := 90;
+ thetamax := 150;
+ long := 0.08;
+ larg := 0.02;
+ base := 0.2;
+ gamma := -30;
+ innercircle := 0.5;
+ thetastp := (thetamax-thetamin)/(X(sizevec)-1);
+ starpos := ( -X(gridvec)*X(sizevec) ,
+ -X(gridvec)*X(sizevec) ,
+ 0 );
+ bordpos := starpos;
+ npf1 := 4;
+ F1p1 := bordpos;
+ F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
+ NF := 1;
+ draw facepath(1);
+ counter := 0;
+ for i=1 upto X(sizevec):
+ radius := (i-innercircle)*X(gridvec);
+ polar := i*floor(Y(sizevec)/X(sizevec));
+ for j=1 upto polar:
+ for k=1 upto Z(sizevec):
+ phi := 360*(j-1)/polar;
+ theta := thetamin+(i-innercircle)*thetastp;
+ currpos := radius*(cosd(phi-90),sind(phi-90),0)
+ +(k-1)*(0,0,Z(gridvec));
+ counter := incr(counter);
+% generateonebiax( counter, phi, theta, long,
+% gamma, larg, currpos );
+ generatedirline( counter, phi, theta, long, currpos );
+ endfor;
+ endfor;
+ endfor;
+ NL := counter;
+ director_invisible( true, base, false );
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/twocyclestogether.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/twocyclestogether.mp
new file mode 100644
index 00000000000..ca94e87dc2e
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/twocyclestogether.mp
@@ -0,0 +1,113 @@
+% twocyclestogether.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+f := (4.5,-6,5);
+
+beginfig(1);
+ numeric len[], ray[];
+ color axe[], pos[], fix[], lab[], Ve[];
+ color reflabpos, reflabpoi;
+ picture txt[], dashpatt;
+ numeric inclang, aberang, sampang;
+ numeric squside, sqlevel, ul, outermagpos;
+ numeric innerray, polesep, fracone, fracsam;
+ numeric labelscale;
+ path tmpath, aupath, copath;
+
+ pickup pencircle scaled 1.2pt;
+ dashpatt = evenly scaled 3;
+ ul = 0.1;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Change one of these at a time. %%%%%%%%
+ inclang = 129;
+ aberang = 19;
+ outermagpos = 22ul;
+ polesep = 1.7ul;
+ len4 = 30ul;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ sampang = 30;
+ fracone = 0.33;
+ fracsam = 0.86;
+ ray1 = 10ul;
+ ray2 = 6ul;
+ ray3 = 8ul;
+ ray4 = 1.5ul;
+ ray5 = 4ul;
+ ray6 = 3ul;
+ ray7 = 3.5ul;
+ ray8 = 2ul;
+ len3 = 7ul;
+ len5 = 3ul;
+ len7 = 3.5ul;
+ len8 = 7ul;
+
+ len1 = (1-fracone)*(outermagpos-ray5-polesep);
+ pos1 = (-outermagpos,0,0);
+ rigorousdisc( 0, true, pos1, ray1, len1*(1,0,0) );
+
+ len2 = fracone*(outermagpos-ray5-polesep);
+ pos2 = (len1-outermagpos,0,0);
+ tmpath := goodcirclepath( pos2, (1,0,0), ray1 );
+ aupath := goodcirclepath( (-ray5-polesep,0,0), (1,0,0), ray2 );
+ copath := twocyclestogether( tmpath, aupath );
+ unfill copath;
+ draw copath;
+ draw aupath;
+
+ Ve5 := fracsam*ray5*( sind( sampang ),
+ cosd( sampang )*cosd( inclang -90 ),
+ cosd( sampang )*sind( inclang -90 ) );
+ Ve6 := fracsam*ray5*( -sind( sampang ),
+ cosd( sampang )*cosd( inclang -90 ),
+ cosd( sampang )*sind( inclang -90 ) );
+ Ve8 := fracsam*ray5*( sind( sampang ),
+ -cosd( sampang )*cosd( inclang -90 ),
+ -cosd( sampang )*sind( inclang -90 ) );
+ Ve7 := fracsam*ray5*( -sind( sampang ),
+ -cosd( sampang )*cosd( inclang -90 ),
+ -cosd( sampang )*sind( inclang -90 ) );
+ tmpath := rp(Ve5)--rp(Ve6)--rp(Ve7)--rp(Ve8)--cycle;
+ unfill tmpath;
+ draw tmpath;
+
+ axe6 = ( 0, cosd( inclang+aberang ), sind( inclang+aberang ) );
+ pos6 = ray1*axe6;
+ len6 = len4;
+ axe7 = ( 0, cosd( inclang-aberang ), sind( inclang-aberang ) );
+ pos7 = ( ray1 + 0.5len6 )*axe7;
+ draw rp(pos6)--rp((0,0,0))--rp(pos7) dashed dashpatt;
+
+ pos8 = pos7+len7*axe7;
+ tmpath := goodcirclepath( pos7, axe7, ray7 );
+ aupath := goodcirclepath( pos8, axe7, ray8 );
+ copath := twocyclestogether( tmpath, aupath );
+ unfill copath;
+ draw copath;
+ draw aupath;
+
+ axe8 = axe7;
+ rigorousdisc( 0, true, pos8, ray8, len8*axe8 );
+
+ len9 = len2;
+ pos9 = (ray5+polesep,0,0);
+ ray9 = ray2;
+ ray10 = ray1;
+ tmpath := goodcirclepath( pos9, (1,0,0), ray9 );
+ pos10 = pos9+len9*(1,0,0);
+ aupath := goodcirclepath( pos10, (1,0,0), ray10 );
+ copath := twocyclestogether( tmpath, aupath );
+ unfill copath;
+ draw copath;
+ draw aupath;
+
+ len10 = len1;
+ rigorousdisc( 0, true, pos10, ray10, len10*(1,0,0) );
+
+ produce_auto_scale;
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/repeated/twoupcones.mp b/Master/texmf-dist/doc/metapost/featpost/example/repeated/twoupcones.mp
new file mode 100644
index 00000000000..cc9b697dd37
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/repeated/twoupcones.mp
@@ -0,0 +1,51 @@
+% twoupcones.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton,concmath,ccfonts}
+\begin{document}
+etex
+
+f := 3*(2,1,0.5);
+
+beginfig(1);
+ numeric raya, rayb, heia, heib, rang, marg, u;
+ color cena, cenb, vera, verb, auxa, auxb, pora, porb, poha, pohb;
+ u = 0.38;
+ raya = 1u;
+ rayb = 2u;
+ heia = 0.65u;
+ marg = 0.2u;
+ rang = 60;
+ heib = heia*rayb/raya;
+ cena = (raya*(1+marg),0,0);
+ cenb = (-rayb*(1+marg),0,0);
+ auxa = cena + raya*(cosd(rang),sind(rang),0);
+ auxb = cenb + rayb*(cosd(rang),sind(rang),0);
+ pora = 0.5[auxa,cena];
+ porb = 0.5[auxb,cenb];
+ vera = cena+heia*blue;
+ verb = cenb+heib*blue;
+ poha = 0.5[cena,vera];
+ pohb = 0.5[cenb,verb];
+ verygoodcone(true,cenb,blue,rayb,verb);
+ draw rp(verb)--rp(cenb)--rp(auxb) dashed evenly;
+ label.urt(btex $h_1$ etex, rp(pohb));
+ label.urt(btex $R_1$ etex, rp(porb));
+ verygoodcone(true,cena,blue,raya,vera);
+ draw rp(vera)--rp(cena)--rp(auxa) dashed evenly;
+ label.urt(btex $h_2$ etex, rp(poha));
+ label.urt(btex $R_2$ etex, rp(pora));
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/anglinerigorouscircle.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/anglinerigorouscircle.mp
new file mode 100644
index 00000000000..57548730161
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/anglinerigorouscircle.mp
@@ -0,0 +1,108 @@
+% angline_rigorouscircle.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+% bash: export TEX=latex
+% tcsh: setenv TEX latex
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton,concmath,ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ color orig, axxc, ayyc, azzc;
+ color field, nalfa, ngamma, alfacnt, gammacnt, nazy, nax;
+ path alfa, gamma;
+ numeric nalfad, theta, radius, gammang, xxsize, yysize, zzsize;
+ numeric xxpos, yypos, zzpos, fieldpos, deltarad, deltapos;
+ numeric thetarad, thetapos, nalfapos, ngammapos;
+ numeric etalpharad, etalphapos, alphapos, gammapos;
+ picture xxlabel, yylabel, zzlabel, fieldlabel, deltalabel;
+ picture nalfalabel, ngammalabel, etalphalabel, alphalabel;
+ picture gammalabel, thetalabel;
+
+ f := (3,4,2);
+ Spread := 100;
+ xxsize = 0.8;
+ xxpos = 6;
+ yysize = 0.8;
+ yypos = 6;
+ zzsize = 1.3;
+ zzpos = 4;
+ field = (0.7,0,0.3);
+ fieldpos = 2;
+ deltarad = 0.45;
+ deltapos = 3;
+ nalfad = 1.0;
+ theta = 25;
+ thetarad = 0.3;
+ thetapos = 2;
+ nalfapos = 7;
+ gammang = 65;
+ ngammapos = 7;
+ etalpharad = 0.4;
+ etalphapos = 2;
+ alphapos = 6;
+ gammapos = 0;
+
+ xxlabel = btex $x_c$ etex;
+ yylabel = btex $y_c$ etex;
+ zzlabel = btex $z_c$ etex;
+ deltalabel = btex $\Delta$ etex;
+ fieldlabel = btex $\mathbf{B}$ etex;
+ thetalabel = btex $\theta$ etex;
+ nalfalabel = btex $\vec{n}_\alpha$ etex;
+ ngammalabel = btex $\vec{n}_\gamma$ etex;
+ etalphalabel= btex $\eta_\alpha$ etex;
+ alphalabel = btex $\alpha$ etex;
+ gammalabel = btex $\gamma$ etex;
+ orig = (0,0,0);
+ axxc = (xxsize,0,0);
+ ayyc = (0,yysize,0);
+ azzc = (0,0,zzsize);
+ nalfa = (0,sind(theta),cosd(theta));
+ alfacnt = (0,0,nalfad*cosd(theta));
+ radius = nalfad*sind(theta);
+ alfa = rigorouscircle( alfacnt, (0,0,1), radius );
+ gammacnt = cosd(theta)*cosd(theta)*nalfa;
+ radius := cosd(theta)*sind(theta);
+ gamma = rigorouscircle( gammacnt, nalfa, radius );
+ nazy = radius*sind(gammang)*ncrossprod( nalfa, axxc );
+ nax = radius*cosd(gammang)*ncrossprod( ayyc, nalfa );
+ ngamma = gammacnt+nax+nazy;
+ draw alfa dashed evenly;
+ draw gamma dashed evenly;
+ drawarrow rp(orig)..rp(axxc);
+ drawarrow rp(orig)..rp(ayyc);
+ drawarrow rp(orig)..rp(azzc);
+ drawarrow rp(orig)..rp(field);
+ drawarrow rp(orig)..rp(nalfa);
+ drawarrow rp(orig)..rp(ngamma);
+ drawarrow subpath (4,3) of alfa;
+ drawarrow subpath (8,7) of gamma;
+ anglinen( field, azzc, orig, deltarad, deltalabel, deltapos );
+ anglinen( azzc, nalfa, orig, thetarad, thetalabel, thetapos );
+ anglinen( ngamma, field, orig, etalpharad, etalphalabel, etalphapos );
+ labeln( xxlabel, rp(axxc), xxpos );
+ labeln( yylabel, rp(ayyc), yypos );
+ labeln( zzlabel, rp(azzc), zzpos );
+ labeln( fieldlabel, rp(field), fieldpos );
+ labeln( nalfalabel, rp(nalfa), nalfapos );
+ labeln( ngammalabel, rp(ngamma), ngammapos );
+ labeln( alphalabel, point 3 of alfa, alphapos );
+ labeln( gammalabel, point 7 of gamma, gammapos );
+ pickup pencircle scaled 1.5;
+ draw rp(alfacnt);
+ draw rp(gammacnt);
+% produce_auto_scale;
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/cartaxes.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/cartaxes.mp
new file mode 100644
index 00000000000..af8576e06c2
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/cartaxes.mp
@@ -0,0 +1,28 @@
+verbatimtex
+\documentclass{article}
+\begin{document}
+
+%input featpost3Dplus2D;
+etex
+beginfig(1);
+ cartaxes(1,1,1);
+endfig;
+f := (5,3.5,1);
+beginfig(2);
+ cartaxes(1,1,1);
+ color va, vb, vc, vd;
+ va = (0.29,0.7,1.0);
+ vb = (X(va),Y(va),0);
+ vc = N((-Y(va),X(va),0));
+ vd = (0,Y(vc),0);
+ drawarrow rp(black)--rp(va);
+ draw rp(black)--rp(vb)--rp(va) dashed evenly;
+ draw rp(vc)--rp(vd) dashed evenly;
+ drawarrow rp(black)--rp(vc);
+ squareangline( va, vc, black, 0.15 );
+ angline( va, red, black, 0.75, decimal getangle( va, red ), lft );
+endfig;
+verbatimtex
+\end{document}
+etex
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/conicurv.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/conicurv.mp
new file mode 100644
index 00000000000..15aea824d14
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/conicurv.mp
@@ -0,0 +1,94 @@
+% conicurv.mp
+% L. Nobre G.
+% Y2K
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ f := (10,-5,5.44);
+ Spread := 30;
+ numeric shortradius, longradius, theta, width, height;
+ numeric updiff, refsize, vecsize, anglar, bord, totup;
+ color rn, fa, fc, pg, centre, speed, refx, refy;
+ color iplow, iphig, oplow,ophig, anglebase, central, refo;
+ color eplow, ephig, aplow,aphig, anglebase, central, refo;
+ theta = 30;
+ width = 3;
+ shortradius = 2;
+ bord = 2;
+ refsize = 1;
+ vecsize = 2;
+ height = 0.3;
+ anglar = 1.75;
+ totup = 3;
+ longradius = shortradius + width*cosd(theta);
+ updiff = width*sind(theta);
+ iplow = (0,shortradius,0);
+ iphig = (0,longradius,updiff);
+ oplow = (-shortradius,0,0);
+ ophig = (-longradius,0,updiff);
+ aplow = -iplow;
+ aphig = (0,-longradius,updiff);
+ eplow = -oplow;
+ ephig = (longradius,0,updiff);
+ anglebase = (0,longradius,0);
+ centre = 0.5[iplow,iphig]+(0,0,height);
+ central = (0,0,Z(centre));
+% refo = (0,0,-shortradius*sind(theta)/cosd(theta));
+ refo = (0,0.5*Y(centre),Z(centre));
+ refx = refsize*(0,cosd(theta),sind(theta));
+ refy = refsize*(0,-sind(theta),cosd(theta));
+% anglinen( iplow, oplow, (0,0,0), shortradius, "", 0 );
+% anglinen( iphig, ophig, (0,0,updiff), longradius, "", 0 );
+ angline(iphig,anglebase,iplow,width/anglar,btex $\theta$ etex,rt);
+ draw rp(central) withpen pencircle scaled 2pt;
+ draw rp(iplow)--rp(iphig);
+ draw rp(oplow)--rp(ophig);
+ draw rp(aplow)--rp(aphig);
+ draw rp(eplow)--rp(ephig);
+ draw rp(iphig)--rp(anglebase)--rp(aplow) dashed evenly;
+ draw rp(oplow)--rp(eplow) dashed evenly;
+ draw rp(central)--rp(centre) dashed evenly;
+% draw rp((0,-bord,-bord))--rp((0,longradius+bord,-bord))
+% --rp((0,longradius+bord,totup))--rp((0,-bord,totup))--cycle
+% withpen pencircle scaled 2pt;
+ draw rp((0,0,-bord))--rp((0,longradius+bord,-bord))
+ --rp((0,longradius+bord,totup))--rp((0,0,totup))--cycle;
+ drawarrow rp(refo)..rp(refo+refy);
+ drawarrow rp(refo)..rp(refo+refx);
+ label.llft(btex $y$ etex, rp(refo+refy));
+ label.lrt(btex $x$ etex, rp(refo+refx));
+ rn = centre+vecsize*refy;
+ fa = centre+vecsize*refx;
+ fc = centre+vecsize*(0,1,0);
+ pg = centre+vecsize*(0,0,-1);
+ speed = centre+vecsize*(1,0,0);
+ drawarrow rp(centre)..rp(rn);
+ drawarrow rp(centre)..rp(fa);
+ drawarrow rp(centre)..rp(fc);
+ drawarrow rp(centre)..rp(pg);
+ drawarrow rp(centre)..rp(speed);
+ label.rt(btex $\vec{R}_N$ etex, rp(rn));
+ label.top(btex $\vec{F}_a$ etex, rp(fa));
+ label.urt(btex $\vec{F}_c$ etex, rp(fc));
+ label.rt(btex $\vec{P}$ etex, rp(pg));
+ label.rt(btex $\vec{v}$ etex, rp(speed));
+ draw rp(centre) withpen pencircle scaled 10pt withcolor blue;
+ pickup pencircle scaled 2pt;
+ draw rigorouscircle( (0,0,updiff), (0,0,1), longradius );
+ draw rigorouscircle( (0,0,0), (0,0,1), shortradius );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/cubicfacecentered.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/cubicfacecentered.mp
new file mode 100644
index 00000000000..ac359c3ddf2
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/cubicfacecentered.mp
@@ -0,0 +1,112 @@
+% cubicfacecentered.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+% verbatimtex
+% \documentclass{article}
+% \usepackage{beton}
+% \usepackage{concmath}
+% \usepackage{ccfonts}
+% \begin{document}
+% etex
+
+beginfig(1);
+ numeric tro;
+ pen fina, media, grossa;
+ color mygray;
+ tro = 2;
+ V1 := (tro,0,0);
+ V2 := (0,tro,0);
+ V3 := (-tro,0,0);
+ V4 := (0,-tro,0);
+ V5 := (1,1,1);
+ V6 := (-1,1,1);
+ V7 := (-1,-1,1);
+ V8 := (1,-1,1);
+ V9 := (1,1,-1);
+ V10 := (-1,1,-1);
+ V11 := (-1,-1,-1);
+ V12 := (1,-1,-1);
+ V13 := (0,0,tro);
+ V14 := (0,0,-tro);
+ V15 := (tro,0,tro);
+ V16 := (0,tro,tro);
+ V17 := (tro,tro,0);
+ V18 := (tro,0,-tro);
+ V19 := (tro,-tro,0);
+ V20 := (0,-tro,tro);
+ V21 := (-tro,0,tro);
+ V22 := (-tro,tro,0);
+ V23 := (0,tro,-tro);
+ V24 := (-tro,0,-tro);
+ V25 := (0,-tro,-tro);
+ V26 := (-tro,-tro,0);
+ V27 := (-2*tro,-tro,-tro);
+ V28 := (-2*tro,-tro,tro);
+ V29 := (-2*tro,tro,tro);
+ V30 := (-2*tro,tro,-tro);
+ makeface1(1,5,13,8);
+ makeface2(2,6,13,5);
+ makeface3(3,7,13,6);
+ makeface4(4,8,13,7);
+ makeface5(1,5,2,9);
+ makeface6(2,6,3,10);
+ makeface7(3,7,4,11);
+ makeface8(4,8,1,12);
+ makeface9(1,9,14,12);
+ makeface10(2,10,14,9);
+ makeface11(3,11,14,10);
+ makeface12(4,12,14,11);
+
+ makeface13(27,28,29,30);
+ makeface14(20,21,16,29,28);
+ makeface15(23,24,25,27,30);
+ makeface16(16,22,23,30,29);
+ makeface17(25,27,28,20,26);
+ makeface18(21,22,24,26);
+ makeface19(20,21,26);
+ makeface20(16,21,22);
+ makeface21(22,23,24);
+ makeface22(24,25,26);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% f := 2*(5,3,1.5);
+% f := 2*(5,3,4);
+ f := 2.34*(15,2.4,5.05);
+ Spread := 50;
+ fina = pencircle scaled 1pt;
+ media = pencircle scaled 1.2pt;
+ grossa= pencircle scaled 3pt;
+ mygray = 0.3background;
+% pickup fina;
+% draw rp(V25)--rp(V27)--rp(V28)--rp(V20)--
+% rp(V25)--rp(V23)--rp(V30)--rp(V27);
+ pickup media;
+ draw rp(V24)--rp(V25)--rp(V19)--rp(V20)--
+ rp(V26)--rp(V25)--rp(V18)--rp(V23)--
+ rp(V24)--rp(V26)--rp(V21)--rp(V22)--cycle withcolor mygray;
+ drawoptions( withpen grossa );
+ draw_invisible( false, false, TableC3, black );
+ fillfacewithlight( 14 );
+ fillfacewithlight( 16 );
+ drawoptions();
+ pickup media;
+ draw rp(V15)--rp(V16)--rp(V22)--rp(V23)--
+ rp(V17)--rp(V16)--rp(V21)--rp(V20)--
+ rp(V15)--rp(V17)--rp(V18)--rp(V19)--cycle withcolor mygray;
+% pickup fina;
+% draw rp(V28)--rp(V29)--rp(V30);
+% draw rp(V20)--rp(V16)--rp(V23);
+% draw rp(V16)--rp(V29);
+
+endfig;
+
+% verbatimtex \end{document} etex
+
+end;
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/cubicfigures.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/cubicfigures.mp
new file mode 100644
index 00000000000..93aebeb28a0
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/cubicfigures.mp
@@ -0,0 +1,44 @@
+% cubicfigures.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+f := ( 1.2 , 2.0 , 1.6 );
+Spread := 75;
+
+V1 := (1,1,1);
+V2 := (-1,1,1);
+V3 := (-1,-1,1);
+V4 := (1,-1,1);
+V5 := (1,1,-1);
+V6 := (-1,1,-1);
+V7 := (-1,-1,-1);
+V8 := (1,-1,-1);
+makeface1(1,2,3,4);makeface2(5,6,7,8);
+makeface3(1,2,6,5);makeface4(2,3,7,6);
+makeface5(3,4,8,7);makeface6(4,1,5,8);
+makeline1(1,7);makeline2(2,8);
+makeline3(3,5);makeline4(4,6);
+
+beginfig(1);
+ ParallelProj := true;
+ SphericalDistortion := false;
+ pickup pencircle scaled 1pt;
+ draw_all_test(true);
+endfig;
+
+beginfig(2);
+ ParallelProj := false;
+ SphericalDistortion := false;
+ draw_all_test(true);
+endfig;
+
+beginfig(3);
+ ParallelProj := false;
+ SphericalDistortion := true;
+ PrintStep := 5;
+ draw_all_test(true);
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/cylimple.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/cylimple.mp
new file mode 100644
index 00000000000..bef31891c97
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/cylimple.mp
@@ -0,0 +1,50 @@
+% cylimple.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+SphericalDistortion := true;
+f := 0.3*(5,4,2);
+Spread := 40;
+ShiftV := (200,200);
+
+%SphericalDistortion := false;
+%f := 3.3*(5,4,2);
+%Spread := 70;
+%Shifts := (250,250);
+
+beginfig(1);
+ color orig, axxc, ayyc, azzc;
+ color nalfa, gammacnt, vertex;
+ numeric altura, grids, radius, xxsize, aux,
+ yysize, zzsize, i, numc, slope;
+
+ altura = 1;
+ radius = 0.3;
+ grids = 1;
+ numc = 9;
+ slope = 3;
+
+ for i=1 upto numc:
+ aux := (i-1-0.5*(numc-1))*grids;
+ gammacnt := (0,aux,0);
+ vertex := (aux/slope,aux,altura);
+ nalfa := vertex - gammacnt;
+ rigorousdisc( 0, true, gammacnt, radius, nalfa );
+ endfor;
+ xxsize = radius;
+ yysize = 0.5*(numc-1)*grids;
+ zzsize = altura;
+ orig = (0,0,0);
+ axxc = (xxsize,0,0);
+ ayyc = (0,yysize,0);
+ azzc = (0,0,zzsize);
+% drawarrow rp(orig)..rp(axxc);
+% drawarrow rp(orig)..rp(ayyc);
+% drawarrow rp(orig)..rp(azzc);
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/downloadicon.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/downloadicon.mp
new file mode 100644
index 00000000000..78b9be800e7
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/downloadicon.mp
@@ -0,0 +1,66 @@
+% downloadicon.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+f := 0.4[(12,3,2),(2,5,6)]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Max: 0.8
+Spread := 30;
+TDAtiplen := 0.65;
+TDAhalftipbase := 0.35;
+TDAhalfthick := 0.15;
+
+beginfig(1);
+ color tracecol, lockcol, arrowcol;
+ numeric altura, compri, radius, altfrac, comfrac, radang;
+ path theside, thefront, thelocka, thelockb, thelock;
+ color poi[], startarrow, endarrow;
+ numeric numpl, aux, i;
+ altura = 1;
+ compri = 2;
+ radius = 0.8;
+ altfrac = 0.2;
+ comfrac = 0.15;
+ radang = 37;
+ numpl = 9;
+ tracecol = blue;
+ lockcol = black;
+ arrowcol = (0.7,0.2,0.1);
+ startarrow = (0,-radius,2);
+ endarrow = (0,0,radius);
+ currentpen := pencircle scaled 2.4mm;
+ drawoptions( withcolor tracecol );
+ rigorousdisc( 0, true, (-0.5compri,0,0), radius, (compri,0,0) );
+ poi1 = (0.5compri,-radius,0);
+ poi2 = (0.5compri,radius,0);
+ poi3 = (-0.5compri,radius,0);
+ poi4 = (0.5compri,-radius,-altura);
+ poi5 = (0.5compri,radius,-altura);
+ poi6 = (-0.5compri,radius,-altura);
+ theside = rp(poi1)--rp(poi2)--rp(poi5)--rp(poi4)--cycle;
+ thefront= rp(poi2)--rp(poi3)--rp(poi6)--rp(poi5)--cycle;
+ drawoptions( withcolor white );
+ fill theside;
+ fill thefront;
+ thelocka = rp((comfrac*compri,radius,-altfrac*altura))
+ --rp((comfrac*compri,radius,0));
+ thelockb = rp((-comfrac*compri,radius,-altfrac*altura))
+ --rp((-comfrac*compri,radius,0));
+ for i=1 upto numpl:
+ aux := i*radang/numpl;
+ poi7 := (comfrac*compri,radius*cosd(aux),radius*sind(aux));
+ poi8 := (-comfrac*compri,radius*cosd(aux),radius*sind(aux));
+ thelocka := thelocka...rp(poi7);
+ thelockb := thelockb...rp(poi8);
+ endfor;
+ thelock = thelocka--reverse thelockb--cycle;
+ drawoptions( withcolor lockcol );
+ filldraw thelock;
+ drawoptions( withcolor tracecol );
+ draw theside;
+ draw thefront;
+ drawoptions( withcolor arrowcol );
+ tdarrow( startarrow, endarrow );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/eemcsblabla.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/eemcsblabla.mp
new file mode 100644
index 00000000000..cb35011cc44
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/eemcsblabla.mp
@@ -0,0 +1,292 @@
+% Converted from PostScript(TM) to MetaPost by pstoedit
+% MetaPost backend contributed by Scott Pakin <pakin@uiuc.edu>
+% pstoedit is Copyright (C) 1993 - 2003 Wolfgang Glunz <wglunz@pstoedit.net>
+
+% eemcsblabla.mp %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Hacked by L. Nobre G.
+% 2004
+
+numeric zmax, rmax;
+zmax = 1;
+rmax = 1;
+
+def converterfunc( expr Pair ) =
+ begingroup
+ save xucf, yucf, astart, rr, xaux, yaux, raux, aaux, zaux;
+ numeric xucf, yucf, astart, rr, xaux, yaux, raux, aaux, zaux;
+ xucf = 0.21;
+ yucf = 0.002;
+ astart = 120;
+ rr = 0.0004;
+ aaux = astart + xucf*( ypart Pair );
+ raux = rr*aaux + yucf*( xpart Pair );
+ xaux = raux*cosd( aaux );
+ yaux = raux*sind( aaux );
+ zaux = zmax*(1-raux/rmax);
+ ( rp( ( xaux, yaux, zaux ) ) )
+ endgroup
+enddef;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end of first featpost part
+
+% Generate structured PostScript
+prologues := 1;
+
+% Display a given string with its *baseline* at a given location
+% and with a given rotation angle
+vardef showtext(expr origin)(expr angle)(expr string) =
+ draw string infont defaultfont scaled defaultscale
+ rotated angle shifted origin;
+enddef;
+
+defaultscale := 0.16;
+beginfig(1);
+ path PreeditedPath[];
+linecap := butt;
+linejoin := mitered;
+PreeditedPath1 = hide(z1=(309,-996.562))z1--hide(z2=(309,-984.905))z2..controls hide(z3=(309,-982.215))z3 and hide(z4=(309.097,-979.126))z4..hide(z5=(309.292,-974.344))z5
+ --hide(z6=(309.392,-971.754))z6--hide(z7=(304.908,-969.861))z7--hide(z8=(304.211,-970.259))z8
+ ..controls hide(z9=(304.609,-978.329))z9 and hide(z10=(305,-984.307))z10..hide(z11=(305,-992.078))z11
+ --hide(z12=(305,-995.764))z12--hide(z13=(281.097,-991.58))z13..controls hide(z14=(279.503,-991.281))z14 and hide(z15=(278.706,-991.082))z15..hide(z16=(277.908,-990.683))z16
+ --hide(z17=(277.709,-986.001))z17..controls hide(z18=(277.61,-982.812))z18 and hide(z19=(277,-979.624))z19..hide(z20=(277,-977.432))z20
+ ..controls hide(z21=(277,-971.255))z21 and hide(z22=(278.088,-967.171))z22..hide(z23=(279.901,-967.071))z23
+ --hide(z24=(288.768,-966.274))z24--hide(z25=(288.768,-963.883))z25..controls hide(z26=(282.392,-963.584))z26 and hide(z27=(277.41,-962.886))z27..hide(z28=(273.625,-961.791))z28
+ ..controls hide(z29=(273.425,-963.883))z29 and hide(z30=(273,-966.872))z30..hide(z31=(273,-968.665))z31
+ ..controls hide(z32=(273,-968.964))z32 and hide(z33=(273,-970.06))z33..hide(z34=(273.1,-972.451))z34
+ --hide(z35=(273.199,-984.407))z35..controls hide(z36=(273.625,-985.303))z36 and hide(z37=(273.299,-991.182))z37..hide(z38=(273.299,-992.178))z38
+ ..controls hide(z39=(273.299,-995.864))z39 and hide(z40=(273.299,-998.554))z40..hide(z41=(273.1,-1003.64))z41
+ --hide(z42=(273,-1008.12))z42--hide(z43=(276.115,-1008.42))z43--hide(z44=(276.314,-1003.04))z44
+ ..controls hide(z45=(276.414,-1000.65))z45 and hide(z46=(277.211,-999.55))z46..hide(z47=(279.005,-999.55))z47
+ ..controls hide(z48=(280.399,-999.55))z48 and hide(z49=(283.588,-999.949))z49..hide(z50=(286.577,-1000.45))z50
+ --hide(z51=(336.79,-1009.11))z51..controls hide(z52=(338.583,-1009.51))z52 and hide(z53=(339.281,-1010.71))z53..hide(z54=(339.979,-1015.09))z54
+ --hide(z55=(342,-1015.59))z55--hide(z56=(341.901,-1011.51))z56..controls hide(z57=(342.085,-1008.42))z57 and hide(z58=(341.701,-1002.24))z58..hide(z59=(341.701,-1000.25))z59
+ --hide(z60=(342,-978.827))z60--hide(z61=(342,-977.831))z61..controls hide(z62=(342,-976.436))z62 and hide(z63=(341.616,-973.945))z63..hide(z64=(341.801,-970.657))z64
+ --hide(z65=(341.701,-967.369))z65--hide(z66=(338.683,-966.971))z66..controls hide(z67=(336.691,-966.772))z67 and hide(z68=(333.702,-966.274))z68..hide(z69=(328.82,-965.377))z69
+ --hide(z70=(326.229,-964.879))z70--hide(z71=(326.229,-967.569))z71--hide(z72=(332.207,-969.163))z72
+ ..controls hide(z73=(335.794,-970.159))z73 and hide(z74=(336.99,-971.056))z74..hide(z75=(337.488,-973.248))z75
+ ..controls hide(z76=(337.886,-975.24))z76 and hide(z77=(338.384,-982.513))z77..hide(z78=(338.384,-987.894))z78
+ ..controls hide(z79=(338.384,-991.978))z79 and hide(z80=(338.284,-994.17))z80..hide(z81=(337.687,-1001.04))z81
+ --hide(z82=(337.288,-1001.04))z82..controls hide(z83=(335.893,-1001.04))z83 and hide(z84=(335.096,-1000.95))z84..cycle;
+ %draw PreeditedPath1;
+%drawoptions( withcolor black );
+ %dotlabels.rt(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);
+PreeditedPath2 = hide(z85=(310,-859.104))z85..controls hide(z86=(310,-857.61))z86 and hide(z87=(309.691,-856))z87..hide(z88=(307.698,-856))z88
+ ..controls hide(z89=(305.706,-856))z89 and hide(z90=(306,-857.73))z90..hide(z91=(306,-859.005))z91
+ --hide(z92=(306,-918.683))z92..controls hide(z93=(306,-920.078))z93 and hide(z94=(305.706,-922))z94..hide(z95=(307.698,-922))z95
+ ..controls hide(z96=(309.691,-922))z96 and hide(z97=(310,-920.09))z97..cycle;
+ %draw PreeditedPath2;
+%drawoptions( withcolor black );
+ %dotlabels.rt(85,86,87,88,89,90,91,92,93,94,95,96,97);
+PreeditedPath3 = hide(z98=(329,-859.005))z98..controls hide(z99=(329,-857.61))z99 and hide(z100=(329.019,-856))z100..hide(z101=(327.026,-856))z101
+ ..controls hide(z102=(325.034,-856))z102 and hide(z103=(325,-857.735))z103..hide(z104=(325,-859.104))z104
+ --hide(z105=(325,-918.583))z105..controls hide(z106=(325,-920.078))z106 and hide(z107=(325.034,-922))z107..hide(z108=(327.026,-922))z108
+ ..controls hide(z109=(329.019,-922))z109 and hide(z110=(329,-920.09))z110..cycle;
+ %draw PreeditedPath3;
+%drawoptions( withcolor black );
+ %dotlabels.rt(98,99,100,101,102,103,104,105,106,107,108,109,110);
+PreeditedPath4 = hide(z111=(332.008,-747.24))z111--hide(z112=(333.701,-749.831))z112..controls hide(z113=(335.594,-752.72))z113 and hide(z114=(336.69,-754.912))z114..hide(z115=(336.69,-755.908))z115
+ ..controls hide(z116=(336.69,-756.605))z116 and hide(z117=(335.794,-757.203))z117..hide(z118=(334.698,-757.203))z118
+ ..controls hide(z119=(333.701,-757.203))z119 and hide(z120=(332.805,-757.004))z120..hide(z121=(330.712,-756.506))z121
+ --hide(z122=(301.122,-749.034))z122..controls hide(z123=(299.429,-748.635))z123 and hide(z124=(297.835,-748.337))z124..hide(z125=(297.038,-748.337))z125
+ ..controls hide(z126=(295.344,-748.337))z126 and hide(z127=(293.904,-749.333))z127..hide(z128=(293.904,-750.927))z128
+ ..controls hide(z129=(293.904,-753.816))z129 and hide(z130=(295.799,-757.602))z130..hide(z131=(300.326,-763.679))z131
+ ..controls hide(z132=(304.809,-769.956))z132 and hide(z133=(308.296,-773.443))z133..hide(z134=(315.171,-778.325))z134
+ --hide(z135=(301.521,-775.336))z135..controls hide(z136=(299.529,-774.938))z136 and hide(z137=(298.034,-774.639))z137..hide(z138=(297.337,-774.639))z138
+ ..controls hide(z139=(295.444,-774.639))z139 and hide(z140=(293.904,-775.635))z140..hide(z141=(293.904,-777.229))z141
+ ..controls hide(z142=(293.904,-780.218))z142 and hide(z143=(296.214,-784.801))z143..hide(z144=(300.625,-790.281))z144
+ ..controls hide(z145=(304.012,-794.665))z145 and hide(z146=(306.104,-796.657))z146..hide(z147=(314.872,-803.133))z147
+ --hide(z148=(301.621,-799.845))z148..controls hide(z149=(300.027,-799.447))z149 and hide(z150=(298.532,-799.248))z150..hide(z151=(297.337,-799.248))z151
+ ..controls hide(z152=(295.444,-799.248))z152 and hide(z153=(293.904,-800.144))z153..hide(z154=(293.904,-801.539))z154
+ ..controls hide(z155=(293.904,-803.631))z155 and hide(z156=(296.094,-807.417))z156..hide(z157=(301.621,-814.79))z157
+ --hide(z158=(303.614,-817.579))z158--hide(z159=(305.606,-816.882))z159--hide(z160=(303.514,-813.694))z160
+ ..controls hide(z161=(301.222,-810.007))z161 and hide(z162=(301.023,-809.708))z162..hide(z163=(301.023,-809.011))z163
+ ..controls hide(z164=(301.023,-807.915))z164 and hide(z165=(302.02,-807.218))z165..hide(z166=(303.514,-807.218))z166
+ ..controls hide(z167=(308.595,-807.218))z167 and hide(z168=(327.823,-811.302))z168..hide(z169=(342.071,-815.387))z169
+ --hide(z170=(343.167,-815.088))z170--hide(z171=(341.672,-808.313))z171--hide(z172=(331.51,-806.121))z172
+ ..controls hide(z173=(320.451,-803.73))z173 and hide(z174=(314.573,-801.04))z174..hide(z175=(308.595,-795.561))z175
+ ..controls hide(z176=(304.012,-791.376))z176 and hide(z177=(301.023,-786.893))z177..hide(z178=(301.023,-784.103))z178
+ ..controls hide(z179=(301.023,-783.406))z179 and hide(z180=(301.82,-783.007))z180..hide(z181=(303.115,-783.007))z181
+ ..controls hide(z182=(306.602,-783.007))z182 and hide(z183=(317.96,-785.199))z183..hide(z184=(335.396,-789.284))z184
+ --hide(z185=(342.071,-790.878))z185--hide(z186=(343.167,-790.38))z186--hide(z187=(341.672,-783.505))z187
+ --hide(z188=(331.012,-781.413))z188..controls hide(z189=(322.942,-779.819))z189 and hide(z190=(315.47,-776.431))z190..hide(z191=(310.588,-772.048))z191
+ ..controls hide(z192=(304.51,-766.568))z192 and hide(z193=(301.023,-761.586))z193..hide(z194=(301.023,-758.398))z194
+ ..controls hide(z195=(301.023,-757.601))z195 and hide(z196=(301.92,-757.103))z196..hide(z197=(303.514,-757.103))z197
+ ..controls hide(z198=(305.905,-757.103))z198 and hide(z199=(307.3,-757.402))z199..hide(z200=(315.968,-759.594))z200
+ ..controls hide(z201=(322.244,-761.188))z201 and hide(z202=(328.222,-762.881))z202..hide(z203=(331.61,-763.878))z203
+ ..controls hide(z204=(334.399,-764.774))z204 and hide(z205=(336.99,-765.173))z205..hide(z206=(339.181,-765.173))z206
+ ..controls hide(z207=(341.672,-765.173))z207 and hide(z208=(343,-764.077))z208..hide(z209=(343,-762.184))z209
+ ..controls hide(z210=(343,-759.594))z210 and hide(z211=(340.945,-756.007))z211..cycle;
+ %draw PreeditedPath4;
+%drawoptions( withcolor black );
+ %dotlabels.rt(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);
+PreeditedPath5 = hide(z212=(309.392,-705.894))z212--hide(z213=(309.392,-703.602))z213..controls hide(z214=(302.916,-702.805))z214 and hide(z215=(299.23,-702.107))z215..hide(z216=(296.639,-701.211))z216
+ ..controls hide(z217=(295.145,-703.602))z217 and hide(z218=(293.904,-707.089))z218..hide(z219=(293.904,-710.775))z219
+ ..controls hide(z220=(293.904,-715.259))z220 and hide(z221=(297.633,-722.631))z221..hide(z222=(302.916,-728.21))z222
+ ..controls hide(z223=(307.798,-733.69))z223 and hide(z224=(318.259,-738))z224..hide(z225=(328.72,-738))z225
+ ..controls hide(z226=(338.285,-738))z226 and hide(z227=(343.096,-733.635))z227..hide(z228=(343.096,-725.321))z228
+ ..controls hide(z229=(343.096,-719.941))z229 and hide(z230=(341.186,-715.159))z230..hide(z231=(336.89,-709.679))z231
+ --hide(z232=(332.805,-704.698))z232--hide(z233=(330.812,-705.495))z233--hide(z234=(331.809,-706.989))z234
+ ..controls hide(z235=(336.591,-714.162))z235 and hide(z236=(338.096,-717.948))z236..hide(z237=(338.096,-721.435))z237
+ ..controls hide(z238=(338.096,-727.015))z238 and hide(z239=(334.174,-729.999))z239..hide(z240=(326.428,-729.999))z240
+ ..controls hide(z241=(315.668,-729.999))z241 and hide(z242=(305.307,-726.472))z242..hide(z243=(301.521,-721.535))z243
+ ..controls hide(z244=(299.927,-719.443))z244 and hide(z245=(298.904,-717.052))z245..hide(z246=(298.904,-713.963))z246
+ ..controls hide(z247=(298.904,-709.479))z247 and hide(z248=(300.897,-705.893))z248..cycle;
+ %draw PreeditedPath5;
+%drawoptions( withcolor black );
+ %dotlabels.rt(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);
+PreeditedPath6 = hide(z249=(304.359,-696.969))z249--hide(z250=(306.328,-696.969))z250..controls hide(z251=(306.101,-682.809))z251 and hide(z252=(306,-682.809))z252..hide(z253=(306,-680.083))z253
+ ..controls hide(z254=(306,-677.357))z254 and hide(z255=(305.773,-677.357))z255..hide(z256=(306,-662.743))z256
+ ..controls hide(z257=(304.563,-662.895))z257 and hide(z258=(303.878,-662.895))z258..hide(z259=(302.92,-662.895))z259
+ ..controls hide(z260=(301.936,-662.895))z260 and hide(z261=(301.179,-662.895))z261..hide(z262=(299.513,-662.743))z262
+ ..controls hide(z263=(299.892,-671.451))z263 and hide(z264=(299.968,-674.934))z264..hide(z265=(300.271,-688.942))z265
+ --hide(z266=(285.656,-675.161))z266..controls hide(z267=(277.857,-667.816))z267 and hide(z268=(273.693,-666))z268..hide(z269=(268.014,-666))z269
+ ..controls hide(z270=(259.306,-666))z270 and hide(z271=(254,-671.733))z271..hide(z272=(254,-681.068))z272
+ ..controls hide(z273=(254,-686.52))z273 and hide(z274=(255.495,-690.23))z274..hide(z275=(259.23,-693.94))z275
+ --hide(z276=(269.528,-695.227))z276--hide(z277=(269.528,-693.031))z277--hide(z278=(266.045,-692.047))z278
+ ..controls hide(z279=(261.653,-690.836))z279 and hide(z280=(260,-688.11))z280..hide(z281=(260,-683.037))z281
+ ..controls hide(z282=(260,-676.525))z282 and hide(z283=(263.996,-672))z283..hide(z284=(270.285,-672))z284
+ ..controls hide(z285=(275.964,-672))z285 and hide(z286=(281.567,-675.278))z286..cycle;
+ %draw PreeditedPath6;
+%drawoptions( withcolor black );
+ %dotlabels.rt(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);
+PreeditedPath7 = hide(z287=(330.015,-635.015))z287..controls hide(z288=(330.912,-637.705))z288 and hide(z289=(331.51,-639.499))z289..hide(z290=(333.004,-644.779))z290
+ ..controls hide(z291=(340.576,-645.477))z291 and hide(z292=(347.052,-647.967))z292..hide(z293=(356.616,-653.746))z293
+ --hide(z294=(357.712,-652.351))z294--hide(z295=(355.819,-648.266))z295..controls hide(z296=(345.358,-640.196))z296 and hide(z297=(339.082,-636.41))z297..cycle;
+ %draw PreeditedPath7;
+%drawoptions( withcolor black );
+ %dotlabels.rt(287,288,289,290,291,292,293,294,295,296,297);
+PreeditedPath8 = hide(z298=(270.736,-591))z298--hide(z299=(269.938,-591.477))z299..controls hide(z300=(271.632,-595.861))z300 and hide(z301=(272.429,-599.149))z301..hide(z302=(273.625,-607.02))z302
+ --hide(z303=(276.414,-607.02))z303--hide(z304=(276.414,-601.44))z304..controls hide(z305=(276.414,-599.647))z305 and hide(z306=(277.51,-599))z306..hide(z307=(280.499,-599))z307
+ --hide(z308=(327.026,-599))z308..controls hide(z309=(333.203,-599))z309 and hide(z310=(335.893,-599.093))z310..hide(z311=(342.867,-599.746))z311
+ --hide(z312=(343.465,-598.152))z312--hide(z313=(339.879,-594.167))z313..controls hide(z314=(342.469,-590.182))z314 and hide(z315=(343.196,-586.595))z315..hide(z316=(343.196,-581.315))z316
+ ..controls hide(z317=(343.196,-577.43))z317 and hide(z318=(342.584,-574.839))z318..hide(z319=(341.273,-572.747))z319
+ --hide(z320=(334.1,-562.784))z320..controls hide(z321=(330.912,-558.4))z321 and hide(z322=(322.643,-555))z322..hide(z323=(315.37,-555))z323
+ ..controls hide(z324=(303.812,-555))z324 and hide(z325=(296,-562.436))z325..hide(z326=(296,-572.946))z326
+ ..controls hide(z327=(296,-577.629))z327 and hide(z328=(297.606,-582.511))z328..hide(z329=(299.927,-585.101))z329
+ --hide(z330=(305.506,-591))z330--hide(z331=(306.602,-587.99))z331..controls hide(z332=(303.713,-585.201))z332 and hide(z333=(302,-581.315))z333..hide(z334=(302,-577.231))z334
+ ..controls hide(z335=(302,-568.862))z335 and hide(z336=(308.782,-563))z336..hide(z337=(319.455,-563))z337
+ ..controls hide(z338=(330.613,-563))z338 and hide(z339=(338.196,-569.219))z339..hide(z340=(338.196,-578.028))z340
+ ..controls hide(z341=(338.196,-583.208))z341 and hide(z342=(335.119,-591.001))z342..hide(z343=(333.004,-591.001))z343
+ --hide(z344=(311.584,-591))z344..controls hide(z345=(310.189,-591))z345 and hide(z346=(308.396,-589.843))z346..hide(z347=(306.602,-587.99))z347
+ --hide(z348=(305.506,-591))z348--cycle;
+PreeditedPath9 = hide(z349=(276.414,-548.138))z349--hide(z350=(276.414,-542.559))z350..controls hide(z351=(276.414,-540.765))z351 and hide(z352=(277.51,-540))z352..hide(z353=(280.499,-540))z353
+ --hide(z354=(332.108,-540))z354..controls hide(z355=(338.384,-540))z355 and hide(z356=(339.082,-540.304))z356..hide(z357=(339.281,-543.754))z357
+ --hide(z358=(339.58,-548.337))z358--hide(z359=(342.569,-548.337))z359..controls hide(z360=(342.27,-538.374))z360 and hide(z361=(342,-538.374))z361..hide(z362=(342,-535.884))z362
+ ..controls hide(z363=(342,-533.393))z363 and hide(z364=(341.701,-533.393))z364..hide(z365=(342,-523.43))z365
+ --hide(z366=(339.58,-523.43))z366--hide(z367=(339.281,-528.013))z367..controls hide(z368=(339.082,-531.4))z368 and hide(z369=(338.384,-532))z369..hide(z370=(332.108,-532))z370
+ --hide(z371=(270.736,-532))z371--hide(z372=(269.938,-532.596))z372..controls hide(z373=(271.632,-536.98))z373 and hide(z374=(272.429,-540.268))z374..cycle;
+ %draw PreeditedPath9;
+%drawoptions( withcolor black );
+ %dotlabels.rt(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);
+PreeditedPath10 = hide(z375=(291.607,-505.359))z375--hide(z376=(291.607,-501.374))z376--hide(z377=(282.641,-487.027))z377
+ ..controls hide(z378=(280.548,-483.739))z378 and hide(z379=(279.751,-483.042))z379..hide(z380=(277.958,-483.042))z380
+ ..controls hide(z381=(276.065,-483.042))z381 and hide(z382=(274.57,-484.436))z382..hide(z383=(274.57,-486.13))z383
+ ..controls hide(z384=(274.57,-487.624))z384 and hide(z385=(275.666,-489.418))z385..cycle;
+ %draw PreeditedPath10;
+%drawoptions( withcolor black );
+ %dotlabels.rt(375,376,377,378,379,380,381,382,383,384,385);
+PreeditedPath11 = hide(z386=(334.1,-489))z386--hide(z387=(342.569,-489.668))z387..controls hide(z388=(342.27,-483.192))z388 and hide(z389=(342,-483.192))z389..hide(z390=(342,-481.897))z390
+ ..controls hide(z391=(342,-481.399))z391 and hide(z392=(341.621,-478.908))z392..hide(z393=(342,-474.524))z393
+ --hide(z394=(339,-474.524))z394--hide(z395=(339.38,-478.41))z395..controls hide(z396=(339.281,-480.801))z396 and hide(z397=(338.484,-481))z397..hide(z398=(333.602,-481))z398
+ --hide(z399=(315.37,-481))z399..controls hide(z400=(300.824,-481))z400 and hide(z401=(296,-485.238))z401..hide(z402=(296,-496.941))z402
+ ..controls hide(z403=(296,-501.225))z403 and hide(z404=(296.948,-505.21))z404..hide(z405=(298.931,-508.996))z405
+ --hide(z406=(302.119,-514.015))z406--hide(z407=(308.595,-514.015))z407--hide(z408=(309.292,-511.686))z408
+ --hide(z409=(306.204,-510.391))z409..controls hide(z410=(301.521,-508.299))z410 and hide(z411=(301,-507.302))z411..hide(z412=(301,-502.719))z412
+ ..controls hide(z413=(301,-493.354))z413 and hide(z414=(304.635,-489.469))z414..hide(z415=(313.576,-489.17))z415
+ --hide(z416=(316.765,-488.999))z416--hide(z417=(329.916,-489))z417..controls hide(z418=(334.001,-491.926))z418 and hide(z419=(337.196,-498.285))z419..hide(z420=(337.196,-502.221))z420
+ ..controls hide(z421=(337.196,-506.206))z421 and hide(z422=(333.783,-510))z422..hide(z423=(329.816,-510))z423
+ ..controls hide(z424=(326.13,-510))z424 and hide(z425=(322.643,-507.884))z425..hide(z426=(320.75,-504.711))z426
+ ..controls hide(z427=(319.255,-502.193))z427 and hide(z428=(317.861,-496.654))z428..hide(z429=(316.765,-488.999))z429
+ --hide(z430=(313.576,-489.17))z430--hide(z431=(315.37,-499.033))z431..controls hide(z432=(317.861,-512.583))z432 and hide(z433=(322.543,-518))z433..hide(z434=(331.211,-518))z434
+ ..controls hide(z435=(338.982,-518))z435 and hide(z436=(343.196,-513.415))z436..hide(z437=(343.196,-505.708))z437
+ ..controls hide(z438=(343.196,-503.915))z438 and hide(z439=(342.998,-502.221))z439..cycle;
+ %draw PreeditedPath11;
+%drawoptions( withcolor black );
+ %dotlabels.rt(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);
+PreeditedPath12 = hide(z440=(321,-443.539))z440--hide(z441=(314.174,-440.55))z441--hide(z442=(314,-441.048))z442
+ --hide(z443=(314,-467.251))z443--hide(z444=(320.351,-469.941))z444--cycle;
+ %draw PreeditedPath12;
+%drawoptions( withcolor black );
+ %dotlabels.rt(440,441,442,443,444);
+PreeditedPath13 = hide(z445=(270.736,-424))z445--hide(z446=(269.938,-424.41))z446..controls hide(z447=(271.632,-428.794))z447 and hide(z448=(272.429,-432.082))z448..hide(z449=(273.625,-439.953))z449
+ --hide(z450=(276.414,-439.953))z450--hide(z451=(276.414,-434.374))z451..controls hide(z452=(276.414,-432.58))z452 and hide(z453=(277.51,-432))z453..hide(z454=(280.499,-432))z454
+ --hide(z455=(327.026,-432))z455..controls hide(z456=(333.203,-432))z456 and hide(z457=(335.893,-432.085))z457..hide(z458=(342.867,-432.68))z458
+ --hide(z459=(343.465,-431.086))z459--hide(z460=(339.879,-427.101))z460..controls hide(z461=(342.469,-423.115))z461 and hide(z462=(343.196,-419.529))z462..hide(z463=(343.196,-414.249))z463
+ ..controls hide(z464=(343.196,-410.363))z464 and hide(z465=(342.584,-407.773))z465..hide(z466=(341.273,-405.68))z466
+ --hide(z467=(334.1,-395.718))z467..controls hide(z468=(330.912,-391.334))z468 and hide(z469=(322.643,-388))z469..hide(z470=(315.37,-388))z470
+ ..controls hide(z471=(303.812,-388))z471 and hide(z472=(296,-395.409))z472..hide(z473=(296,-405.88))z473
+ ..controls hide(z474=(296,-410.562))z474 and hide(z475=(297.606,-415.444))z475..hide(z476=(299.927,-418.034))z476
+ --hide(z477=(305.506,-424))z477--hide(z478=(306.602,-420.924))z478..controls hide(z479=(303.713,-418.134))z479 and hide(z480=(302,-414.249))z480..hide(z481=(302,-410.164))z481
+ ..controls hide(z482=(302,-401.795))z482 and hide(z483=(308.782,-396))z483..hide(z484=(319.455,-396))z484
+ ..controls hide(z485=(330.613,-396))z485 and hide(z486=(338.196,-402.191))z486..hide(z487=(338.196,-410.961))z487
+ ..controls hide(z488=(338.196,-416.142))z488 and hide(z489=(335.119,-424.001))z489..hide(z490=(333.004,-424.001))z490
+ --hide(z491=(311.584,-424))z491..controls hide(z492=(310.189,-424))z492 and hide(z493=(308.396,-422.817))z493..hide(z494=(306.602,-420.924))z494
+ --hide(z495=(305.506,-424))z495--cycle;
+PreeditedPath14 = hide(z496=(276.414,-381.072))z496--hide(z497=(276.414,-375.492))z497..controls hide(z498=(276.414,-373.699))z498 and hide(z499=(277.51,-373))z499..hide(z500=(280.499,-373))z500
+ --hide(z501=(332.108,-373))z501..controls hide(z502=(338.384,-373))z502 and hide(z503=(339.082,-373.298))z503..hide(z504=(339.281,-376.688))z504
+ --hide(z505=(339.58,-381.271))z505--hide(z506=(342.569,-381.271))z506..controls hide(z507=(342.27,-371.308))z507 and hide(z508=(342,-371.308))z508..hide(z509=(342,-368.817))z509
+ ..controls hide(z510=(342,-366.326))z510 and hide(z511=(341.701,-366.326))z511..hide(z512=(342,-356.363))z512
+ --hide(z513=(339.58,-356.363))z513--hide(z514=(339.281,-360.946))z514..controls hide(z515=(339.082,-364.334))z515 and hide(z516=(338.384,-365))z516..hide(z517=(332.108,-365))z517
+ --hide(z518=(270.736,-365))z518--hide(z519=(269.938,-365.529))z519..controls hide(z520=(271.632,-369.913))z520 and hide(z521=(272.429,-373.201))z521..cycle;
+ %draw PreeditedPath14;
+%drawoptions( withcolor black );
+ %dotlabels.rt(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);
+PreeditedPath15 = hide(z522=(291.607,-338.289))z522--hide(z523=(291.607,-334.304))z523--hide(z524=(282.641,-319.957))z524
+ ..controls hide(z525=(280.548,-316.669))z525 and hide(z526=(279.751,-315.972))z526..hide(z527=(277.958,-315.972))z527
+ ..controls hide(z528=(276.065,-315.972))z528 and hide(z529=(274.57,-317.366))z529..hide(z530=(274.57,-319.06))z530
+ ..controls hide(z531=(274.57,-320.554))z531 and hide(z532=(275.666,-322.348))z532..cycle;
+ %draw PreeditedPath15;
+%drawoptions( withcolor black );
+ %dotlabels.rt(522,523,524,525,526,527,528,529,530,531,532);
+PreeditedPath16 = hide(z533=(334.1,-322))z533--hide(z534=(342.569,-322.598))z534..controls hide(z535=(342.27,-316.122))z535 and hide(z536=(342,-316.122))z536..hide(z537=(342,-314.827))z537
+ ..controls hide(z538=(342,-314.329))z538 and hide(z539=(341.621,-311.838))z539..hide(z540=(342,-307.454))z540
+ --hide(z541=(339,-307.454))z541--hide(z542=(339.38,-311.34))z542..controls hide(z543=(339.281,-313.731))z543 and hide(z544=(338.484,-314))z544..hide(z545=(333.602,-314))z545
+ --hide(z546=(315.37,-314))z546..controls hide(z547=(300.824,-314))z547 and hide(z548=(296,-318.219))z548..hide(z549=(296,-329.871))z549
+ ..controls hide(z550=(296,-334.155))z550 and hide(z551=(296.948,-338.14))z551..hide(z552=(298.931,-341.926))z552
+ --hide(z553=(302.119,-347.015))z553--hide(z554=(308.595,-347.015))z554--hide(z555=(309.292,-344.616))z555
+ --hide(z556=(306.204,-343.321))z556..controls hide(z557=(301.521,-341.229))z557 and hide(z558=(301,-340.232))z558..hide(z559=(301,-335.649))z559
+ ..controls hide(z560=(301,-326.284))z560 and hide(z561=(304.635,-322.399))z561..hide(z562=(313.576,-322.1))z562
+ --hide(z563=(316.765,-321.999))z563--hide(z564=(329.916,-322))z564..controls hide(z565=(334.001,-324.911))z565 and hide(z566=(337.196,-331.235))z566..hide(z567=(337.196,-335.151))z567
+ ..controls hide(z568=(337.196,-339.136))z568 and hide(z569=(333.783,-343))z569..hide(z570=(329.816,-343))z570
+ ..controls hide(z571=(326.13,-343))z571 and hide(z572=(322.643,-340.856))z572..hide(z573=(320.75,-337.641))z573
+ ..controls hide(z574=(319.255,-335.135))z574 and hide(z575=(317.861,-329.619))z575..hide(z576=(316.765,-321.999))z576
+ --hide(z577=(313.576,-322.1))z577--hide(z578=(315.37,-331.963))z578..controls hide(z579=(317.861,-345.513))z579 and hide(z580=(322.543,-351))z580..hide(z581=(331.211,-351))z581
+ ..controls hide(z582=(338.982,-351))z582 and hide(z583=(343.196,-346.389))z583..hide(z584=(343.196,-338.638))z584
+ ..controls hide(z585=(343.196,-336.845))z585 and hide(z586=(342.998,-335.151))z586..cycle;
+ %draw PreeditedPath16;
+%drawoptions( withcolor black );
+ %dotlabels.rt(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);
+PreeditedPath17 = hide(z587=(331.211,-292.211))z587..controls hide(z588=(331.211,-295.2))z588 and hide(z589=(334,-297.89))z589..hide(z590=(336.99,-297.89))z590
+ ..controls hide(z591=(339.979,-297.89))z591 and hide(z592=(342,-295.2))z592..hide(z593=(342,-292.311))z593
+ ..controls hide(z594=(342,-289.123))z594 and hide(z595=(339.668,-286.333))z595..hide(z596=(336.99,-286.333))z596
+ ..controls hide(z597=(334,-286.333))z597 and hide(z598=(331.211,-289.122))z598..cycle;
+ %draw PreeditedPath17;
+%drawoptions( withcolor black );
+ %dotlabels.rt(587,588,589,590,591,592,593,594,595,596,597,598);
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% second featpost part
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ verygoodcone(true, black, blue, rmax, (0,0,zmax) );
+ numeric k;
+ drawoptions( withcolor blue );
+ for k = 1 upto 17:
+ fill closedpathinspace( PreeditedPath[k], converterfunc );
+ endfor;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% That's it!
+
+endfig;
+end
+
+
+
+
+
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/embroncordada.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/embroncordada.mp
new file mode 100644
index 00000000000..ccc08d09d80
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/embroncordada.mp
@@ -0,0 +1,57 @@
+% embroncordada.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+% bash: export TEX=latex
+% tcsh: setenv TEX latex
+
+verbatimtex
+\documentclass{article}
+%\usepackage{pandora}
+\usepackage{palatino}
+\begin{document}
+etex
+
+beginfig(1);
+ picture embroncordada;
+ numeric u, v;
+ path pa;
+ u = 1mm;
+ v = 1.1mm;
+ z1 = (105u,250v);
+ z2 = (105u,220v);
+ z3 = (125u,200v);
+ z4 = (85u,180v);
+ z5 = (25u,150v);
+ z6 = (105u,120v);
+ z7 = (185u,150v);
+ z8 = (110u,170v);
+ z9 = (45u,150v);
+ z10= (100u,105v);
+ z11= (170u,150v);
+ z12= (90u,195v);
+ z13= (35u,150v);
+ z14= (120u,135v);
+ z15= (80u,100v);
+ z16= (115u,75v);
+ z17= (105u,50v);
+ pa = z1{down}..z2..z3..z4..z5..z6..z7..z8..z9..z10..
+ z11..z12..z13..z14..z15..z16..{down}z17;
+ ropepattern( pa, 8u, 35 );
+ embroncordada = thelabel( btex
+ \begin{tabular}{c}
+ \textsf{EMBRON} \\
+ \textsf{CORDADA}
+ \end{tabular}
+ etex scaled 8, (105u,150v) );
+ draw embroncordada;
+% dotlabels(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17);
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/fakehole.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/fakehole.mp
new file mode 100644
index 00000000000..c1d28ea33c1
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/fakehole.mp
@@ -0,0 +1,59 @@
+% fakehole.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+Spread := 23;
+f := (13,6,4.5);
+ShadowOn := true;
+LightSource := 10*(4,-1.7,2);
+beginfig(1);
+ numeric bigray, smaray, posray, posang, disang, aresiz, dislen;
+ numeric numl, numr, holang, i;
+ color pos, disaxe, holaxe;
+ aresiz := 13;
+ bigray := 2;
+ smaray := 0.25;
+ posray := 4;
+ posang := -10;
+ disang := 15;
+ dislen := 0.4;
+ holang := 115;
+ numl := 45;
+ disaxe := dislen*(cosd(disang),sind(disang),0);
+ pos := posray*(cosd(posang),sind(posang),0);
+ holaxe := (cosd(disang+90)*cosd(holang),
+ sind(disang+90)*cosd(holang),
+ sind(holang));
+ HoriZon := -bigray;
+ setthestage( 0.5*numl, aresiz );
+ rigorousdisc( smaray, true, pos, bigray, disaxe );
+ numr := floor(bigray/smaray);
+ for i=2-numr step 3 until -3:
+ fakehole( pos+i*smaray*holaxe, disaxe, smaray );
+ fakehole( pos-i*smaray*holaxe, disaxe, smaray );
+ endfor;
+endfig;
+
+ShadowOn := false;
+Spread := 25;
+ShiftV := 105.00mm*(0.5,1);
+beginfig(2);
+ numeric len, ray;
+ len = 10;
+ ray = 0.9;
+ f := (5,2*ray,1+1.5*ray);
+ viewcentr := (0,2.5*ray,1+0.5*ray);
+ drawoptions( withpen pencircle scaled 2.3pt );
+ kindofcube(false,true,black,0,0,0,1,len*ray,2);
+ numeric i;
+ for i=2 step 2 until len-1:
+ fakehole( (0,i*ray,1), red, ray );
+ endfor;
+endfig;
+
+end.
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/featpostlogo.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/featpostlogo.mp
new file mode 100644
index 00000000000..9e68e9899e6
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/featpostlogo.mp
@@ -0,0 +1,29 @@
+% featpostlogo.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\newfont{\normald}{logod10 scaled 5000}
+\pagestyle{empty}
+\begin{document}
+etex
+
+input boxes;
+
+beginfig(1);
+ picture logo;
+ defaultdx := 3mm;
+ defaultdy := 2mm;
+ logo = thelabel.urt( btex {\normald FEATPOST} etex, origin );
+ boxit.thelogo( logo );
+ drawboxed( thelogo );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/ffcbob.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/ffcbob.mp
new file mode 100644
index 00000000000..3e4eff5a828
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/ffcbob.mp
@@ -0,0 +1,84 @@
+% ffcbob.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+f := 2*(15,0,2);
+Spread := 20;
+
+beginfig(1);
+ numeric phi, theta, back, numbacks, minnum, maxnum;
+ phi = 30;
+ theta = 80;
+ back = 7;
+ numbacks = 30;
+ minnum = 3;
+ maxnum = 15;
+ numeric upl[], dol[], pos[], len[], rai[] rao[];
+ upl1=1; dol1=17;pos1=-5.0; len1=2.0; rai1=1.5; rao1=6.5;
+ upl2=2; dol2=16;pos2=-3.0; len2=0.8; rai2=1.5; rao2=6.3;
+ upl3=3; dol3=15;pos3=-2.2; len3=0.4; rai3=1.5; rao3=4.8;
+ upl4=4; dol4=14;pos4=-1.8; len4=0.4; rai4=1.5; rao4=4.4;
+ upl5=5; dol5=13;pos5=-1.4; len5=0.4; rai5=1.5; rao5=4.2;
+ upl6=6; dol6=11;pos6=-1.0; len6=0.2; rai6=1.5; rao6=3.2;
+ upl7=7; dol7=12;pos7=-1.0; len7=0.2; rai7=4.0; rao7=4.6;
+ upl8=8; dol8=10;pos8=-0.8; len8=0.6; rai8=1.5; rao8=3.2;
+ upl9=9; dol9=7; pos9=-0.2; len9=0.4; rai9=1.5; rao9=3.2;
+ upl10=10;dol10=9;pos10=-0.2;len10=0.2;rai10=4.0;rao10=4.4;
+ upl11=11;dol11=8;pos11=0.0; len11=0.2;rai11=4.0;rao11=4.6;
+ upl12=12;dol12=6;pos12=0.2; len12=0.8;rai12=1.5;rao12=4.8;
+ upl13=13;dol13=5;pos13=1.0; len13=0.4;rai13=1.5;rao13=4.4;
+ upl14=14;dol14=3;pos14=1.4; len14=0.2;rai14=1.5;rao14=4.4;
+ upl15=15;dol15=4;pos15=1.4; len15=0.2;rai15=4.8;rao15=6.3;
+ upl16=16;dol16=2;pos16=1.6; len16=0.6;rai16=1.5;rao16=6.3;
+ upl17=17;dol17=1;pos17=2.2; len17=2.0;rai17=1.5;rao17=6.5;
+ color axe;
+ axe = (cosd(phi)*cosd(theta),sind(phi)*cosd(theta),sind(theta));
+ numeric i;
+ for i=0 upto numbacks:
+ draw rp(back*(1,2*i/numbacks-1,-1))--
+ rp(back*(-1,2*i/numbacks-1,-1))--
+ rp(back*(-1,2*i/numbacks-1,1)) withcolor 0.7background;
+ endfor;
+ numeric crux;
+ crux = cdotprod( f, axe );
+ numeric j, k;
+ if crux <= pos[minnum+1]:
+ for i=minnum upto maxnum:
+ j := maxnum;
+ forever:
+ exitunless dol[j] <> i;
+ j := decr( j );
+ endfor;
+% rigorousdisc(rai[j],true,axe*pos[j],rao[j],axe*len[j]);
+ rigorousdisc(0,true,axe*pos[j],rao[j],axe*len[j]);
+ endfor;
+ elseif crux > pos[maxnum]:
+ for i=minnum upto maxnum:
+% rigorousdisc(rai[i],true,axe*pos[i],rao[i],axe*len[i]);
+ rigorousdisc(0,true,axe*pos[i],rao[i],axe*len[i]);
+ endfor;
+ else:
+ k := minnum+2;
+ forever:
+ exitif crux <= pos[k];
+ k := incr( k );
+ endfor;
+ for i=minnum upto k-1:
+% rigorousdisc(rai[i],true,axe*pos[i],rao[i],axe*len[i]);
+ rigorousdisc(0,true,axe*pos[i],rao[i],axe*len[i]);
+ endfor;
+ for i=k upto maxnum:
+ j := maxnum;
+ forever:
+ exitunless dol[j] <> i;
+ j := decr( j );
+ endfor;
+% rigorousdisc(rai[j],true,axe*pos[j],rao[j],axe*len[j]);
+ rigorousdisc(0,true,axe*pos[j],rao[j],axe*len[j]);
+ endfor;
+ fi;
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/fieldlinesnorma.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/fieldlinesnorma.mp
new file mode 100644
index 00000000000..ca3e1edb9b6
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/fieldlinesnorma.mp
@@ -0,0 +1,104 @@
+% fieldlinesnorma.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+Spread := 25;
+f := (10,-2,7);
+
+color posa, posb, perpd;
+numeric kfac;
+posa = -5*green;
+posb = 5*green;
+perpd = (1,0,1);
+kfac = -10;
+
+def vecfunc( expr posit )=
+ begingroup
+ save modula, modulb, field;
+ color field;
+ numeric modula, modulb;
+ modula = conorm( posit-posa );
+ modulb = conorm( posit-posb );
+ field = ( posit-posa )/(modula**3)+kfac*( posit-posb )/(modulb**3);
+ ( N(field) )
+ endgroup
+enddef;
+
+def potfunc( expr posit )=
+ begingroup
+ save field;
+ color field;
+ field = vecfunc( posit );
+ ( ncrossprod( field, perpd ) )
+ endgroup
+enddef;
+
+beginfig(1);
+ numeric i, lena, lenb, numa, numb, sa, sb, diffstep, ray;
+ color stp;
+ path oneline;
+ pen grossa, fina;
+ grossa = pencircle scaled 3pt;
+ fina = pencircle scaled 2pt;
+ lena = 85;
+ lenb = 20;
+ numa = 30;
+ numb = 18;
+ diffstep = 0.1;
+ ray = 0.5;
+ sa = 75;
+ sb = 90;
+ for i=sa step numa until (360+sa):
+ stp := posa+( ray*cosd(i), ray*sind(i), 0 );
+ oneline := fieldlinepath( lena, stp, diffstep, vecfunc );
+ draw oneline withpen grossa;
+% draw oneline withpen fina withcolor background;
+ endfor;
+ for i=sb step numb until (360+sb):
+ stp := posb+( ray*cosd(i), ray*sind(i), 0 );
+ oneline := fieldlinepath( lenb, stp, -diffstep, vecfunc );
+ draw oneline withpen grossa;
+% draw oneline withpen fina withcolor background;
+ endfor;
+ draw rp(posa) withpen grossa;
+ draw rp(posb) withpen grossa;
+endfig;
+
+Spread := 17;
+f:= (10,-6,7);
+
+beginfig(2);
+ numeric i, lena, lenb, numa, numb, sa, sb, diffstep, ang;
+ color stp;
+ path oneline;
+ pen grossa, fina;
+ grossa = pencircle scaled 3pt;
+ fina = pencircle scaled 2pt;
+ lena = 85;
+ lenb = 125;
+ numa = 0.03;
+ numb = 0.30;
+ diffstep = 0.2;
+ ang = -90;
+ sa = 1.5;
+ sb = 4.5;
+ for i=sa step numa until (1.5+sa):
+ stp := posa+i*cosd(ang)*green+i*sind(ang)*ncrossprod(perpd,green);
+ oneline := fieldlinepath( lena, stp, diffstep, potfunc );
+ draw oneline withpen grossa;
+% draw oneline withpen fina withcolor background;
+ endfor;
+ ang := 180;
+ for i=sb step numb until (3.7+sb):
+ stp := posb+i*cosd(ang)*green+i*sind(ang)*ncrossprod(perpd,green);
+ oneline := fieldlinepath( lenb, stp, diffstep, potfunc );
+ draw oneline withpen grossa;
+% draw oneline withpen fina withcolor background;
+ endfor;
+ draw rp(posa) withpen grossa;
+ draw rp(posb) withpen grossa;
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/fis1prex.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/fis1prex.mp
new file mode 100644
index 00000000000..cff9d672d88
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/fis1prex.mp
@@ -0,0 +1,131 @@
+% fis1prex.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ numeric largtecto, molasfrac, altutecto, compcorda, espetecto;
+ numeric largmolas, largnum, cordafrac, espesfrac, largmolfr;
+ numeric u, alpha, i, numturns, alphafrac, alpharadi, rcf, rcd;
+ pen mainp, auxip;
+ path leftspr, rightsp, corda, boxtecto, traco, linhalpha, rcp;
+ pair esqutecto, diretecto, esquemola, direimola, espessvec;
+ largnum = 100;
+ u = 1mm;
+ molasfrac = 0.8;
+ espesfrac = 0.1;
+ cordafrac = 0.3;
+ alphafrac = 0.3;
+ largmolfr = 0.12;
+ rcf = 0.1;
+ numturns = 11;
+ alpha = 120;
+ mainp = pencircle scaled 0.4u;
+ auxip = pencircle scaled 0.2u;
+ largtecto = largnum*u;
+ rcd = rcf*largtecto;
+ largmolas = largmolfr*molasfrac*largtecto;
+ compcorda = cordafrac*largtecto;
+ espetecto = espesfrac*largtecto;
+ altutecto = 0.5*largtecto*molasfrac*cosd(alpha/2)/sind(alpha/2);
+ alpharadi = 2*alphafrac*altutecto;
+ esqutecto = (-largtecto/2,altutecto);
+ diretecto = (largtecto/2,altutecto);
+ esquemola = (-largtecto*molasfrac/2,altutecto);
+ direimola = (largtecto*molasfrac/2,altutecto);
+ espessvec = (0,espetecto);
+ boxtecto = esqutecto--
+ diretecto--
+ (diretecto+espessvec)--
+ (esqutecto+espessvec)--cycle;
+ traco = (origin--(dir(45))) scaled 6in;
+ for i=-largnum upto largnum:
+ draw traco shifted (2*i*u,0) withpen auxip;
+ endfor;
+ clip currentpicture to boxtecto;
+ pickup mainp;
+ draw esqutecto--diretecto;
+ leftspr = springpath(direimola,origin,numturns,largmolas,0.55);
+ rightsp = springpath(origin,esquemola,numturns,largmolas,0.55);
+ draw leftspr;
+ draw rightsp;
+ rcp = randomcirc( rcd, 0.1*rcd, 180 ) shifted (0,-compcorda);
+ draw rcp;
+ draw origin--(0,-compcorda) cutafter rcp;
+ linhalpha = fullcircle scaled alpharadi;
+ linhalpha := linhalpha cutafter rightsp;
+ linhalpha := linhalpha cutbefore leftspr;
+ draw linhalpha withpen auxip;
+ label(btex m etex scaled 3, (0,-compcorda) );
+ label.urt(btex $\alpha$ etex scaled 3, (0,alpharadi/2) );
+endfig;
+
+beginfig(2);
+ numeric u, basesize, baseheight, alphang, thetang, sfearsize;
+ numeric armsize, marginraise, totalraise, axeray, cardansize;
+ color basepos, tdorigin, oneaxe, otheraxe, rotaxbascenter, axedir;
+ color gluaxbascenter, rotrajcenter, cardanpos, refpoint, anotheraxe;
+ color armdir, armbasonepos, armbastwopos, sfearpos;
+ path glueaxebase, rotataxebase, rotrajector, axepath, sfearpath;
+ numeric armray;
+ u = 0.0125mm;
+ basesize = 30u;
+ baseheight = 3u;
+ alphang = 20;
+ thetang = -18;
+ armsize = 25u;
+ marginraise = 6u;
+ axeray = 3u;
+ cardansize = 3u;
+ sfearsize = 4u;
+ armray = 1.5u;
+ totalraise = armsize*sind(alphang)+marginraise+cardansize*cosd(alphang);
+ basepos = (0,0,-0.5baseheight);
+ f := -2*(-2basesize,-basesize,-5baseheight);
+ kindofcube(false, false, basepos, 0, 0, 0, 2basesize, 2basesize, baseheight );
+ tdorigin = (0,0,0);
+ oneaxe = (0,axeray/cosd(alphang),0);
+ otheraxe = (1,0,0);
+ anotheraxe = (0,cosd(alphang),-sind(alphang));
+ gluaxbascenter = tdorigin - (0,totalraise*sind(alphang),0);
+ glueaxebase = ellipticpath( gluaxbascenter, oneaxe, axeray*otheraxe );
+ axedir = (0,sind(alphang),cosd(alphang));
+ rotrajcenter = (0,0,totalraise);
+ rotaxbascenter = rotrajcenter-axedir*cardansize;
+ refpoint = rotrajcenter+axedir*cardansize;
+ rotataxebase = rigorouscircle( rotaxbascenter, axedir, axeray );
+ rotrajector = rigorouscircle( rotrajcenter, axedir, armsize );
+ axepath = twocyclestogether( glueaxebase, rotataxebase );
+ fill axepath withcolor background;
+ draw axepath;
+ draw rotataxebase;
+ drawarrow subpath (3,10.5) of rotrajector dashed evenly;
+% dotlabel.top( btex 1 etex, point 1 of rotrajector );
+% dotlabel.top( btex 5 etex, point 5 of rotrajector );
+% dotlabel.top( btex 3 etex, point 3 of rotrajector );
+ kindofcube(false,false,rotrajcenter,90,90-alphang,thetang,2cardansize,2cardansize,2cardansize);
+ draw rp(refpoint);
+ armdir := otheraxe*cosd(thetang)+anotheraxe*sind(thetang);
+ armbasonepos = rotrajcenter + cardansize*armdir;
+ armbastwopos = rotrajcenter + (armsize-sfearsize)*armdir; % NOT RIGOROUS
+ sfearpos = rotrajcenter + armsize*armdir;
+ rigorousdisc( 0, true, armbasonepos, armray, armbastwopos-armbasonepos );
+ sfearpath = rigorousfearpath( sfearpos, sfearsize );
+ fill sfearpath withcolor background;
+ draw sfearpath;
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/fis3prex.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/fis3prex.mp
new file mode 100644
index 00000000000..0fbc862c3b2
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/fis3prex.mp
@@ -0,0 +1,481 @@
+% fis3prex.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+def platecap( expr Xpos, Shade, Angle, Oray, Iray, NumPoints ) =
+ begingroup
+ path perim, op, ip;
+ numeric i;
+ color axey, axmz, tp;
+ axey = cosd( Angle )*green + sind( Angle )*blue;
+ axmz = -cosd( Angle )*blue + sind( Angle )*green;
+ tp = Xpos*red;
+ op = rp( tp+Oray*axey )
+ for i=1 upto NumPoints:
+ ..rp(tp+Oray*(cosd(i*180/NumPoints)*axey+sind(i*180/NumPoints)*axmz))
+ endfor;
+ ip = rp( tp+Iray*axey )
+ for i=1 upto NumPoints:
+ ..rp(tp+Iray*(cosd(i*180/NumPoints)*axey+sind(i*180/NumPoints)*axmz))
+ endfor;
+ perim = op--reverse ip--cycle;
+ fill perim withcolor Shade;
+ draw perim
+ endgroup
+enddef;
+
+beginfig(1);
+ f := ( 4, 1, 2 );
+ numeric i, j, xsiz, ysiz, gstep, angl, vlen, fact, xa, xb, yb;
+ color vdir, bpos, ap, bp, cp, dp;
+ path base;
+ xsiz = 2;
+ ysiz = 3;
+ gstep = 0.23;
+ angl = 33;
+ vlen = 0.45;
+ fact = 1.3;
+ vdir = vlen*( 0, cosd(angl), sind(angl) );
+ xa = 0.5*gstep;
+ xb = (xsiz+0.5)*gstep;
+ yb = (ysiz+0.5)*gstep;
+ ap = (-xa,-xa,0);
+ bp = (-xa,yb,0);
+ cp = (xb,yb,0);
+ dp = (xb,-xa,0);
+ for i=0 upto xsiz:
+ for j=0 upto ysiz:
+ bpos := gstep*(i,j,0);
+ draw rp(bpos-fact*vdir)--rp(bpos);
+ drawarrow rp(bpos-fact*vdir)--rp(bpos-vdir);
+ endfor;
+ endfor;
+ base = rp(ap)--rp(bp)--rp(cp)--rp(dp)--cycle;
+ fill base withcolor 0.7background;
+ draw base;
+ for i=0 upto xsiz:
+ for j=0 upto ysiz:
+ bpos := gstep*(i,j,0);
+ draw rp(bpos+fact*vdir)--rp(bpos);
+ drawarrow rp(bpos)--rp(bpos+vdir);
+ endfor;
+ endfor;
+ draw rp(black)--rp( (0,0,vlen) ) dashed evenly;
+ angline( fact*vdir, (0,0,vlen), black, 0.7*vlen, btex 57$^\circ$ etex, urt );
+ label.top( btex $\vec{B}$ etex, rp(vdir) );
+endfig;
+
+beginfig(2);
+ f := ( 4, 3, 2 );
+ numeric i, numplates, xdelta, iangle, ang, oray, iray, numpois;
+ numeric aang, imray, omray, mmray, axray, numouts;
+ color shade, shadea, shadeb, p[];
+ path fucir, outerarrow, theknob;
+ numplates = 11;
+ numouts = 2;
+ xdelta = 0.1;
+ iangle = 53;
+ oray = 0.5;
+ iray = 0.07;
+ imray = 0.52;
+ omray = 0.67;
+ mmray = 0.64;
+ axray = 0.04;
+ numpois = 10;
+ shadea = 0.8background;
+ shadeb = 0.6background;
+ fucir = rigorouscircle( (-(numplates-1)*xdelta,0,0), red, imray );
+ outerarrow = subpath (1.7,2.3) of fucir;
+ p1 = ( -(numplates-1)*xdelta, imray, 0 );
+ p2 = ( -(numplates-1)*xdelta, omray, 0 );
+ p3 = ( -(numplates-2)*xdelta, imray, 0 );
+ p4 = ( -(numplates-2)*xdelta, omray, 0 );
+ p5 = ( -(numplates-4)*xdelta, mmray, 0 );
+ p6 = ( -(numplates-2)*xdelta, mmray, 0 );
+ p7 = ( -(numplates+1)*xdelta, mmray, 0 );
+ p8 = ( -(numplates-1)*xdelta, mmray, 0 );
+ p9 = ( -xdelta, cosd( 0.5*iangle )*0.5*oray, sind( 0.5*iangle )*0.5*oray );
+ p0 = ( 0, cosd( 0.5*iangle )*0.5*oray, -sind( 0.5*iangle )*0.5*oray );
+ for i=1-numplates upto 0:
+ if odd(i):
+ shade := shadea;
+ ang := iangle;
+ else:
+ shade := shadeb;
+ ang := 0;
+ fi;
+ platecap( i*xdelta, shade, ang, oray, iray, numpois );
+ background := shadea;
+ rigorousdisc( 0, true, (i*xdelta,0,0), axray, xdelta*red );
+ background := shadeb;
+ rigorousdisc( 0, true, (i*xdelta,-oray,0), axray, xdelta*red );
+ background := background;
+ endfor;
+ for i=1 upto numouts:
+ background := shadea;
+ rigorousdisc( 0, true, (i*xdelta,0,0), axray, xdelta*red );
+% background := shadeb;
+% rigorousdisc( 0, true, (i*xdelta,-oray,0), axray, xdelta*red );
+ endfor;
+ theknob = rigorousfearpath( ((numouts+1)*xdelta,0,0), 2*axray );
+ fill theknob;
+ draw theknob;
+ background := background;
+ draw rp(p1)--rp(p2);
+ draw rp(p3)--rp(p4);
+ drawarrow rp(p5)--rp(p6);
+ drawarrow rp(p7)--rp(p8);
+ drawarrow outerarrow;
+ label.ulft( btex $d$ etex, rp(p7) );
+ label( btex $A$ etex, rp(p9) );
+ label( btex $A$ etex, rp(p0) );
+endfig;
+
+beginfig(3);
+ f := ( 3, 2, 1 );
+ numeric oray, iray;
+ path opath, ipath;
+ color lRpos, Rpos, Ppos, zpos, rpos, spos;
+ oray = 0.5;
+ iray = 0.2oray;
+ opath = rigorouscircle( black, blue, oray );
+ ipath = rigorouscircle( black, blue, 0.2oray );
+ fill opath withcolor 0.7background;
+ fill ipath withcolor background;
+ draw opath;
+ draw ipath;
+ lRpos = ( oray, 0, 0 );
+ Rpos = 0.5lRpos;
+ Ppos = ( 0, 0, 2oray );
+ zpos = 0.5Ppos;
+ rpos = ( 0, iray, 0 );
+ spos = -Rpos;
+ drawarrow rp(black)--rp(lRpos);
+ drawarrow rp(black)--rp(Ppos);
+ drawarrow rp(black)--rp(rpos);
+ dotlabel.lft( btex $P$ etex, rp(Ppos) );
+ label.rt( btex $z$ etex, rp(zpos) );
+ label.ulft( btex $R$ etex, rp(Rpos) );
+ label.lrt( btex $r$ etex, rp(rpos) );
+ label( btex $\sigma$ etex, rp(spos) );
+endfig;
+
+beginfig(4);
+ f := ( 3, 4, 2 );
+ numeric raya, rayb, rayc, lena, lenb;
+ color baseac, baseav, basebc, basebv, rayabbeg, rayabend, lambdapos;
+ raya = 0.017;
+ rayb = 0.1;
+ rayc = 0.2;
+ lena = 1.4;
+ lenb = 0.6;
+ baseac = 0.5*lena*red;
+ baseav = -lena*red;
+ basebc = 0.5*lenb*red;
+ basebv = -lenb*red;
+ rayabbeg = ( 0.5*lenb, raya, 0 );
+ rayabend = ( 0.5*lenb, rayc, 0 );
+ lambdapos = ( 0, rayc, 0 );
+ rigorousdisc( 0, true, basebc, rayc, basebv );
+ rigorousdisc( 0, true, baseac, raya, baseav );
+ rigorousdisc( 0, false, basebc, rayc, basebv );
+ drawarrow rp( rayabbeg )--rp( rayabend );
+ label.bot( btex $R$ etex, rp( 0.5[rayabbeg,rayabend] ) );
+ label( btex $\lambda_t$ etex, rp ( lambdapos ) );
+ label.lrt( btex $\lambda_f$ etex, rp( 0.3[baseac,basebc] ) );
+endfig;
+
+beginfig(5);
+ f := ( 5, 5, 3 );
+ numeric i, numpoints, ray, aux, blen, bang, fa, fb, fc, fd;
+ path wirea, wireb, wirec, wired, wirepath;
+ color wa[], wb[], btip, xpos;
+ pen bigpen, smallpen;
+ numpoints = 36;
+ ray = 0.5;
+ blen = 0.8;
+ fa = -1.1;
+ fb = -0.8;
+ fc = -fb;
+ fd = -fa;
+ bang = -45;
+ btip = blen*(0,cosd( bang ), sind( bang ) );
+ for i=1 upto numpoints:
+ aux := i*180/numpoints;
+ wa[i] = ray*(red*cosd(aux)+green*sind(aux));
+% drawarrow rp( wa[i] )--rp( wa[i]+btip );
+ wb[i] = ray*(-red*cosd(aux)-blue*sind(aux));
+% drawarrow rp( wb[i] )--rp( wb[i]+btip );
+ endfor;
+ wirepath = for i=1 upto numpoints:
+ rp( wa[i] )-- endfor for i=1 upto numpoints:
+ rp( wb[i] )-- endfor cycle;
+ bigpen = pencircle scaled 3pt;
+ smallpen = pencircle scaled 2.2pt;
+ draw wirepath withpen bigpen;
+ wirea = rp( wb[numpoints] ) for i=1 upto numpoints:
+ --rp( wa[i] ) endfor;
+ wireb = rp( wa[numpoints] ) for i=1 upto numpoints:
+ --rp( wb[i] ) endfor;
+ wirec = rp( wb[numpoints-1] )--wirea--rp( wb[1] );
+% wired = rp( wa[numpoints-1] )--wireb--rp( wa[1] );
+ draw wireb withpen smallpen withcolor background;
+% cartaxes( 2ray, 2ray, 1.2ray );
+ draw rp( 2*ray*red )--rp( -2*ray*red ) dashed evenly;
+ draw rp( black )--rp( -ray*blue );
+ draw rp( black )--rp( ray*green );
+ for i=-1 upto 1:
+ xpos := (i*ray,0,0);
+ drawarrow rp( xpos+fa*btip )--rp( xpos+fb*btip );
+ drawarrow rp( xpos+fb*btip )--rp( xpos+fc*btip );
+ draw rp( xpos+fc*btip )--rp( xpos+fd*btip );
+ endfor;
+ squareangline( -ray*blue, ray*green, black, 0.1*ray);
+ draw wirea withpen bigpen;
+ draw wirec withpen smallpen withcolor background;
+ label.urt( btex $\vec{B}$ etex, rp( btip ) );
+endfig;
+
+beginfig(6);
+ path baset, sphere;
+ color va, vb, vc, qpos;
+ va = (0,0,0);
+ vb = (0.5,0.5*sqrt(3),0);
+ vc = (-0.5,0.5*sqrt(3),0);
+ baset = rp( va )--rp( vb )--rp( vc )--cycle;
+ draw baset;
+ qpos = (0,0.333*sqrt(3),0.333*sqrt(1-0.333*sqrt(3)) );
+ sphere = rigorousfearpath( qpos, 0.1 );
+ fill sphere withcolor background;
+ draw sphere;
+ label( btex +$q$ etex, rp( qpos ) );
+endfig;
+
+beginfig(7);
+ Spread := 50;
+ f := (4,6,3.5);
+ path fiodecima, fioabaixo, malhacub, rama, ramb, ramc;
+ path malhatet, ramd, rame;
+ pen grossa, nuclear, negat;
+ color p[];
+ numeric altura, margem, largneg, largpos, afast, lengax, lscal;
+ pair topo, base, decima, abaixo, centerfont, centerneg, centerpos;
+ pair a, b, c, d, tx, ty, tz;
+ altura = 2cm;
+ margem = 3mm;
+ largneg = 9mm;
+ largpos = 18mm;
+ afast = 5cm;
+ lengax = 0.7;
+ lscal = 2;
+ grossa = pencircle scaled 2.7pt;
+ nuclear = pencircle scaled 2.1pt;
+ negat = pencircle scaled 1.8pt;
+ p1 = (1,1,-1);
+ p2 = (-1,1,-1);
+ p3 = (-1,-1,-1);
+ p4 = (1,-1,-1);
+ p5 = (1,1,1);
+ p6 = (-1,1,1);
+ p7 = (-1,-1,1);
+ p8 = (1,-1,1);
+ p0 = (0,0,1);
+ p9 = (0,0,-1);
+ z1 = rp(p1);
+ z2 = rp(p2);
+ z3 = rp(p3);
+ z4 = rp(p4);
+ z5 = rp(p5);
+ z6 = rp(p6);
+ z7 = rp(p7);
+ z8 = rp(p8);
+ z0 = rp(p0);
+ z9 = rp(p9);
+ tx = rp( p1 - (lengax,0,0) );
+ ty = rp( p1 - (0,lengax,0) );
+ tz = rp( p1 + (0,0,lengax) );
+ topo = (xpart z0, altura + ypart z0);
+ base = (xpart z9, -altura + ypart z9);
+ decima = (afast + xpart topo, ypart topo);
+ abaixo = (afast + xpart base, ypart base);
+ centerfont = 0.5*(decima+abaixo);
+ centerpos = (xpart centerfont, 0.5*margem + ypart centerfont);
+ centerneg = (xpart centerfont, -0.5*margem + ypart centerfont);
+ fiodecima = z0--topo--decima--centerpos;
+ fioabaixo = z9--base--abaixo--centerneg;
+ a = ( -0.5*largpos + xpart centerfont, ypart centerpos);
+ b = ( 0.5*largpos + xpart centerfont, ypart centerpos);
+ c = ( -0.5*largneg + xpart centerfont, ypart centerneg);
+ d = ( 0.5*largneg + xpart centerfont, ypart centerneg);
+ malhacub = z1--z2--z3--z4--z1--z5--z6--z7--z8--z5;
+ malhatet = z2--z7--z4--z5--cycle;
+ rama = z2--z6;
+ ramb = z3--z7;
+ ramc = z4--z8;
+ ramd = z5--z7;
+ rame = z2--z4;
+ drawoptions( dashed evenly );
+ draw malhacub;
+ draw rama;
+ draw ramb;
+ draw ramc;
+ drawoptions( withpen grossa );
+ draw malhatet;
+ draw ramd;
+ draw rame;
+% drawoptions( withpen nuclear withcolor background );
+% draw malhatet;
+% draw ramd;
+% draw rame;
+ drawoptions();
+ draw fiodecima;
+ draw fioabaixo;
+ draw a--b;
+ drawarrow z1--tx withpen negat;
+ drawarrow z1--ty withpen negat;
+ drawarrow z1--tz withpen negat;
+ label.lrt(btex $x$ etex scaled lscal, tx);
+ label.llft(btex $y$ etex scaled lscal, ty);
+ label.lft(btex $z$ etex scaled lscal, tz);
+ linecap := butt;
+ draw c--d withpen negat;
+endfig;
+
+beginfig(8);
+ Spread := 50;
+ f := (6,6,3.5);
+ numeric squareside, sray, cdiameter, cray, distmargin, linemargin, eloing;
+ squareside = 1;
+ cdiameter = squareside/0.88623;
+ cray = cdiameter/2.0;
+ sray = squareside/2.0;
+ distmargin = 0.5;
+ linemargin = 0.15;
+ eloing = 0.4;
+ pen pena, penb, penc;
+ pena = pencircle scaled 1.3mm;
+ penb = pencircle scaled 0.95mm;
+ penc = pencircle scaled 0.4mm;
+ color tracecol, outcol, incol;
+ tracecol = 0.5white;
+ outcol = black;
+ incol = 0.876white;
+ color va, vb, vc, vd, cen, bs, bc, fs, fc, ds, dc;
+ va = (0,-sray,-sray);
+ vb = (0,sray,-sray);
+ vc = (0,sray,sray);
+ vd = (0,-sray,sray);
+ cen = (-distmargin,0,0);
+ bs = (0,-sray-linemargin,0);
+ bc = bs+cen;
+ fs = (0,sray+eloing,0);
+ ds = (0,sray+eloing-linemargin,0);
+ fc = fs+cen;
+ dc = ds+cen;
+ path rigcirc, carrpath, square, circ, sline, cline, dline;
+ square = rp(va)--rp(vb)--rp(vc)--rp(vd)--cycle;
+ circ = goodcirclepath( cen, red, cray );
+ rigcirc = rigorouscircle( cen, red, cray+linemargin );
+ carrpath = subpath (1,2) of rigcirc;
+ sline = rp(bs)--rp(fs);
+ cline = rp(bc)--rp(fc);
+ dline = rp(ds)--rp(dc);
+
+ draw cline withpen penc withcolor tracecol;
+ draw circ withpen pena withcolor outcol;
+ draw circ withpen penb withcolor incol;
+ draw sline withpen penc withcolor tracecol;
+ draw square withpen pena withcolor outcol;
+ draw square withpen penb withcolor incol;
+ drawdblarrow dline withpen penc withcolor tracecol;
+
+ pair begsarr, endsarr;
+ begsarr = rp((0,-sray-linemargin,linemargin));
+ endsarr = rp((0,-sray-linemargin,sray));
+ drawarrow begsarr--endsarr withpen penc withcolor tracecol;
+ drawarrow carrpath withpen penc withcolor tracecol;
+
+ label.lft( btex $I$ etex, rp((0,-sray-linemargin,sray-linemargin)) );
+ label.top( btex $+$ etex, point 1.5 of rigcirc );
+ label.top( btex $d$ etex, rp(dc) );
+endfig;
+
+beginfig(9);
+ Spread := 50;
+ f := (6,6,3.5);
+ numeric squareside, sray, cdiameter, cray, distmargin, linemargin, eloing;
+ squareside = 1;
+ cdiameter = squareside/0.88623;
+ cray = cdiameter/2.0;
+ sray = squareside/2.0;
+ distmargin = 0.5;
+ linemargin = 0.15;
+ eloing = 0.4;
+ pen pena, penb, penc;
+ pena = pencircle scaled 1.3mm;
+ penb = pencircle scaled 0.95mm;
+ penc = pencircle scaled 0.4mm;
+ color tracecol, outcol, incol;
+ tracecol = 0.5white;
+ outcol = black;
+ incol = 0.876white;
+ color va, vb, vc, vd, cen, bs, bc, fs, fc, ds, dc, os, oc, ncc;
+ va = (0,-sray,-sray);
+ vb = (0,sray,-sray);
+ vc = (0,sray,sray);
+ vd = (0,-sray,sray);
+ cen = (-distmargin,0,0);
+ bs = (0,-sray-linemargin,0);
+ bc = bs+cen;
+ fs = (0,sray+eloing,0);
+ ds = (0,sray+eloing-linemargin,0);
+ fc = fs+cen;
+ dc = ds+cen;
+ os = (linemargin,sray,0);
+ oc = (-distmargin-cdiameter-linemargin,sray,0);
+ ncc = (-distmargin-cray,sray,0);
+ path rigcirc, carrpath, square, circ, sline, cline, dline, oline;
+ square = rp(va)--rp(vb)--rp(vc)--rp(vd)--cycle;
+ circ = goodcirclepath( ncc, green, cray );
+ rigcirc = rigorouscircle( ncc, green, cray+linemargin );
+ carrpath = subpath (3,4) of rigcirc;
+ sline = rp(bs)--rp(fs);
+ cline = rp(bc)--rp(fc);
+ dline = rp(ds)--rp(dc);
+ oline = rp(os)--rp(oc);
+
+ draw oline withpen penc withcolor tracecol;
+ draw cline withpen penc withcolor tracecol;
+ draw circ withpen pena withcolor outcol;
+ draw circ withpen penb withcolor incol;
+ draw sline withpen penc withcolor tracecol;
+ draw square withpen pena withcolor outcol;
+ draw square withpen penb withcolor incol;
+ drawdblarrow dline withpen penc withcolor tracecol;
+
+ pair begsarr, endsarr;
+ begsarr = rp((0,-sray-linemargin,linemargin));
+ endsarr = rp((0,-sray-linemargin,sray));
+ drawarrow begsarr--endsarr withpen penc withcolor tracecol;
+ drawarrow carrpath withpen penc withcolor tracecol;
+
+ label.lft( btex $I$ etex, rp((0,-sray-linemargin,sray-linemargin)) );
+ label.top( btex $+$ etex, point 3.5 of rigcirc );
+ label.bot( btex $d$ etex, rp(dc) );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/geombasic.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/geombasic.mp
new file mode 100644
index 00000000000..168f1cc9fc5
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/geombasic.mp
@@ -0,0 +1,82 @@
+% geombasic.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+% Kind of graph that physicists do a lot. Play with the angles
+% and h a little to see what happens. Change the point of view f.
+% Change the position of symbols using the last argument of angline.
+
+beginfig(1);
+
+ f := (3,5,2);
+
+ Spread := 155;
+
+ ShiftV := origin;
+
+ gamma := 30;
+ theta := 15;
+ phi := 40;
+ h := 1.2;
+
+ p := 0.75;
+ ppp := 0.8;
+
+ mythick := 0.9pt;
+
+ color c[], n[], H;
+ c0 := (0,0,0);
+ n0 := (cosd(gamma),0,sind(gamma));
+ n1 := (cosd(gamma+theta),0,sind(gamma+theta));
+ n2 := (cosd(gamma)*cosd(phi),cosd(gamma)*sind(phi),sind(gamma));
+ n3 := (cosd(gamma+theta)*cosd(phi),
+ cosd(gamma+theta)*sind(phi),sind(gamma+theta));
+ n4 := (cosd(phi),sind(phi),0);
+ H := h*(-sind(gamma),0,cosd(gamma));
+ c1 := (0,0,Z(p*n1));
+ c2 := (0,0,Z(p*n2));
+ c3 := (1,0,0);
+ c4 := (0,0,1);
+ c5 := (X(H),0,0);
+ pickup pencircle scaled 1.25pt;
+ drawarrow rp(c0)..rp(n0);
+ drawarrow rp(c0)..rp(n3);
+ drawarrow rp(c0)..rp(H);
+ label.urt(btex $\vec{n}_0$ etex,rp(n0));
+ label.urt(btex $\vec{n}$ etex,rp(n3));
+ label.lft(btex $\vec{H}$ etex,rp(H));
+ pickup pencircle scaled mythick;
+ cartaxes(1,1,1);
+% draw rp(c0)--rp(p*n1) dashed evenly scaled 2;
+% draw rp(c0)--rp(p*n2) dashed evenly scaled 2;
+ draw rp(c0)--rp(c5)--rp(H) dashed evenly scaled 1.5;
+% draw rp(c1)..rp(p*n1) dashed evenly scaled 2;
+ draw rp(c1)..rp(p*n3) dashed evenly scaled 1.5;
+% draw rp(c2)..rp(p*n0) dashed evenly scaled 2;
+% draw rp(c2)..rp(p*n2) dashed evenly scaled 2;
+ draw rp(c0)..rp(n4) dashed evenly scaled 1.5;
+ angline(c3,n0,c0,ppp,btex $\gamma$ etex,lft);
+% angline(n0,n1,c0,p,btex $\theta$ etex,rt);
+% angline(p*n0,p*n2,c2,X(p*n0),btex $\phi$ etex,lrt);
+% angline(p*n1,p*n3,c1,X(p*n1),btex $\phi$ etex,ulft);
+% angline(n2,n3,c0,p,btex $\theta $ etex,urt);
+ angline(c4,H,c0,ppp,btex $\gamma$ etex,top);
+ angline(n4,n3,c0,p,btex $\gamma+\theta$ etex,lft);
+ angline(n4,c3,c0,p,btex $\phi$ etex,llft);
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/geomfiguei.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/geomfiguei.mp
new file mode 100644
index 00000000000..81abd780492
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/geomfiguei.mp
@@ -0,0 +1,71 @@
+% geomfiguei.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+
+ f := 3*(1.2,1.7,0.8);
+
+ Spread := 125;
+
+ color origr, nzero, nothr, ndxyl, vmagf, mfxzp, mfxyp, mfxxp;
+ numeric alphan, gamman, thetan, phiang, mfsize, axxc, ayyc, azzc;
+ numeric phiarmlen, alphafac;
+ axxc = 0.99;
+ ayyc = 0.87; % make this 1.28 when in twist-bend geometry
+ azzc = 0.82;
+ alphan = 170; % make this 90 to get the twist-bend geometry
+ gamman = 25;
+ thetan = 10;
+ phiang = 30;
+ mfsize = 1.25;
+ phiarmlen = 0.75;
+ alphafac = 1.4;
+ origr = (0,0,0);
+ nzero = (cosd(gamman),0,sind(gamman));
+ ndxyl = phiarmlen*(cosd(phiang),sind(phiang),0);
+ nothr = (cosd(phiang)*cosd(gamman+thetan),
+ sind(phiang)*cosd(gamman+thetan),sind(gamman+thetan));
+ vmagf = mfsize*(cosd(alphan)*sind(gamman),sind(alphan),
+ -cosd(alphan)*cosd(gamman));
+ mfxzp = (X(vmagf),0,Z(vmagf));
+ mfxyp = (X(vmagf),Y(vmagf),0);
+ mfxxp = (X(vmagf),0,0);
+ cartaxes( axxc, ayyc, azzc );
+ draw rp(origr)--rp(ndxyl) dashed evenly;
+ draw rp(origr)--rp(mfxzp)--rp(vmagf) dashed evenly;
+ draw rp(origr)--rp(mfxyp)--rp(vmagf) dashed evenly;
+ draw rp(origr)--rp(alphafac*mfxyp) dashed evenly;
+ draw rp(mfxzp)--rp(mfxxp)--rp(origr) dashed evenly;
+ draw rp(mfxyp)--rp(mfxxp) dashed evenly;
+ draw rp((0,0,Z(nothr)))--rp(nothr) dashed evenly;
+ angline(nzero,(1,0,0),origr,0.65,btex $\gamma$ etex,lft);
+ angline(ndxyl,(1,0,0),origr,0.5,btex $\phi$ etex,llft);
+ angline(ndxyl,nothr,origr,0.5,btex $\gamma+\theta$ etex,lft);
+ angline(vmagf,(0,0,1),origr,0.5,btex $\beta$ etex,top); % twist-bend
+ angline(mfxyp,(1,0,0),origr,0.8,btex $\alpha$ etex,bot);
+ pickup pencircle scaled 1.15pt;
+ drawarrow rp(origr)..rp(nzero);
+ drawarrow rp(origr)..rp(nothr);
+ drawarrow rp(origr)..rp(vmagf);
+ label.ulft(btex $\vec{n}_0$ etex,rp(nzero));
+ label.ulft(btex $\vec{n}$ etex,rp(nothr));
+ label.urt(btex $\vec{H}$ etex,rp(vmagf));
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/geommine.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/geommine.mp
new file mode 100644
index 00000000000..939fc35ed94
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/geommine.mp
@@ -0,0 +1,104 @@
+% geommine.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\usepackage{bbold}
+\begin{document}
+etex
+
+beginfig(1);
+
+ beta := 15;
+ alpha := 40;
+ psi := 26;
+ theta := 32;
+ phi := -33;
+ h := 1.35;
+ v := 0.4;
+ xlen := 1.2;
+ ylen := 0.65;
+ phirad := 0.67;
+
+ f := (3,5,3);
+ Spread := 100;
+
+ color c[], n[], H, h[], Vel, xloc, yloc, vx, vy;
+ c0 := (0,0,0);
+ cartaxes(xlen,ylen,1.0);
+ n0 := (cosd(beta),0,sind(beta));
+ n3 := (0,sind(phi),0);
+ n2 := n0 + n3;
+ n5 := n3 + cosd(phi)*n0;
+ n4 := cosd(theta)*n5;
+ Fx:=sind(alpha)*cosd(beta)-cosd(alpha)*cosd(psi)*sind(beta);
+ Fy:=cosd(alpha)*sind(psi);
+ Fz:=sind(alpha)*sind(beta)+cosd(alpha)*cosd(psi)*cosd(beta);
+ nx:=cosd(theta)*cosd(phi)*cosd(beta)-sind(theta)*sind(beta);
+ ny:=cosd(theta)*sind(phi);
+ nz:=cosd(theta)*cosd(phi)*sind(beta)+sind(theta)*cosd(beta);
+ n1 := (nx,ny,nz);
+ xloc := xlen*n1;
+ yloc := ylen*(-greenpart n1,redpart n1,0);
+ H := h*(Fx,Fy,Fz);
+ Vel := v*(Fx,Fy,Fz);
+ vx := v*sind(phi)*n1;
+ vy := v*cosd(phi)*N(yloc);
+ h4 := h*sind(phi)*n1;
+ h5 := h*cosd(phi)*N(yloc);
+ h2 := (-h*sind(beta)*cosd(alpha)*cosd(psi),
+ 0,
+ h*cosd(beta)*cosd(alpha)*cosd(psi));
+ h3 := (0,h*cosd(alpha)*sind(psi),0);
+ h1 := h2 + h3;
+ draw rp(n0)--rp(n2)--rp(n3)--rp(c0);
+ draw rp(c0)--rp(n4)--rp(n1);
+ draw rp(n5)--rp(n4);
+ draw rp(c0)--rp(h2)--rp(h1)--rp(h3)--cycle;
+ draw rp(c0)--rp(h1)--rp(H);
+% draw rp(h4)--rp(H)--rp(h5);
+ label.llft(btex $\vec{n}_0$ etex,rp(n0));
+ label.urt(btex $\vec{n}$ etex,rp(n1));
+ label.llft(btex $\vec{H}$ etex,rp(H));
+% label.urt(btex $\vec{v}$ etex,rp(Vel));
+% label.bot(btex $\mathbb{x}$ etex,rp(xloc));
+% label.bot(btex $\mathbb{y}$ etex,rp(yloc));
+% label.lrt(btex $\vec{v}_\mathbb{x}$ etex,rp(vx));
+% label.urt(btex $\vec{v}_\mathbb{y}$ etex,rp(vy));
+% label.lft(btex $\vec{H}_\mathbb{x}$ etex,rp(h4));
+% label.urt(btex $\vec{H}_\mathbb{y}$ etex,rp(h5));
+% pickup pencircle scaled 1pt;
+ angline(n0,n5,c0,phirad,btex $\phi$ etex,lft);
+% angline((0,1,0),yloc,c0,phirad,btex $\phi$ etex,rt);
+ angline(h2,h1,c0,0.5,btex $\psi$ etex,urt);
+ angline(H,h1,c0,0.9,btex $\alpha$ etex,top);
+ angline(n5,n1,c0,0.6,btex $\theta$ etex,ulft);
+ angline((0,0,1),h2,c0,0.5,btex $\beta$ etex,top);
+ angline((1,0,0),n0,c0,0.6,btex $\beta$ etex,rt);
+% drawarrow rp(c0)..rp(xloc);
+% drawarrow rp(c0)..rp(yloc);
+ pickup pencircle scaled 1.3pt;
+ drawarrow rp(c0)..rp(n0);
+ drawarrow rp(c0)..rp(n1);
+ drawarrow rp(c0)..rp(H);
+% drawarrow rp(c0)..rp(Vel);
+% drawarrow rp(c0)..rp(vx);
+% drawarrow rp(c0)..rp(vy);
+% drawarrow rp(c0)..rp(h4);
+% drawarrow rp(c0)..rp(h5);
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/globe.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/globe.mp
new file mode 100644
index 00000000000..22d0cf2bee1
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/globe.mp
@@ -0,0 +1,32 @@
+% globe.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ color gammacnt;
+ numeric newradius, radius, aux, i, numc, foc, lc;
+ path conepath, latpath;
+ pen thickp;
+
+ f := (2,3,4);
+ viewcentr := 1.5*(1,1,1);
+ Spread := 200;
+ Shifts := 300;
+ radius = 1;
+ numc = 9;
+ thickp = pencircle scaled 1mm;
+
+ pickup thickp;
+ tropicalglobe( numc, black, radius, blue );
+ for i=1 upto numc: % longitudes
+ aux := (i-1)*180/numc;
+ gammacnt := (cosd(aux),sind(aux),0);
+ draw spatialhalfcircle(black,gammacnt,radius,true);
+ endfor;
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/halfcirclesfear.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/halfcirclesfear.mp
new file mode 100644
index 00000000000..7074987e166
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/halfcirclesfear.mp
@@ -0,0 +1,43 @@
+% halfcirclesfear
+% L. Nobre G.
+% 2001
+
+%input featpost3Dplus2D;
+
+% input la3Dmacros;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ color centre, axpin, axpon, axpun;
+ numeric size, radii;
+ f := (4,1.5,3.5);
+ size = 0.5;
+ radii = 1;
+ centre = (0,0,0);
+ axpin = (0,0,1);
+ axpon = (0,1,0);
+ axpun = (1,0,0);
+ cartaxes( 1.2,1.2,0.8 );
+ pickup pencircle scaled 2;
+ draw rigorouscircle( centre, axpin, radii ) withcolor red;
+ draw goodcirclepath( centre, axpin, radii );
+ draw spatialhalfcircle( centre, axpon, size, true );
+ draw spatialhalfcircle( centre, axpon, size, false ) dashed evenly;
+ draw spatialhalfcircle( centre, axpun, size, true );
+ draw spatialhalfcircle( centre, axpun, size, false ) dashed evenly;
+ draw rigorousfearpath( centre, size );
+endfig;
+
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/hexagonaltrimesh.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/hexagonaltrimesh.mp
new file mode 100644
index 00000000000..316ca97482e
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/hexagonaltrimesh.mp
@@ -0,0 +1,25 @@
+% hexagonaltrimesh.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+def zsurface( expr xc, yc ) =
+ cosd(xc*57)*cosd(yc*57)+4*mexp(-(xc**2+yc**2)*6.4)
+enddef;
+
+f := 7*(4,1,5);
+Spread := 35;
+LightSource := 10*(4,-3,4);
+SubColor := 0.4background;
+
+beginfig(1);
+ numeric np, ssize;
+ path chair;
+ np = 40;
+ ssize = 15;
+
+ hexagonaltrimesh( true,np,ssize,zsurface);
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/hiddensurface.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/hiddensurface.mp
new file mode 100644
index 00000000000..b0d64e95612
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/hiddensurface.mp
@@ -0,0 +1,153 @@
+% hiddensurface.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+% The big nice trick to draw 3D hidden line surfaces
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+numeric toplevel;
+toplevel = 2.2;
+
+def zsurface( expr xc, yc ) =
+ begingroup
+ numeric zout;
+ zout = yc**4 -xc*yc*(1-yc**2);
+ if zout > toplevel:
+ zout := toplevel;
+ fi;
+ ( zout )
+ endgroup
+enddef;
+
+def zline( expr yc ) =
+ begingroup
+ numeric zout;
+ zout = 4*yc*yc*yc/(1-3*yc*yc); %% I don't get it...
+ if zout > 3:
+ zout := 3;
+ fi;
+ ( zout )
+ endgroup
+enddef;
+
+f := (6,1,2);
+Spread := 67;
+
+beginfig(1);
+ numeric i, j, nx, ny, lowx, higx, lowy, higy, refz;
+ numeric posx, posy, posz, facz, lowl, higl, pensize;
+ color gridx[], pos, begcont, endcont, begconf, endconf;
+ path facex, descontjump;
+ pensize = 3pt;
+ nx = 20;
+ ny = 50;
+ lowy = -2.5;
+ higy = 1;
+ lowx = 1.5;
+ higx = 3;
+ refz = -2.5;
+ facz = 5;
+ for i=0 upto nx:
+ for j=0 upto ny:
+ posx := lowx + i*( higx - lowx )/nx;
+ posy := lowy + j*( higy - lowy )/ny;
+ posz := zsurface( posx, posy );
+ posx := bracket(lowx,posx,higx);
+ posy := bracket(lowy,posy,higy);
+ posz := posz/facz;
+ gridx[j] := ( posx, posy, posz );
+ endfor;
+ pos := ( posx, -1, refz/facz );
+ facex := rp( pos )--rp( gridx0 );
+ for j=1 upto ny:
+ facex := facex--rp( gridx[j] );
+ endfor;
+ facex:=facex--rp((posx,1,refz/facz))--cycle;
+ unfill facex;
+ draw facex;
+ endfor;
+ lowl = -2.0;
+% higl = -0.7;
+ higl = -1.0;
+ for j=0 upto ny:
+ posy := lowl + j*( higl - lowl )/ny;
+ posx := zline( posy );
+ posz := zsurface( posx, posy );
+ posx := bracket(lowx,posx,higx);
+ posy := bracket(lowy,posy,higy);
+ posz := posz/facz;
+ gridx[j] := ( posx, posy, posz );
+ endfor;
+ facex := rp( gridx0 );
+ for j=1 upto ny:
+ facex := facex--rp( gridx[j] );
+ endfor;
+ draw facex withcolor red; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ lowl := -1.4;
+ higl := -0.8;
+ for j=0 upto ny:
+ posy := lowl + j*( higl - lowl )/ny;
+ posx := -2*posy;
+ posz := zsurface( posx, posy );
+ posx := bracket(lowx,posx,higx);
+ posy := bracket(lowy,posy,higy);
+ posz := posz/facz;
+ gridx[j] := ( posx, posy, posz );
+ endfor;
+ facex := rp( gridx0 );
+ for j=1 upto ny:
+ facex := facex--rp( gridx[j] );
+ endfor;
+ draw facex withcolor green;
+ lowl := -1.0;
+ higl := 0.5;
+ for j=0 upto 1:
+ posy := lowl + j*( higl - lowl );
+ posx := 2;
+ posz := zsurface( posx, posy );
+ posx := bracket(lowx,posx,higx);
+ posy := bracket(lowy,posy,higy);
+ posz := posz/facz;
+ gridx[j] := ( posx, posy, posz );
+ endfor;
+% facex := rp( gridx0 );
+% for j=1 upto ny:
+% facex := facex--rp( gridx[j] );
+% endfor;
+% draw facex withcolor blue;
+ pickup pencircle scaled pensize;
+ draw rp(gridx0) withcolor red;
+ draw rp(gridx1) withcolor red;
+ posx := 2.83;
+ posy := -1.933;
+ posz := zsurface( posx, posy );
+ posx := bracket(lowx,posx,higx);
+ posy := bracket(lowy,posy,higy);
+ posz := posz/facz;
+ draw rp((posx,posy,posz)) withcolor blue;
+ posy := 0.517;
+ posy := bracket(lowy,posy,higy);
+ draw rp((posx,posy,posz)) withcolor blue;
+ begconf = (1.15,-1,refz/facz);
+ endconf = (1.15, 1,refz/facz);
+ begcont = ( 1,-1,1.15*toplevel/facz);
+ endcont = (-1,-1,1.15*toplevel/facz);
+ pickup pencircle scaled 0.5pensize;
+ drawarrow rp(begconf)--rp(endconf);
+ drawarrow rp(begcont)--rp(endcont);
+ label.ulft( btex $\Lambda$ etex, rp(0.5*(begcont+endcont)) );
+ label.bot( btex $\Upsilon$ etex, rp(0.5*(begconf+endconf)) );
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/hiddensurfaces.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/hiddensurfaces.mp
new file mode 100644
index 00000000000..df698f038bf
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/hiddensurfaces.mp
@@ -0,0 +1,65 @@
+% hiddensurfaces.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+def zsurface( expr xc, yc ) =
+ begingroup
+ numeric zout;
+ zout = yc**4-xc*yc*(1-yc**2);
+ if zout > 1.5:
+ zout := 1.5;
+ fi;
+ ( zout )
+ endgroup
+enddef;
+
+f := (2.5,2,1.25);
+Spread := 127;
+
+beginfig(1);
+ numeric i, j, nx, ny, lowx, higx, lowy, higy, refz
+ posx, posy, posz, facz, counter;
+ color poi[][];
+ nx = 30;
+ ny = 30;
+ lowy = -2.5;
+ higy = 1;
+ lowx = 1.5;
+ higx = 3;
+ refz = 0;
+ facz = 5;
+ counter = 0;
+ for i=0 upto nx:
+ for j=0 upto ny:
+ posx := lowx + i*( higx - lowx )/nx;
+ posy := lowy + j*( higy - lowy )/ny;
+ posz := zsurface( posx, posy );
+ posx := bracket(lowx,posx,higx);
+ posy := bracket(lowy,posy,higy);
+ posz := posz/facz + refz;
+ poi[i][j] := ( posx, posy, posz );
+ endfor;
+ endfor;
+ for i=1 upto nx:
+ for j=1 upto ny:
+ counter := incr(counter);
+ npf[counter] := 3;
+ F[counter]p1 := poi[i-1][j-1];
+ F[counter]p2 := poi[i][j-1];
+ F[counter]p3 := poi[i][j];
+ counter := incr(counter);
+ npf[counter] := 3;
+ F[counter]p1 := poi[i-1][j-1];
+ F[counter]p2 := poi[i-1][j];
+ F[counter]p3 := poi[i][j];
+ endfor;
+ endfor;
+ NF := counter;
+ drawarrow rp((-1,-1,refz))--rp((1,-1,refz));
+ drawarrow rp((-1,-1,refz))--rp((-1,1,refz));
+ fill_faces( withcolor blue );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/inductionbob.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/inductionbob.mp
new file mode 100644
index 00000000000..19b47c44105
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/inductionbob.mp
@@ -0,0 +1,116 @@
+% inductionbob.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton,concmath,ccfonts}
+\begin{document}
+etex
+
+numeric altura;
+altura = 0.35;
+
+f := (4,6,1);
+Spread := 200;
+LightSource := f+blue;
+ShadowOn := false;
+
+def spirala( expr TheVal ) =
+ begingroup
+ numeric par[], cred, cgre, cblu, param[];
+ par1 = 4.5;
+ par2 = 0.3;
+ par3 = 0.2*par1;
+ param1 = par1*360*TheVal;
+ cred = -par2*sind( param1 );
+ cgre = ( TheVal - 1.0 )*par3;
+ cblu = par2*cosd( param1 );
+ ( (cred,cgre,cblu+altura) )
+ endgroup
+enddef;
+
+def spiralb( expr TheVal ) =
+ begingroup
+ numeric par[], cred, cgre, cblu, param[];
+ par1 = 4.0;
+ par2 = 0.3;
+ par3 = 0.2*par1;
+ param1 = par1*360*TheVal;
+ cred = par2*sind( param1 );
+ cgre = TheVal*par3;
+ cblu = -par2*cosd( param1 );
+ ( (cred,cgre,cblu+altura) )
+ endgroup
+enddef;
+
+def innerloop( expr TheVal ) =
+ begingroup
+ numeric par[], cred, cgre, cblu, param[];
+ par1 = 8;
+ par2 = 0.2;
+ param1 = par1+(360-2*par1)*TheVal;
+ cred = par2*cosd( param1 );
+ cgre = 0;
+ cblu = par2*sind( param1 );
+ ( (cred,cgre,cblu+altura) )
+ endgroup
+enddef;
+
+beginfig(1);
+ numeric xouterdev, xinnerdev, scalecir, scalelab;
+ color startp, begp, endp, finisp, ap, bp, cp, dp, ep, fp, gp;
+ pair startz, begz, endz, finisz, az, bz, cz, dz, ez, fz, gz;
+ path innerpath, outerpath, primarcir, secondcir;
+ pen mypen;
+ scalecir = 3cm;
+ scalelab = 4;
+ xouterdev = 1.4;
+ xinnerdev = 1.0;
+ mypen = pencircle scaled 4pt;
+ startp = spirala( 0 );
+ finisp = spiralb( 1 );
+ begp = innerloop( 0 );
+ endp = innerloop( 1 );
+ ap = ( xouterdev, Y(startp), Z(startp) );
+ bp = ( xouterdev, Y(startp), Z(finisp) );
+ dp = ( xouterdev, Y(finisp), Z(finisp) );
+ cp = 0.5[bp,dp];
+ ep = ( xinnerdev, Y(begp), Z(begp) );
+ fp = ( xinnerdev, Y(endp), Z(endp) );
+ gp = 0.5[ep,fp];
+ startz = rp( startp );
+ finisz = rp( finisp );
+ begz = rp( begp );
+ endz = rp( endp );
+ az = rp( ap );
+ bz = rp( bp );
+ cz = rp( cp );
+ dz = rp( dp );
+ ez = rp( ep );
+ fz = rp( fp );
+ gz = rp( gp );
+ emptyline( false, 1, black, 0.7background, 700, 0.8, 2, spirala );
+ outerpath = startz--az--bz--dz--finisz;
+ primarcir = fullcircle scaled scalecir shifted cz;
+ emptyline( false, 0.8, black, 0.4*(red+background), 150, 0.8, 2, innerloop );
+ innerpath = begz--ez--fz--endz;
+ secondcir = fullcircle scaled scalecir shifted gz;
+ draw innerpath withpen mypen;
+ unfill secondcir;
+ draw secondcir withpen mypen;
+ label( btex $V_S$ etex scaled scalelab, gz);
+ emptyline( true, 1, black, 0.7background, 700, 0.8, 2, spiralb );
+ draw outerpath withpen mypen;
+ unfill primarcir;
+ draw primarcir withpen mypen;
+ label( btex $V_P$ etex scaled scalelab, cz );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/joinedemptylines.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/joinedemptylines.mp
new file mode 100644
index 00000000000..a4a629d8afb
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/joinedemptylines.mp
@@ -0,0 +1,47 @@
+% joinedemptylines.mp
+% L. Nobre G.
+% 2001
+
+%input featpost3Dplus2D;
+
+numeric altura;
+altura = 1;
+
+f := (2,3,1.8+altura);
+Spread := 125;
+LightSource := 0.7*(4,-1,4);
+ShadowOn := true;
+
+def helixone( expr TheVal ) =
+ begingroup
+ numeric par[], cred, cblu, param;
+ par1 = 3*360;
+ par2 = 0.3;
+ par3 = 0.8;
+ param = par1*TheVal;
+ cred = par2*cosd( param );
+ cblu = par2*sind( param );
+ ( (cred,cblu,par3*(-1+TheVal)+altura) )
+ endgroup
+enddef;
+
+def helixtwo( expr TheVal ) =
+ begingroup
+ numeric par[], cred, cblu, param;
+ par1 = 3*360;
+ par2 = 0.1;
+ par3 = 0.8/3;
+ param = par1*TheVal;
+ cred = par2*cosd( param );
+ cblu = par2*sind( param );
+ ( (cred+0.2,cblu,par3*TheVal+altura) )
+ endgroup
+enddef;
+
+beginfig(1);
+ emptyline( false, 0.91, black, 0.5background, 360, 0.88, 2, helixone );
+ emptyline( true, 0.91, black, 0.5background, 120, 0.88, 2, helixtwo );
+ drawarrow rp((0.5,0,altura))--rp((0.32,0,altura));
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/kindofcube.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/kindofcube.mp
new file mode 100644
index 00000000000..c2e6a99f5a9
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/kindofcube.mp
@@ -0,0 +1,81 @@
+% kindofcube.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton,concmath,ccfonts}
+\begin{document}
+etex
+
+Spread := 30;
+f := 5.4*(1.5,0.5,1);
+
+beginfig(1);
+ numeric gridstep, sidenumber, i, j, coord, aa, ab, ac;
+ color pa;
+ gridstep = 0.9;
+ sidenumber = 10;
+ coord = 0.5*sidenumber*gridstep;
+ for i=0 upto sidenumber:
+ for j=0 upto sidenumber:
+ pa := (-coord+j*gridstep,-coord+i*gridstep,0);
+ aa := uniformdeviate(360);
+ ab := uniformdeviate(180);
+ ac := uniformdeviate(90);
+ kindofcube( false, false, pa, aa, ab, ac, 0.4, 0.4, 0.9 );
+ endfor;
+ endfor;
+endfig;
+
+beginfig(2);
+ f := (4,1.0,0.5);
+ Spread := 120;
+ numeric lena, lenb, lenc, aa, ab, ac, angray, micr;
+ pair zeror;
+ color axa, axb, axc, returnedcorner, dummyc, auxx, auxy;
+ lena=0.3;
+ lenb=0.6;
+ lenc=0.9;
+ aa=130;
+ ab=20;
+ ac=70;
+ angray=0.7;
+ micr=0.01;
+ zeror=rp(black);
+ cartaxes(1,1,1);
+ axa = ( cosd(aa), sind(aa), 0 );
+ axb = axa*cosd(ab)+blue*sind(ab);
+ auxx= ( cosd(aa+90), sind(aa+90), 0);
+ auxy = ncrossprod( axb, auxx );
+ axc = auxx*cosd(ac)+auxy*sind(ac);
+ draw zeror--rp(axa);
+ draw zeror--rp(axb);
+ draw zeror--rp(-axa);
+ draw zeror--rp(axc);
+ draw zeror--rp(auxx);
+ label.rt( btex $a$ etex, rp(axa) );
+ label.rt( btex $b$ etex, rp(axb) );
+ label.lft( btex $c$ etex, rp(auxx) );
+ label.lft( btex $d$ etex, rp(axc) );
+ label.bot( btex $o$ etex, zeror );
+ angline( axa,red,black,angray,btex $\alpha_1$ etex,bot );
+ angline( axb,axa,black,angray,btex $\alpha_2$ etex,rt );
+ angline( axc,auxx,black,angray,btex $\alpha_3$ etex,lft );
+ squareangline( -axa,auxx,black,0.2);
+ kindofcube( true, true, black, aa, ab, ac, lena, lenb, lenc );
+ draw zeror--rp(blue) dashed evenly;
+ dotlabel.bot( btex $l_1$ etex, rp(lena*axb) );
+ dotlabel.rt( btex $l_2$ etex, rp(lenb*axc) );
+ dotlabel.top( btex $l_3$ etex, rp(lenc*ncrossprod(axb,axc) ) );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end.
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/labelconstruct.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/labelconstruct.mp
new file mode 100644
index 00000000000..45213320942
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/labelconstruct.mp
@@ -0,0 +1,30 @@
+% labelconstruct.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+% bash: export TEX=latex
+% tcsh: setenv TEX latex
+
+f := 1.1*(2,1,0.5);
+ParallelProj := true;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton,concmath,ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ kindofcube(false,true,(0,-0.5,0),90,0,0,1.2,0.1,0.4);
+ kindofcube(false,true,(0,0,0),0,0,0,0.5,0.1,0.8);
+ labelinspace(false,(0.45,0.1,0.65),(-0.4,0,0),(0,0,0.1),
+ btex \framebox{\textsc{Label}} etex);
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/labelinspace.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/labelinspace.mp
new file mode 100644
index 00000000000..da51f50633f
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/labelinspace.mp
@@ -0,0 +1,33 @@
+% labelinspace.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+% bash: export TEX=latex
+% tcsh: setenv TEX latex
+
+f := (2,3,0.5);
+ParallelProj := true;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton,concmath,ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ cartaxes( 1, 1.3, 1 );
+ labelinspace( false, black, 0.8*blue, 0.7*red,
+ btex \framebox{$\frac{\sqrt{5}-1}{2}$} etex);
+ labelinspace( false, 0.8*blue, -0.8*blue, 0.6*green,
+ btex \framebox{$\phi$} etex);
+ labelinspace( true, 0.7*red, 0.6*green, -0.7*red,
+ btex \framebox{$\frac{1+\sqrt{5}}{2}$} etex);
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/magneticflux.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/magneticflux.mp
new file mode 100644
index 00000000000..c5f62220794
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/magneticflux.mp
@@ -0,0 +1,105 @@
+% magneticflux.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{palatino,mathpazo}
+\begin{document}
+etex
+
+TDAtiplen := 0.1; % tdarrow
+TDAhalftipbase := 0.04; % Three-Dimensional
+TDAhalfthick := 0.02; % Arrow
+ForePen := pencircle scaled 10pt;
+BackPen := pencircle scaled 6pt;
+
+numeric ranga;
+ranga = 30+uniformdeviate(120);
+
+def ellip( expr TheVal ) =
+ ( (cosd(360*TheVal),sind(360*TheVal)/sind(ranga),0) )
+enddef;
+
+beginfig(2);
+ f := ( 4, 1, 2 );
+ Spread := 90;
+ pen blackpen, whitepen;
+ numeric majoraxe, i, j, gridstepn, gridstep, gridstart, halen, rang;
+ numeric ellfocus, totdist, marginl;
+ path espira, partes, covere;
+ color avec, midvec;
+ halen = 1;
+ marginl = 0.14;
+ rang = 45+30*floor(uniformdeviate(3.9));
+ show rang;
+ avec = (0,cosd(rang),sind(rang))*halen;
+ blackpen = pencircle scaled 5pt;
+ whitepen = pencircle scaled 3pt;
+ majoraxe = 1.2 + uniformdeviate(0.8);
+ ellfocus = majoraxe +-+ 1;
+ gridstepn= 15;
+ gridstep = 2*majoraxe/(gridstepn-1);
+ gridstart= 0.5*gridstepn*gridstep;
+ espira = ellipticpath( black, -red, -green*majoraxe );
+ draw espira withpen blackpen;
+ undraw espira withpen whitepen;
+ for j=-1 step gridstep until 1:
+ for i=-gridstart step gridstep until gridstart:
+ midvec := (j,i,0);
+ totdist := conorm(midvec-(0,-ellfocus,0))+conorm(midvec-(0,ellfocus,0));
+ if 2*majoraxe-marginl > totdist:
+ tdarrow( midvec, midvec+avec );
+% draw rp(midvec) withpen whitepen;
+ fi;
+ endfor;
+ endfor;
+ partes = subpath (10.3,25.6) of espira;
+ covere = subpath (10,26) of espira;
+ draw partes withpen blackpen;
+ undraw covere withpen whitepen;
+endfig;
+
+beginfig(1);
+ f := ( 4, 1.9, 1.22 );
+ Spread := 90;
+ numeric nodc, lsc;
+ nodc = 10;
+ lsc = 2.4;
+ closedline( true, 200, 0.5, 1.75 )( ellip );
+ numeric i, j, circlesize, polar, phi;
+ color currpos, ini, fin, avec;
+ string comm;
+ avec = (0,cosd(ranga),sind(ranga));
+ circlesize = 1.86/nodc;
+ for i=0.93 step -circlesize until 0.4*circlesize:
+ polar := floor(6.28318*i/circlesize);
+ for j=1 upto polar:
+ phi := 360*j/polar;
+ currpos := i*(cosd(phi),sind(phi)/sind(ranga),0);
+ comm:="tdarrow("
+ & cstr( currpos )
+ & ","
+ & cstr( currpos + avec )
+ & ");";
+ getready( comm, currpos );
+ endfor;
+ endfor;
+ doitnow;
+ pickup pencircle scaled 2pt;
+ drawarrow rp((0,1.07/sind(ranga),0))--rp((0,2.47,0));
+ drawarrow rp((1.07,0,0))--rp((1.67,0,0));
+ angline((0,2.37,0),(0,0.93/sind(ranga),0)+avec,(0,0.93/sind(ranga),0),
+ 0.3, btex $\alpha$ etex scaled lsc, urt);
+ label.bot( btex $x$ etex scaled lsc, rp((1.67,0,0)) );
+ label.bot( btex $y$ etex scaled lsc, rp((0,2.47,0)) );
+endfig;
+
+
+verbatimtex
+\end{document}
+etex
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/nembiaxi.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/nembiaxi.mp
new file mode 100644
index 00000000000..99bfbc7b87b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/nembiaxi.mp
@@ -0,0 +1,64 @@
+% nembiaxi.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+
+
+beginfig(1);
+ f := 1.3*(4,5,3);
+ Spread := 70;
+
+ numeric hstep, hmax, hsdev, basestep, basemax, basesdev;
+ numeric i, j, k, angsdev, cylength, cyradius, basen, hn;
+ numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, hbase, aone;
+ numeric atwo, zcurr, counter;
+ color lenvec, currpos, xnoise, tmpcol;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Nb
+ cylength := 0.45;
+ cyradius := 0.1;
+ basen := 5;
+ hn := 3;
+ basestep := cylength*1.65;
+ hstep := cylength;
+ basesdev := basestep*0.1;
+ hsdev := hstep*0.1;
+ hbase := -0.8;
+ angsdev := 12;
+
+ basemax := basen*basestep;
+ hmax := hn*hstep;
+ counter := 0;
+ for i=1 upto basen:
+ for j=1 upto basen:
+ hcurr := hbase;
+ forever:
+ exitunless hcurr < hmax+hbase;
+ hcurr := hcurr + hstep;
+ zcurr := hcurr + hsdev*normaldeviate;
+ xcurr := i*basestep + basesdev*normaldeviate;
+ ycurr := j*basestep + basesdev*normaldeviate;
+ aone := uniformdeviate( 10 )-5;
+ atwo := angsdev*normaldeviate;
+ vcz := cosd( atwo );
+ vcy := sind( atwo )*sind( aone );
+ vcx := sind( atwo )*cosd( aone );
+ currpos := ( xcurr, ycurr, zcurr );
+ xnoise := ( sind( angsdev*normaldeviate ), 0, 0 );
+ xnoise := green + xnoise;
+ tmpcol := ncrossprod( ( vcx, vcy, vcz ), xnoise );
+ lenvec := cylength*tmpcol;
+% rigorousdisc( 0, true, currpos-0.5*lenvec, cyradius, lenvec);
+ counter := incr( counter );
+ generateonebiax( counter, aone, atwo, cylength,
+ 90, 0.35*cylength, currpos );
+ endfor;
+ endfor;
+ endfor;
+ NL := counter;
+ director_invisible( false, 7, true );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/nemsaddl.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/nemsaddl.mp
new file mode 100644
index 00000000000..ccc7d9852a1
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/nemsaddl.mp
@@ -0,0 +1,86 @@
+% nemsaddl.mp and nemsplay.mp and nemtwist.mp and nembends.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+
+
+beginfig(1);
+ f := 2*(5,3,4);
+ Spread := 70;
+
+ numeric hstep, hmax, hsdev, basestep, basemax, basesdev;
+ numeric i, j, k, angsdev, cylength, cyradius, basen, hn;
+ numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, hbase, aone;
+ numeric atwo, zcurr, angstep;
+ color lenvec, currpos;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% splay, sddle and twist
+ angstep := 10;
+ cylength := 0.6;
+ cyradius := 0.1;
+ basen := 3;
+ hn := 1;
+ basestep := cyradius*4.2;
+ hstep := cylength*1.4;
+ basesdev := cyradius*0.003;
+ hsdev := hstep*0.005;
+ hbase := -0.8;
+ angsdev := 3;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bend
+% angstep := 15;
+% cylength := 0.6;
+% cyradius := 0.1;
+% basen := 3;
+% hn := 1;
+% basestep := cylength*1.6;
+% hstep := cyradius*3.4;
+% basesdev := basestep*0.01;
+% hsdev := hstep*0.005;
+% hbase := -0.8;
+% angsdev := 3;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ basemax := basen*basestep;
+ hmax := hn*hstep;
+ for i=-basen upto basen:
+ for j=-basen upto basen:
+ hcurr := hbase;
+ forever:
+ exitunless hcurr < hmax+hbase;
+ hcurr := hcurr + hstep;
+ zcurr := hcurr + hsdev*normaldeviate;
+ xcurr := i*basestep + basesdev*normaldeviate;
+ ycurr := j*basestep + basesdev*normaldeviate;
+ aone := angle((xcurr,ycurr))+angsdev*normaldeviate;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% atwo := ( i ++ j )*angstep + angsdev*normaldeviate;
+% vcz := cosd( atwo );
+% vcy := sind( atwo )*sind( aone ); % pure-splay
+% vcx := sind( atwo )*cosd( aone ); % pure-splay
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% atwo := ( i ++ j )*angstep + angsdev*normaldeviate;
+% vcz := cosd( atwo );
+% vcy := sind( atwo )*sind( aone ); % saddle-splay
+% vcx := -sind( atwo )*cosd( aone ); % saddle-splay
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ atwo := ( i ++ j )*angstep + angsdev*normaldeviate;
+ vcz := cosd( atwo );
+ vcy := sind( atwo )*sind( aone+90 );% pure-twist
+ vcx := sind( atwo )*cosd( aone+90 );% pure-twist
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% atwo := j *angstep + angsdev*normaldeviate;
+% vcz := sind( atwo );
+% vcy := cosd( atwo ); % pure-bend
+% vcx := 0; % pure-bend
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ currpos := ( xcurr, ycurr, zcurr );
+ lenvec := cylength*( vcx, vcy, vcz );
+ rigorousdisc( 0, true, currpos-0.5*lenvec, cyradius, lenvec);
+ endfor;
+ endfor;
+ endfor;
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/nsmetica.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/nsmetica.mp
new file mode 100644
index 00000000000..d13a33e1cc3
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/nsmetica.mp
@@ -0,0 +1,60 @@
+% nsmetica.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+
+
+beginfig(1);
+ f := 2*(5,3,2);
+ Spread := 70;
+ NF := 0;
+
+ numeric hstep, hmax, hsdev, basestep, basemax, basesdev;
+ numeric i, j, k, angsdev, cylength, cyradius, basen, hn;
+ numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, hbase, aone;
+ numeric atwo, zcurr, counter;
+ color lenvec, currpos;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Sma
+ cylength := 0.45;
+ cyradius := 0.1;
+ basen := 11;
+ hn := 3;
+ basestep := cyradius*2.4;
+ hstep := cylength*2.1;
+ basesdev := cyradius*0.3;
+ hsdev := hstep*0.04;
+ hbase := -0.8;
+ angsdev := 7;
+
+ basemax := basen*basestep;
+ hmax := hn*hstep;
+ hcurr := hbase;
+ counter := 0;
+ for k=1 upto hn:
+ hcurr := hcurr + hstep;
+ for i=1 upto basen:
+ for j=1 upto basen:
+ zcurr := hcurr + hsdev*normaldeviate;
+ xcurr := (i-1)*basestep + uniformdeviate( basestep );
+ ycurr := (j-1)*basestep + uniformdeviate( basestep );
+ aone := uniformdeviate( 360 );
+ atwo := angsdev*normaldeviate;
+ vcz := cosd( atwo );
+ vcy := sind( atwo )*sind( aone );
+ vcx := sind( atwo )*cosd( aone );
+ currpos := ( xcurr, ycurr, zcurr );
+ lenvec := cylength*( vcx, vcy, vcz );
+ counter := incr( counter );
+ generatedirline( counter, aone, 90-atwo, cylength, currpos );
+% rigorousdisc( 0, true, currpos-0.5*lenvec, cyradius, lenvec);
+ endfor;
+ endfor;
+ endfor;
+ NL := counter;
+ director_invisible( true, 5, false );
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/parafuso.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/parafuso.mp
new file mode 100644
index 00000000000..74e8cda3e77
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/parafuso.mp
@@ -0,0 +1,100 @@
+% parafuso.mp
+% L. Nobre G.
+% 2005
+
+%input featpost3Dplus2D;
+
+def theline( expr TheVal ) =
+ begingroup
+ numeric par[], cred, cgre, cblu, param;
+ par0 = 0;
+ par1 = 6*360;
+ par2 = 0.3;
+ par3 = 850;
+ param = par0+TheVal*(par1-par0);
+ cred = -par2*cosd( param );
+ cblu = par2*sind( param );
+ cgre = param/par3;
+ ( (cred,cgre,cblu) )
+ endgroup
+enddef;
+
+def loxodrome( expr TheVal ) =
+ begingroup
+ numeric cred, cgre, cblu, alpha, theta, ratio, radio;
+ ratio = 22;
+ radio = 2;
+ theta = ratio*180*TheVal;
+ alpha = 170*TheVal-85;
+ cred = radio*cosd(theta)*cosd(alpha);
+ cgre = radio*sind(theta)*cosd(alpha);
+ cblu = radio*sind(alpha);
+ ( (cred,cgre,cblu) )
+ endgroup
+enddef;
+
+f := (2,4,1.8);
+Spread := 77;
+ShadowOn := false;
+
+beginfig(1);
+ numeric axsize, zaxpos, zaxlen;
+ color xbeg, xend, ybeg, yend, zbeg, zend;
+ axsize = 0.85;
+ zaxpos = 0.55;
+ zaxlen = 2.1;
+ pickup pencircle scaled 1.5pt;
+ xbeg = (axsize,0,0);
+ xend = (-axsize,0,0);
+ ybeg = (0,0,-axsize);
+ yend = (0,0,axsize);
+ zbeg = (zaxpos,-zaxpos,0);
+ zend = (zaxpos,zaxlen,0);
+ drawarrow rp( xbeg )--rp( xend );
+ drawarrow rp( ybeg )--rp( yend );
+% defaultfont := "putr8r";
+ defaultscale := 1.95;
+ label.rt( "A", rp( xend ) );
+ label.lft( "B", rp( yend ) );
+ emptyline( false, 1, black, 0.5background, 1000, 0.82, 2, theline );
+ drawarrow rp( zbeg )--rp( zend );
+ label.bot( "C", rp( zend ) );
+endfig;
+
+beginfig(2);
+ numeric axsize, zaxpos, zaxlen;
+ color xbeg, xend, ybeg, yend, zbeg, zend;
+ axsize = 0.85;
+ zaxpos = 0.55;
+ zaxlen = 2.1;
+ pickup pencircle scaled 1.5pt;
+ xbeg = (axsize,0,0);
+ xend = (-axsize,0,0);
+ ybeg = (0,0,-axsize);
+ yend = (0,0,axsize);
+ zbeg = (zaxpos,-zaxpos,0);
+ zend = (zaxpos,zaxlen,0);
+ drawarrow rp( xbeg )--rp( xend );
+ drawarrow rp( ybeg )--rp( yend );
+% defaultfont := "putr8r";
+ defaultscale := 0.65;
+ label.rt( "X", rp( xend ) );
+ label.lft( "Y", rp( yend ) );
+ closedline( false, 70, 0.5, 0.95, theline );
+ drawarrow rp( zbeg )--rp( zend );
+ label.bot( "Z", rp( zend ) );
+ doitnow;
+endfig;
+
+f := (2,4,2.8);
+beginfig(3);
+ NCL := 0;
+ Nobjects := 0;
+ closedline( false, 270, 0.5, 0.85, loxodrome );
+ doitnow;
+endfig;
+
+end;
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/pathofstraightline.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/pathofstraightline.mp
new file mode 100644
index 00000000000..06711c223f3
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/pathofstraightline.mp
@@ -0,0 +1,29 @@
+% pathofstraightline.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+SphericalDistortion := true;
+Spread := 100;
+f := 0.4*(1.5,0.5,1);
+
+beginfig(1);
+ numeric gridstep, sidenumber, i, coord;
+ color pa, pb, pc, pd;
+ gridstep = 0.1;
+ sidenumber = 10;
+ coord = 0.5*sidenumber*gridstep;
+ for i=0 upto sidenumber:
+ pa := (-coord,-coord+i*gridstep,0);
+ pb := (coord,-coord+i*gridstep,0);
+ pc := (-coord+i*gridstep,-coord,0);
+ pd := (-coord+i*gridstep,coord,0);
+ draw pathofstraightline( pa, pb );
+ draw pathofstraightline( pc, pd );
+ endfor;
+endfig;
+
+end.
+
+ \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/photoreverse.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/photoreverse.mp
new file mode 100644
index 00000000000..542fd1f3508
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/photoreverse.mp
@@ -0,0 +1,242 @@
+% photoreverse.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+% bash: export TEX=latex
+% tcsh: setenv TEX latex
+
+% Converted from PostScript(TM) to MetaPost by pstoedit
+% MetaPost backend contributed by Scott Pakin <pakin@uiuc.edu>
+% pstoedit is Copyright (C) 1993 - 2003 Wolfgang Glunz <wglunz@pstoedit.net>
+
+% MetaPost source tuned by PstoeditMpostPreeditor (lex scanner)
+% and edited by L. Nobre G. <nobre@lince.cii.fc.ul.pt>
+
+% Generate structured PostScript
+prologues := 1;
+
+% Display a given string with its *baseline* at a given location
+% and with a given rotation angle
+vardef showtext(expr origin)(expr angle)(expr string) =
+ draw string infont defaultfont scaled defaultscale
+ rotated angle shifted origin;
+enddef;
+
+beginfig(1);
+ path PreeditedPath[];
+ linecap := butt;
+ linejoin := mitered;
+ PreeditedPath1 = hide(z1=(267.637,309.195))z1..controls hide(z2=(265.005,308.373))z2 and hide(z3=(262.069,307.351))z3..hide(z4=(261.056,306.906))z4
+ ..controls hide(z5=(260.051,306.463))z5 and hide(z6=(257.254,305.728))z6..hide(z7=(254.841,305.272))z7
+ ..controls hide(z8=(250.692,304.488))z8 and hide(z9=(204.457,292.788))z9..hide(z10=(182.447,286.951))z10
+ ..controls hide(z11=(176.816,285.458))z11 and hide(z12=(168.096,283.167))z12..hide(z13=(163.069,281.859))z13
+ ..controls hide(z14=(151.222,278.777))z14 and hide(z15=(141.515,276.205))z15..hide(z16=(134.184,274.205))z16
+ ..controls hide(z17=(130.967,273.328))z17 and hide(z18=(125.044,271.795))z18..hide(z19=(121.022,270.8))z19
+ ..controls hide(z20=(112.027,268.574))z20 and hide(z21=(85.2788,261.351))z21..hide(z22=(82.2654,260.334))z22
+ ..controls hide(z23=(81.0576,259.926))z23 and hide(z24=(74.8799,258.292))z24..hide(z25=(68.5181,256.697))z25
+ ..controls hide(z26=(53.8198,253.011))z26 and hide(z27=(54.844,253.994))z27..hide(z28=(56.676,245.334))z28
+ ..controls hide(z29=(57.3293,242.246))z29 and hide(z30=(56.3792,241.622))z30..hide(z31=(47.3118,239.178))z31
+ ..controls hide(z32=(35.9773,236.124))z32 and hide(z33=(35.1968,235.536))z33..hide(z34=(38.4636,232.521))z34
+ ..controls hide(z35=(40.325,230.802))z35 and hide(z36=(46.4053,219.375))z36..hide(z37=(48.1816,214.256))z37
+ ..controls hide(z38=(50.9392,206.31))z38 and hide(z39=(75.4822,148.371))z39..hide(z40=(81.2634,136.159))z40
+ ..controls hide(z41=(83.6174,131.186))z41 and hide(z42=(85.5562,126.827))z42..hide(z43=(85.5562,126.506))z43
+ ..controls hide(z44=(85.5562,124.811))z44 and hide(z45=(87.6768,124.222))z45..hide(z46=(90.6018,125.105))z46
+ ..controls hide(z47=(94.1848,126.187))z47 and hide(z48=(94.4399,127.076))z48..hide(z49=(91.2598,127.398))z49
+ ..controls hide(z50=(86.803,127.85))z50 and hide(z51=(81.7302,144.202))z51..hide(z52=(66.9248,205.847))z52
+ ..controls hide(z53=(57.2651,246.065))z53 and hide(z54=(57.3979,243.248))z54..hide(z55=(65.0811,244.906))z55
+ ..controls hide(z56=(67.3086,245.386))z56 and hide(z57=(71.2236,246.393))z57..hide(z58=(73.8562,247.162))z58
+ ..controls hide(z59=(76.4578,247.923))z59 and hide(z60=(81.7537,249.412))z60..hide(z61=(85.5562,250.453))z61
+ ..controls hide(z62=(89.3586,251.494))z62 and hide(z63=(93.6614,252.702))z63..hide(z64=(95.0623,253.122))z64
+ ..controls hide(z65=(96.4841,253.549))z65 and hide(z66=(99.0842,254.15))z66..hide(z67=(100.912,254.475))z67
+ ..controls hide(z68=(102.711,254.795))z68 and hide(z69=(106.689,255.777))z69..hide(z70=(109.687,256.642))z70
+ ..controls hide(z71=(115.705,258.378))z71 and hide(z72=(115.391,258.29))z72..hide(z73=(129.431,262.147))z73
+ ..controls hide(z74=(134.842,263.633))z74 and hide(z75=(139.964,265.139))z75..hide(z76=(140.765,265.48))z76
+ ..controls hide(z77=(141.57,265.822))z77 and hide(z78=(145.519,266.957))z78..hide(z79=(149.541,268.003))z79
+ ..controls hide(z80=(153.562,269.049))z80 and hide(z81=(158.005,270.236))z81..hide(z82=(159.412,270.641))z82
+ ..controls hide(z83=(164.668,272.153))z83 and hide(z84=(171.332,273.79))z84..hide(z85=(180.984,275.938))z85
+ ..controls hide(z86=(185.445,276.931))z86 and hide(z87=(190.982,278.282))z87..hide(z88=(193.416,278.972))z88
+ ..controls hide(z89=(195.835,279.657))z89 and hide(z90=(203.214,281.625))z90..hide(z91=(209.869,283.359))z91
+ ..controls hide(z92=(216.523,285.094))z92 and hide(z93=(224.23,287.209))z93..hide(z94=(227.053,288.076))z94
+ ..controls hide(z95=(229.905,288.952))z95 and hide(z96=(233.467,289.972))z96..hide(z97=(235.097,290.379))z97
+ ..controls hide(z98=(236.722,290.785))z98 and hide(z99=(239.484,291.549))z99..hide(z100=(241.312,292.098))z100
+ ..controls hide(z101=(243.136,292.645))z101 and hide(z102=(247.309,293.664))z102..hide(z103=(250.672,294.384))z103
+ ..controls hide(z104=(255.718,295.463))z104 and hide(z105=(258.712,296.887))z105..hide(z106=(255.937,296.887))z106
+ ..controls hide(z107=(255.547,296.887))z107 and hide(z108=(255.206,297.399))z108..hide(z109=(255.206,297.984))z109
+ ..controls hide(z110=(255.206,298.587))z110 and hide(z111=(255.864,299.081))z111..hide(z112=(256.669,299.081))z112
+ ..controls hide(z113=(257.546,299.081))z113 and hide(z114=(258.131,298.613))z114..hide(z115=(258.131,297.911))z115
+ ..controls hide(z116=(258.131,296.975))z116 and hide(z117=(258.643,296.837))z117..hide(z118=(260.69,297.219))z118
+ ..controls hide(z119=(265.886,298.191))z119 and hide(z120=(265.944,297.765))z120..hide(z121=(265.075,264.932))z121
+ ..controls hide(z122=(264.736,252.135))z122 and hide(z123=(264.811,245.7))z123..hide(z124=(265.297,245.7))z124
+ ..controls hide(z125=(266.883,245.7))z125 and hide(z126=(267.399,252.793))z126..hide(z127=(267.917,281.75))z127
+ ..controls hide(z128=(268.149,294.694))z128 and hide(z129=(268.149,294.694))z129..hide(z130=(265.364,299.227))z130
+ ..controls hide(z131=(262.174,304.419))z131 and hide(z132=(261.87,306.04))z132..hide(z133=(263.981,306.6))z133
+ ..controls hide(z134=(268.294,307.744))z134 and hide(z135=(275.854,303.103))z135..hide(z136=(280.281,296.595))z136
+ ..controls hide(z137=(283.962,291.184))z137 and hide(z138=(284.721,290.268))z138..hide(z139=(289.063,286.003))z139
+ ..controls hide(z140=(291.403,283.705))z140 and hide(z141=(292.5,282.033))z141..hide(z142=(292.5,280.763))z142
+ ..controls hide(z143=(292.5,279.62))z143 and hide(z144=(293.377,278.063))z144..hide(z145=(294.767,276.741))z145
+ ..controls hide(z146=(296.017,275.551))z146 and hide(z147=(298.525,272.208))z147..hide(z148=(300.361,269.283))z148
+ ..controls hide(z149=(302.197,266.358))z149 and hide(z150=(303.934,263.981))z150..hide(z151=(304.236,263.981))z151
+ ..controls hide(z152=(304.545,263.981))z152 and hide(z153=(305.201,262.957))z153..hide(z154=(305.736,261.641))z154
+ ..controls hide(z155=(306.263,260.343))z155 and hide(z156=(308.249,257.363))z156..hide(z157=(310.196,254.95))z157
+ ..controls hide(z158=(312.143,252.537))z158 and hide(z159=(313.706,250.225))z159..hide(z160=(313.706,249.758))z160
+ ..controls hide(z161=(313.706,249.294))z161 and hide(z162=(314.657,248))z162..hide(z163=(315.827,246.87))z163
+ ..controls hide(z164=(316.997,245.74))z164 and hide(z165=(318.128,243.888))z165..hide(z166=(318.35,242.738))z166
+ ..controls hide(z167=(318.613,241.372))z167 and hide(z168=(319.52,240.264))z168..hide(z169=(320.982,239.521))z169
+ ..controls hide(z170=(322.225,238.889))z170 and hide(z171=(323.698,237.449))z171..hide(z172=(324.309,236.267))z172
+ ..controls hide(z173=(324.914,235.097))z173 and hide(z174=(325.652,234.031))z174..hide(z175=(325.955,233.89))z175
+ ..controls hide(z176=(326.254,233.75))z176 and hide(z177=(327.334,231.989))z177..hide(z178=(328.331,230.015))z178
+ ..controls hide(z179=(329.365,227.967))z179 and hide(z180=(331.096,225.887))z180..hide(z181=(332.316,225.225))z181
+ ..controls hide(z182=(333.504,224.581))z182 and hide(z183=(335.098,222.921))z183..hide(z184=(335.863,221.532))z184
+ ..controls hide(z185=(336.635,220.13))z185 and hide(z186=(338.471,217.547))z186..hide(z187=(339.995,215.719))z187
+ ..controls hide(z188=(341.518,213.89))z188 and hide(z189=(343.403,211.128))z189..hide(z190=(344.236,209.503))z190
+ ..controls hide(z191=(345.069,207.878))z191 and hide(z192=(347.734,204.531))z192..hide(z193=(350.232,201.971))z193
+ ..controls hide(z194=(352.945,199.192))z194 and hide(z195=(354.903,196.494))z195..hide(z196=(355.168,195.17))z196
+ ..controls hide(z197=(355.411,193.957))z197 and hide(z198=(356.943,191.441))z198..hide(z199=(358.596,189.54))z199
+ ..controls hide(z200=(361.841,185.811))z200 and hide(z201=(364.128,182.683))z201..hide(z202=(365.551,180.034))z202
+ ..controls hide(z203=(366.846,177.621))z203 and hide(z204=(365.23,174.037))z204..hide(z205=(362.846,174.037))z205
+ ..controls hide(z206=(361.091,174.037))z206 and hide(z207=(358.527,172.096))z207..hide(z208=(359.273,171.332))z208
+ ..controls hide(z209=(359.507,171.093))z209 and hide(z210=(360.799,171.399))z210..hide(z211=(362.115,172.005))z211
+ ..controls hide(z212=(368.257,174.837))z212 and hide(z213=(375.377,173.789))z213..hide(z214=(371.109,170.681))z214
+ ..controls hide(z215=(370.133,169.97))z215 and hide(z216=(369.915,169.138))z216..hide(z217=(370.268,167.456))z217
+ ..controls hide(z218=(370.58,165.969))z218 and hide(z219=(370.316,164.385))z219..hide(z220=(369.501,162.849))z220
+ ..controls hide(z221=(368.801,161.533))z221 and hide(z222=(368.321,159.646))z222..hide(z223=(368.404,158.535))z223
+ ..controls hide(z224=(368.485,157.438))z224 and hide(z225=(368.095,156.301))z225..hide(z226=(367.526,155.976))z226
+ ..controls hide(z227=(366.853,155.591))z227 and hide(z228=(366.377,153.635))z228..hide(z229=(366.137,150.272))z229
+ ..controls hide(z230=(365.933,147.42))z230 and hide(z231=(365.431,143.858))z231..hide(z232=(365.003,142.228))z232
+ ..controls hide(z233=(364.584,140.633))z233 and hide(z234=(363.853,137.475))z234..hide(z235=(363.395,135.281))z235
+ ..controls hide(z236=(362.936,133.087))z236 and hide(z237=(362.088,130.162))z237..hide(z238=(361.53,128.846))z238
+ ..controls hide(z239=(360.967,127.519))z239 and hide(z240=(360.506,125.117))z240..hide(z241=(360.506,123.508))z241
+ ..controls hide(z242=(360.506,121.899))z242 and hide(z243=(360.111,119.859))z243..hide(z244=(359.629,118.974))z244
+ ..controls hide(z245=(359.15,118.097))z245 and hide(z246=(358.834,116.269))z246..hide(z247=(358.934,114.952))z247
+ ..controls hide(z248=(359.034,113.636))z248 and hide(z249=(358.602,111.825))z249..hide(z250=(357.983,110.967))z250
+ ..controls hide(z251=(357.35,110.088))z251 and hide(z252=(356.85,108.298))z252..hide(z253=(356.85,106.909))z253
+ ..controls hide(z254=(356.85,105.519))z254 and hide(z255=(356.382,103.567))z255..hide(z256=(355.79,102.485))z256
+ ..controls hide(z257=(355.209,101.424))z257 and hide(z258=(354.401,97.4023))z258..hide(z259=(354.005,93.5999))z259
+ ..controls hide(z260=(352.968,83.6548))z260 and hide(z261=(352.529,81.2454))z261..hide(z262=(351.429,79.4868))z262
+ ..controls hide(z263=(350.069,77.3098))z263 and hide(z264=(348.615,69.103))z264..hide(z265=(349.163,66.6899))z265
+ ..controls hide(z266=(349.581,64.8442))z266 and hide(z267=(349.391,64.6501))z267..hide(z268=(346.247,63.7119))z268
+ ..controls hide(z269=(341.811,62.3882))z269 and hide(z270=(340.625,63.3262))z270..hide(z271=(340.914,67.9331))z271
+ ..controls hide(z272=(341.263,73.5166))z272 and hide(z273=(339.121,72.5398))z273..hide(z274=(338.347,66.7629))z274
+ ..controls hide(z275=(337.642,61.498))z275 and hide(z276=(335.318,60.0554))z276..hide(z277=(334.459,64.3499))z277
+ ..controls hide(z278=(334.225,65.5198))z278 and hide(z279=(333.412,67.0278))z279..hide(z280=(332.646,67.7136))z280
+ ..controls hide(z281=(331.914,68.3679))z281 and hide(z282=(331.256,69.5457))z282..hide(z283=(331.256,70.2))z283
+ ..controls hide(z284=(331.256,70.8691))z284 and hide(z285=(330.353,72.7593))z285..hide(z286=(329.3,74.2949))z286
+ ..controls hide(z287=(325.789,79.4136))z287 and hide(z288=(320.082,90.9722))z288..hide(z289=(318.72,95.7205))z289
+ ..controls hide(z290=(317.42,100.254))z290 and hide(z291=(314.317,105.3))z291..hide(z292=(312.829,105.3))z292
+ ..controls hide(z293=(308.461,105.3))z293 and hide(z294=(294.694,129.504))z294..hide(z295=(294.694,137.182))z295
+ ..controls hide(z296=(294.694,141.643))z296 and hide(z297=(291.904,145.559))z297..hide(z298=(290.891,142.521))z298
+ ..controls hide(z299=(290.542,141.474))z299 and hide(z300=(287.381,143.252))z300..hide(z301=(287.381,144.495))z301
+ ..controls hide(z302=(287.381,144.918))z302 and hide(z303=(286.723,145.888))z303..hide(z304=(285.992,146.542))z304
+ ..controls hide(z305=(285.21,147.242))z305 and hide(z306=(284.219,148.809))z306..hide(z307=(283.725,150.125))z307
+ ..controls hide(z308=(283.246,151.402))z308 and hide(z309=(282.133,154.294))z309..hide(z310=(281.275,156.487))z310
+ ..controls hide(z311=(280.406,158.711))z311 and hide(z312=(278.15,162.52))z312..hide(z313=(276.229,165.006))z313
+ ..controls hide(z314=(274.309,167.493))z314 and hide(z315=(272.756,170.223))z315..hide(z316=(272.756,171.112))z316
+ ..controls hide(z317=(272.756,172))z317 and hide(z318=(271.953,173.672))z318..hide(z319=(270.965,174.842))z319
+ ..controls hide(z320=(269.404,176.689))z320 and hide(z321=(269.276,177.255))z321..hide(z322=(269.969,179.229))z322
+ ..controls hide(z323=(270.893,181.862))z323 and hide(z324=(269.866,185.685))z324..hide(z325=(267.573,188.15))z325
+ ..controls hide(z326=(266.139,189.692))z326 and hide(z327=(265.841,220.618))z327..hide(z328=(267.229,223.909))z328
+ ..controls hide(z329=(267.537,224.64))z329 and hide(z330=(267.426,225.664))z330..hide(z331=(266.979,226.212))z331
+ ..controls hide(z332=(266.536,226.755))z332 and hide(z333=(265.939,230.782))z333..hide(z334=(265.65,235.17))z334
+ ..controls hide(z335=(264.577,251.473))z335 and hide(z336=(263.579,226.029))z336..hide(z337=(264.07,194.878))z337
+ ..controls hide(z338=(264.101,192.884))z338 and hide(z339=(263.729,188.479))z339..hide(z340=(263.25,185.189))z340
+ ..controls hide(z341=(262.42,179.485))z341 and hide(z342=(262.452,179.086))z342..hide(z343=(263.835,177.876))z343
+ ..controls hide(z344=(264.65,177.164))z344 and hide(z345=(266.512,174.33))z345..hide(z346=(268.04,171.478))z346
+ ..controls hide(z347=(269.567,168.626))z347 and hide(z348=(271.381,165.501))z348..hide(z349=(272.135,164.421))z349
+ ..controls hide(z350=(272.9,163.324))z350 and hide(z351=(273.487,162.293))z351..hide(z352=(273.487,162.045))z352
+ ..controls hide(z353=(273.487,161.804))z353 and hide(z354=(275.511,158.242))z354..hide(z355=(277.976,154.147))z355
+ ..controls hide(z356=(282.728,146.25))z356 and hide(z357=(284.237,143.655))z357..hide(z358=(287.245,138.206))z358
+ ..controls hide(z359=(289.99,133.234))z359 and hide(z360=(299.06,117.685))z360..hide(z361=(301.023,114.587))z361
+ ..controls hide(z362=(301.95,113.124))z362 and hide(z363=(302.737,111.747))z363..hide(z364=(302.737,111.589))z364
+ ..controls hide(z365=(302.737,111.183))z365 and hide(z366=(314.213,91.2598))z366..hide(z367=(321.733,78.6091))z367
+ ..controls hide(z368=(325.081,72.9785))z368 and hide(z369=(329.837,64.9495))z369..hide(z370=(332.304,60.7668))z370
+ ..controls hide(z371=(338.083,50.968))z371 and hide(z372=(337.658,51.1626))z372..hide(z373=(346.101,54.4392))z373
+ ..controls hide(z374=(354.37,57.6489))z374 and hide(z375=(353.838,56.9644))z375..hide(z376=(355.457,66.4705))z376
+ ..controls hide(z377=(356.179,70.7117))z377 and hide(z378=(357.29,77.0364))z378..hide(z379=(357.91,80.4373))z379
+ ..controls hide(z380=(358.537,83.8743))z380 and hide(z381=(359.518,89.2683))z381..hide(z382=(360.104,92.5029))z382
+ ..controls hide(z383=(360.686,95.7136))z383 and hide(z384=(362.512,105.446))z384..hide(z385=(364.153,114.075))z385
+ ..controls hide(z386=(367.6,132.21))z386 and hide(z387=(370.829,149.516))z387..hide(z388=(373.021,161.606))z388
+ ..controls hide(z389=(373.857,166.213))z389 and hide(z390=(374.711,170.875))z390..hide(z391=(374.912,171.917))z391
+ ..controls hide(z392=(375.191,173.367))z392 and hide(z393=(374.51,174.842))z393..hide(z394=(372.046,178.132))z394
+ ..controls hide(z395=(364.981,187.565))z395 and hide(z396=(360.559,193.664))z396..hide(z397=(357.253,198.534))z397
+ ..controls hide(z398=(355.351,201.336))z398 and hide(z399=(351.495,206.797))z399..hide(z400=(348.733,210.6))z400
+ ..controls hide(z401=(345.967,214.408))z401 and hide(z402=(340.482,222.007))z402..hide(z403=(336.594,227.419))z403
+ ..controls hide(z404=(332.706,232.83))z404 and hide(z405=(327.32,240.264))z405..hide(z406=(324.675,243.872))z406
+ ..controls hide(z407=(321.994,247.528))z407 and hide(z408=(318.404,252.436))z408..hide(z409=(316.598,254.914))z409
+ ..controls hide(z410=(307.005,268.076))z410 and hide(z411=(302.032,274.894))z411..hide(z412=(295.05,284.456))z412
+ ..controls hide(z413=(290.779,290.306))z413 and hide(z414=(285.377,297.845))z414..hide(z415=(283.001,301.275))z415
+ ..controls hide(z416=(275.704,311.805))z416 and hide(z417=(275.811,311.75))z417..cycle;
+ PreeditedPath2 = hide(z418=(254.987,177.913))z418..controls hide(z419=(254.744,177.67))z419 and hide(z420=(253.305,177.229))z420..hide(z421=(251.769,176.926))z421
+ ..controls hide(z422=(250.239,176.624))z422 and hide(z423=(246.065,175.346))z423..hide(z424=(242.482,174.084))z424
+ ..controls hide(z425=(235.17,171.507))z425 and hide(z426=(231.263,171.562))z426..hide(z427=(228.296,174.285))z427
+ ..controls hide(z428=(226.59,175.85))z428 and hide(z429=(225.265,175.207))z429..hide(z430=(225.222,172.794))z430
+ ..controls hide(z431=(225.181,170.533))z431 and hide(z432=(221.496,168.977))z432..hide(z433=(216.377,169.058))z433
+ ..controls hide(z434=(212.647,169.117))z434 and hide(z435=(210.978,168.823))z435..hide(z436=(209.978,167.931))z436
+ ..controls hide(z437=(209.247,167.279))z437 and hide(z438=(208.138,166.725))z438..hide(z439=(207.565,166.725))z439
+ ..controls hide(z440=(206.982,166.725))z440 and hide(z441=(205.847,166.11))z441..hide(z442=(205.042,165.359))z442
+ ..controls hide(z443=(202.136,162.644))z443 and hide(z444=(198.973,161.521))z444..hide(z445=(194.147,161.49))z445
+ ..controls hide(z446=(190.929,161.469))z446 and hide(z447=(188.598,161.014))z447..hide(z448=(186.688,160.034))z448
+ ..controls hide(z449=(185.149,159.244))z449 and hide(z450=(181.789,157.939))z450..hide(z451=(179.156,157.109))z451
+ ..controls hide(z452=(176.524,156.279))z452 and hide(z453=(173.783,155.284))z453..hide(z454=(173.014,154.879))z454
+ ..controls hide(z455=(172.251,154.477))z455 and hide(z456=(169.942,153.653))z456..hide(z457=(167.895,153.051))z457
+ ..controls hide(z458=(165.847,152.448))z458 and hide(z459=(163.522,151.492))z459..hide(z460=(162.74,150.93))z460
+ ..controls hide(z461=(161.973,150.38))z461 and hide(z462=(160.18,149.906))z462..hide(z463=(158.864,149.906))z463
+ ..controls hide(z464=(157.548,149.906))z464 and hide(z465=(155.467,149.416))z465..hide(z466=(154.367,148.846))z466
+ ..controls hide(z467=(153.27,148.278))z467 and hide(z468=(152.149,147.955))z468..hide(z469=(151.954,148.151))z469
+ ..controls hide(z470=(151.753,148.351))z470 and hide(z471=(150.016,147.838))z471..hide(z472=(148.115,147.018))z472
+ ..controls hide(z473=(146.213,146.197))z473 and hide(z474=(143.748,145.515))z474..hide(z475=(142.667,145.51))z475
+ ..controls hide(z476=(128.554,145.452))z476 and hide(z477=(126.589,144.869))z477..hide(z478=(124.219,140.034))z478
+ ..controls hide(z479=(123.528,138.624))z479 and hide(z480=(122.192,137.646))z480..hide(z481=(119.925,136.89))z481
+ ..controls hide(z482=(118.097,136.281))z482 and hide(z483=(115.887,135.452))z483..hide(z484=(114.952,135.025))z484
+ ..controls hide(z485=(114.015,134.597))z485 and hide(z486=(112.283,134.322))z486..hide(z487=(111.04,134.404))z487
+ ..controls hide(z488=(109.836,134.483))z488 and hide(z489=(107.75,133.91))z489..hide(z490=(106.506,133.16))z490
+ ..controls hide(z491=(105.256,132.406))z491 and hide(z492=(103.033,131.403))z492..hide(z493=(101.644,130.967))z493
+ ..controls hide(z494=(100.254,130.53))z494 and hide(z495=(98.2485,129.46))z495..hide(z496=(97.2561,128.627))z496
+ ..controls hide(z497=(95.428,127.091))z497 and hide(z498=(95.428,127.091))z498..hide(z499=(98.426,127.436))z499
+ ..controls hide(z500=(101.129,127.747))z500 and hide(z501=(115.684,132.079))z501..hide(z502=(128.334,136.337))z502
+ ..controls hide(z503=(131.163,137.289))z503 and hide(z504=(139.669,139.925))z504..hide(z505=(147.347,142.228))z505
+ ..controls hide(z506=(155.025,144.531))z506 and hide(z507=(164.185,147.312))z507..hide(z508=(167.822,148.444))z508
+ ..controls hide(z509=(171.478,149.581))z509 and hide(z510=(176.841,151.206))z510..hide(z511=(179.887,152.1))z511
+ ..controls hide(z512=(182.911,152.987))z512 and hide(z513=(191.441,155.611))z513..hide(z514=(198.9,157.95))z514
+ ..controls hide(z515=(206.359,160.288))z515 and hide(z516=(215.873,163.225))z516..hide(z517=(220.106,164.495))z517
+ ..controls hide(z518=(224.347,165.767))z518 and hide(z519=(230.894,167.764))z519..hide(z520=(234.731,168.955))z520
+ ..controls hide(z521=(238.534,170.136))z521 and hide(z522=(244.657,171.975))z522..hide(z523=(248.259,173.019))z523
+ ..controls hide(z524=(255.864,175.222))z524 and hide(z525=(259.346,176.934))z525..hide(z526=(257.985,177.8))z526
+ ..controls hide(z527=(256.888,178.498))z527 and hide(z528=(255.62,178.546))z528..cycle;
+ dotlabels.rt(371,375,416,44,26);
+ draw PreeditedPath1 withcolor green;
+ draw PreeditedPath2 withcolor red;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FEATPOST specific %%
+ PhotoMarks := 5;
+ PhotoPair1 := z26; PhotoPoint1 := (7.0,-0.6,5.6);
+ PhotoPair2 := z44; PhotoPoint2 := (7.0,0,0);
+ PhotoPair3 := z371; PhotoPoint3:= (0,6.4,0);
+ PhotoPair4 := z375; PhotoPoint4:= (-0.6,6.4,0);
+ PhotoPair5 := z416; PhotoPoint5:= (-0.6,-0.6,5.6);
+ color pp[];
+ pp1 = (7.0,-0.6,7.0);
+ pp5 = (-0.6,-0.6,7.0);
+ pp2 = (8.4,0,0);
+ pp3 = (8.4,6.4,0);
+ path pt[];
+ f := (15,20,15); %%%%%%%%%%%%%%%%%%%%%%%
+ viewcentr := black; %%
+ Spread := 30; %% Parameters
+ ShiftV := (250,100); %%
+% SphericalDistortion := true; %%%%%%%%%%%%%%%%%%%%%%%
+
+ pt1 = rp(PhotoPoint1)--rp(pp1)--rp(pp5)--rp(PhotoPoint5);
+ pt2 = rp(PhotoPoint2)--rp(pp2)--rp(pp3)--rp(PhotoPoint3);
+ draw pt1 withpen pencircle scaled 3pt withcolor blue;
+ draw pt2 withpen pencircle scaled 3pt withcolor blue;
+
+ photoreverse(400,5.5,2.5); %% Changes parameters
+
+ pt3 = rp(PhotoPoint1)--rp(pp1)--rp(pp5)--rp(PhotoPoint5);
+ pt4 = rp(PhotoPoint2)--rp(pp2)--rp(pp3)--rp(PhotoPoint3);
+ draw pt3 withpen pencircle scaled 1pt;
+ draw pt4 withpen pencircle scaled 1pt;
+endfig;
+end
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/polyhedr.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/polyhedr.mp
new file mode 100644
index 00000000000..b0509b75f05
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/polyhedr.mp
@@ -0,0 +1,191 @@
+% polyhedr.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{newcent}
+\pagestyle{empty}
+\begin{document}
+etex
+
+% This exemplifies hidden line removal.
+
+f := (2,5,3);
+
+beginfig(1);
+ Print_Step := 1;
+ faceraytrace( 0.4, red );
+ lineraytrace( 0.4, black );
+% pickup pencircle scaled 2pt;
+% draw_all_test( false );
+% pickup pencircle scaled 1pt;
+% sharpraytrace;
+endfig;
+
+f := 2*(2,5,3.5);
+Print_step := 10;
+Spread := 156;
+LightSource := 2.5*(4,-3,17);
+
+beginfig(2);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Definition of the 3D-figure
+ V1 := (1.4,0,0);
+ V2 := (1,1,0);
+ V3 := (0,1.4,0);
+ V4 := (-1,1,0);
+ V5 := (-1.4,0,0);
+ V6 := (-1,-1,0);
+ V7 := (0, -1.4,0);
+ V8 := (1,-1,0);
+ V9 := (1.4,0,1);
+ V10:= (1,1,1);
+ V11:= (0,1.4,1);
+ V12:= (-1,1,1);
+ V13:= (-1.4,0,1);
+ V14:= (-1,-1,1);
+ V15:= (0,-1.4,1);
+ V16:= (1,-1,1);
+
+ V17:= (1.4,0,-1);
+ V18:= (1,1,-1);
+ V19:= (0,1.4,-1);
+ V20:= (-1,1,-1);
+ V21:= (-1.4,0,-1);
+ V22:= (-1,-1,-1);
+ V23:= (0,-1.4,-1);
+ V24:= (1,-1,-1);
+
+ V25:= (0.7,0,0);
+ V26:= (0,0.7,0);
+ V27:= (0.7,-0.7,0.7);
+ V28:= (0.7,0,0.7);
+ V29:= (0,0.7,0.7);
+ V30:= (-0.7,0.7,0.7);
+ V31:= (0.35,0.35,1.05);
+ V32:= (0,-0.7,1.4);
+ V34:= (0,0,1.4);
+ V33:= (-0.7,0,1.4);
+ NL := 1;
+ npl1 := 9;
+ L1p1 := V17;
+ L1p2 := V18;
+ L1p3 := V19;
+ L1p4 := V20;
+ L1p5 := V21;
+ L1p6 := V22;
+ L1p7 := V23;
+ L1p8 := V24;
+ L1p9 := V17;
+ NF := 8;
+ npf1 := 4;
+ F1p1 := V1;
+ F1p2 := V2;
+ F1p3 := V10;
+ F1p4 := V9;
+ npf2 := 4;
+ F2p1 := V2;
+ F2p2 := V3;
+ F2p3 := V11;
+ F2p4 := V10;
+ npf3 := 4;
+ F3p1 := V3;
+ F3p2 := V4;
+ F3p3 := V12;
+ F3p4 := V11;
+ npf4 := 4;
+ F4p1 := V4;
+ F4p2 := V5;
+ F4p3 := V13;
+ F4p4 := V12;
+ npf5 := 4;
+ F5p1 := V5;
+ F5p2 := V6;
+ F5p3 := V14;
+ F5p4 := V13;
+ npf6 := 4;
+ F6p1 := V6;
+ F6p2 := V7;
+ F6p3 := V15;
+ F6p4 := V14;
+ npf7 := 4;
+ F7p1 := V7;
+ F7p2 := V8;
+ F7p3 := V16;
+ F7p4 := V15;
+ npf8 := 4;
+ F8p1 := V8;
+ F8p2 := V1;
+ F8p3 := V9;
+ F8p4 := V16;
+ makeface9(25,26,29,31,28);
+ makeface10(25,27,28);
+ makeface11(26,29,30);
+ makeface12(27,28,31,34,32);
+ makeface13(31,29,30,33,34);
+ makeface14(32,33,34);
+ makeface15(25,26,30,33,32,27);
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% draw_all_test(true);
+ ShadowOn := true;
+ fill_faces();
+ draw_invisible( true, true, TableC3, TableC0 );
+% lineraytrace(0.3, black);
+% faceraytrace(0.4, green); % This my take very long.
+% sharpraytrace;
+
+endfig;
+
+f := 2*(-2,-0.5,2.5);
+Spread := 56;
+LightSource := 1.5*(-4,5,2.7);
+
+beginfig(3);
+ numeric i, aux;
+ pair anglepar;
+ V1 := ( 0.7, 0, 0 );
+ V2 := ( 0, 0.7, 0 );
+ V3 := ( 0.7,-0.7, 0.7 );
+ V4 := ( 0.7, 0, 0.7 );
+ V5 := ( 0, 0.7, 0.7 );
+ V6 := (-0.7, 0.7, 0.7 );
+ V7 := ( 0.35,0.35,1.05);
+ V8 := ( 0, -0.7, 1.4 );
+ V9 := ( 0, 0, 1.4 );
+ V10:= (-0.7, 0, 1.4 );
+ anglepar = getanglepair( (1,1,1) );
+ for i=11 upto 20:
+ V[i]:=eulerrotation( -45, 0, 0, V[i-10] );
+ V[i]:=eulerrotation( 0, 90-ypart anglepar, 0, V[i] );
+ endfor;
+ aux = Z( V11 );
+ for i=25 upto 34:
+ V[i]:=( X(V[i-14]),Y(V[i-14]),1.35*(Z(V[i-14])-aux));
+ endfor;
+ makeface1(25,26,29,31,28);
+ makeface2(25,27,28);
+ makeface3(26,29,30);
+ makeface4(32,33,34);
+ makeface5(25,26,30,34,32,27);
+ makeface6(27,28,31,33,32);
+ makeface7(31,29,30,34,33);
+ for i=1 upto 7:
+ FC[i] := 4;
+ FCD[i]:= true;
+ endfor;
+ ShadowOn := true;
+ setthearena( 10, 5 );
+ fill_faces();
+ draw_invisible( false, false, TableC4, TableC0 );
+% for i=25 upto 34:
+% label.top( decimal(i), rp(V[i]) );
+% endfor;
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/positivecharge.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/positivecharge.mp
new file mode 100644
index 00000000000..b0fccbc11a3
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/positivecharge.mp
@@ -0,0 +1,28 @@
+% positivecharge.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ numeric size, num, i, j, coos[];
+ string comm, bray;
+ color fro, tip;;
+ size = 1.5;
+ num = 70;
+ bray = "0.05";
+ draw rp(black)--rp((size,0,0))--rp((size,size,0))--rp((0,size,0))--cycle;
+ for i=1 upto num:
+ for j=1 upto 6:
+ coos[j] := uniformdeviate(size);
+ endfor;
+ fro := (coos1,coos2,coos3);
+ tip := (coos4,coos5,coos6);
+ comm := "positivecharge(true," & cstr(fro) & "," & bray & ");";
+ getready( comm, fro );
+ comm := "positivecharge(false," & cstr(tip) & "," & bray & ");";
+ getready( comm, tip );
+ endfor;
+ doitnow;
+endfig;
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/resistcircuit.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/resistcircuit.mp
new file mode 100644
index 00000000000..e0e679c97e1
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/resistcircuit.mp
@@ -0,0 +1,64 @@
+% resistcircuit.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ boolean kind[];
+ numeric largmolas, lengmolas, numolas, numturns, u, i, fraction, stepx;
+ numeric totalx, totaly, actuax, actuay, numparal, numserie, stepy;
+ path refpath;
+ pair refpoint, startpoint, ini, fin;
+ pickup pencircle scaled 2pt;
+ fraction = 0.6;
+ numolas = 9;
+ u = 2mm;
+ largmolas = 2u;
+ lengmolas = 12u;
+ numturns = 10;
+ actuax = 1;
+ actuay = 1;
+ numparal = 0;
+ numserie = 1;
+ stepy = largmolas/fraction;
+ stepx = 0.5*(1-fraction)*lengmolas;
+ draw (left*stepx)--origin;
+ for i=2 upto numolas:
+ if uniformdeviate(2) > 1:
+ kind[i] = false;
+ numserie := incr( numserie );
+ else:
+ kind[i] = true;
+ numparal := incr( numparal );
+ fi;
+ endfor;
+ totalx = numserie*lengmolas;
+ totaly = numparal*stepy;
+ draw (right*totalx)--(right*(totalx+stepx));
+ startpoint = (up*0.5*totaly);
+ refpoint = startpoint;
+ draw (down*0.5*totaly)--refpoint;
+ refpath = springpath(origin,right*lengmolas,numturns,largmolas,fraction);
+ draw refpath shifted refpoint;
+ refpoint := refpoint + right*lengmolas;
+ for i=2 upto numolas:
+ if kind[i]:
+ ini := startpoint+down*stepy*actuay;
+ fin := ini + 0.5*(actuax-1)*lengmolas*right;
+ draw ini--fin;
+ draw refpath shifted fin;
+ ini := fin + lengmolas*right;
+ fin := ini + 0.5*(actuax-1)*lengmolas*right;
+ draw ini--fin--refpoint;
+ refpoint := refpoint + down*stepy*0.5;
+ actuay := incr( actuay );
+ else:
+ draw refpath shifted refpoint;
+ refpoint := refpoint + right*lengmolas;
+ actuax := incr( actuax );
+ fi;
+ endfor;
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorouscircle.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorouscircle.mp
new file mode 100644
index 00000000000..a63ecb92e95
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorouscircle.mp
@@ -0,0 +1,49 @@
+% rigorouscircle.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+f := (2,0.2,0.1);
+
+
+beginfig(1);
+ numeric ind, cray, sray, cnum, ang, aux, auxs;
+ color sidevec, rayvec, angulmomv, vecaux;
+ path paux;
+ pen pendot;
+ pendot = pencircle scaled 2pt;
+ sray = 1;
+ cnum = 8;
+ ang = 45;
+ auxs = 0.15;
+ ray = 3*cosd(ang)*sray/cnum;
+ sidevec = ( sray*sind(ang), 0, 0 );
+ for ind=1 upto cnum:
+ aux := ind*360/cnum;
+% draw rigorouscircle( black, (0,sind(aux),cosd(aux)), sray ) dashed evenly;
+ rayvec := sray*cosd(ang)*(0,cosd(aux),sind(aux));
+
+ vecaux := rayvec+sidevec;
+ drawarrow rp(black)--rp(vecaux+auxs*N(vecaux));
+ paux := rigorouscircle( vecaux, vecaux, ray );
+ draw paux;
+ drawoptions( withpen pendot );
+ drawarrow (subpath (0,1) of paux);
+ draw rp(vecaux);
+ drawoptions();
+
+ vecaux := rayvec-sidevec;
+ drawarrow rp(black)--rp(vecaux+auxs*N(vecaux));
+ paux := rigorouscircle( vecaux, vecaux, ray );
+ draw paux;
+ drawoptions( withpen pendot );
+ drawarrow (subpath (0,1) of paux);
+ draw rp(vecaux);
+ drawoptions();
+ endfor;
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorouscone.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorouscone.mp
new file mode 100644
index 00000000000..3c79b95315b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorouscone.mp
@@ -0,0 +1,36 @@
+% rigorouscone.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ color nalfa, gammacnt, vertex;
+ path gamma, cone;
+ numeric altura, grids, radius, aux, i, numc, slope;
+
+ f := (5,4,2);
+ Spread := 60;
+ ShiftV := (200,200);
+ altura = 1;
+ radius = 0.3;
+ grids = 1;
+ numc = 9;
+ slope = 3;
+ nalfa = (0,0,1);
+
+ for i=1 upto numc:
+ aux := (i-0.5*(numc+1))*grids;
+ gammacnt := (0,aux,0);
+ vertex := (aux/slope,aux,altura);
+ gamma := rigorouscircle( gammacnt, nalfa, radius );
+ cone := rigorouscone(true, gammacnt, nalfa, radius, vertex );
+ unfill cone;
+ draw gamma dashed evenly;
+ draw cone;
+ endfor;
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousdiscSD.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousdiscSD.mp
new file mode 100644
index 00000000000..e9bfa7c2730
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousdiscSD.mp
@@ -0,0 +1,49 @@
+% rigorousdiscSD.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+f := 0.8*(6,3,4);
+
+SphericalDistortion := true;
+%%%%%Spread := 6;
+
+%SphericalDistortion := false;
+%%%%%%Spread := 20;
+
+beginfig(1);
+ color nalfa, gammacnt, vertex;
+ numeric altura, grids, radius, aux, auy, i, j, numc;
+
+ altura = 1;
+ radius = 0.5;
+ grids = 1.4;
+ numc = 7;
+
+ for i=1 upto numc:
+ aux := (i-0.5*(numc+1))*grids;
+ for j=1 upto numc:
+ auy := (j-0.5*(numc+1))*grids;
+ if normaldeviate > 0:
+ gammacnt := (aux,auy,0);
+ vertex := (aux,auy,altura);
+ else:
+ if normaldeviate > 0:
+ gammacnt := (aux-altura/2,auy,radius);
+ vertex := (aux+altura/2,auy,radius);
+ else:
+ gammacnt := (aux,auy-altura/2,radius);
+ vertex := (aux,auy+altura/2,radius);
+ fi;
+ fi;
+ nalfa := vertex - gammacnt;
+ rigorousdisc( 0, true, gammacnt, radius, nalfa );
+ endfor;
+ endfor;
+ produce_auto_scale;
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousdiscoptions.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousdiscoptions.mp
new file mode 100644
index 00000000000..59200177b7d
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousdiscoptions.mp
@@ -0,0 +1,31 @@
+% rigorousdiscoptions.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+f := 0.8*(6,3,4);
+
+beginfig(1);
+ color axe, cstep, colen;
+ numeric nstep, sfrac, ouray, inray;
+
+ nstep = 0.65;
+ sfrac = 0.1;
+ ouray = 0.7;
+ inray = 0.5;
+
+ axe = red;
+ cstep = ( nstep, 0, 0 );
+ colen = ( nstep*sfrac, 0, 0 );
+
+ pickup pencircle scaled 2pt;
+ rigorousdisc( 0, true, -cstep, ouray, colen );
+ rigorousdisc( 0, false, black, ouray, colen );
+ rigorousdisc( inray, true, cstep, ouray, colen );
+ rigorousdisc( inray, false, 2*cstep, ouray, colen );
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousfearpath.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousfearpath.mp
new file mode 100644
index 00000000000..c56ab28f61a
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/rigorousfearpath.mp
@@ -0,0 +1,66 @@
+% rigorousfearpath.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ numeric sfr, radfac, ind;
+ color xv, yv, zv, Ve[];
+ path p[];
+ f := 2*(5,2,3);
+ Spread := 50;
+ csr := 0.47;
+ clr := 0.57;
+ xv := (csr,0,0);
+ yv := (0,csr,0);
+ zv := (0,0,csr);
+ Ve1 := (-1,-1,-1);
+ Ve2 := (-1,1,-1);
+ Ve3 := (1,-1,-1);
+ Ve4 := (1,1,-1);
+ Ve5 := (-1,-1,1);
+ Ve6 := (-1,1,1);
+ Ve7 := (1,-1,1);
+ Ve8 := (1,1,1);
+ Ve9 := (0,0,0);
+ for ind=1 upto 8:
+ p[ind] := rigorousfearpath( Ve[ind], csr );
+ endfor;
+ p9 := rigorousfearpath( Ve9, clr );
+ unfill p1;
+ draw p1;
+ draw rp(Ve1+yv)--rp(Ve2-yv);
+ draw rp(Ve1+xv)--rp(Ve3-xv);
+ unfill p2;
+ draw p2;
+ unfill p3;
+ draw p3;
+ draw rp(Ve4-yv)--rp(Ve3+yv);
+ draw rp(Ve4-xv)--rp(Ve2+xv);
+ unfill p4;
+ draw p4;
+ draw rp(Ve1+zv)--rp(Ve5-zv);
+ draw rp(Ve2+zv)--rp(Ve6-zv);
+ unfill p9;
+ draw p9;
+ draw rp(Ve3+zv)--rp(Ve7-zv);
+ draw rp(Ve4+zv)--rp(Ve8-zv);
+ unfill p5;
+ draw p5;
+ draw rp(Ve5+yv)--rp(Ve6-yv);
+ draw rp(Ve5+xv)--rp(Ve7-xv);
+ unfill p6;
+ draw p6;
+ unfill p7;
+ draw p7;
+ draw rp(Ve8-yv)--rp(Ve7+yv);
+ draw rp(Ve8-xv)--rp(Ve6+xv);
+ unfill p8;
+ draw p8;
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/rotatnlc.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/rotatnlc.mp
new file mode 100644
index 00000000000..3adafc002cc
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/rotatnlc.mp
@@ -0,0 +1,49 @@
+% rotatnlc.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+
+ f := 2*(2,1,0.55);
+
+ Spread := 450;
+
+ color gridvec, sizevec, currpos, starpos, bordpos;
+ numeric i, j, k, counter, theta, phi, thetamin;
+ numeric thetamax, thetastp, long, radius, polar;
+ sizevec := (7,42,1); % (number of circles,
+ % number of vectors in outer circle,
+ % number of levels )
+ gridvec := (0.08,0.23,0.3);
+ thetamin := 90;
+ thetamax := 150;
+ long := 0.08;
+ thetastp := (thetamax-thetamin)/(X(sizevec)-1);
+ starpos := ( -X(gridvec)*X(sizevec) ,
+ -X(gridvec)*X(sizevec) ,
+ 0 );
+ bordpos := starpos;
+ counter := 1;
+ for i=1 upto X(sizevec):
+ radius := (i-1)*X(gridvec);
+ polar := i*floor(Y(sizevec)/X(sizevec));
+ for j=1 upto polar:
+ for k=1 upto Z(sizevec):
+ phi := 360*(j-1)/polar;
+ theta := thetamin+(i-1)*thetastp;
+ currpos := radius*(cosd(phi-90),sind(phi-90),0)
+ +(k-1)*(0,0,Z(gridvec));
+ generatedirline( counter, phi, theta, long, currpos );
+ counter := incr(counter);
+ endfor;
+ endfor;
+ endfor;
+ NL := decr(counter);
+ director_invisible( true, Y(gridvec), false );
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/saturn.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/saturn.mp
new file mode 100644
index 00000000000..44be273cc73
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/saturn.mp
@@ -0,0 +1,111 @@
+% saturn.mp
+% L. Nobre G.
+% 2005
+
+verbatimtex
+\documentclass{article}
+\usepackage{newcent}
+\pagestyle{empty}
+\begin{document}
+etex
+
+f := 2.5*(5,0,-1);
+Spread := 100;
+
+beginfig(1);
+ path planet, twilight, darkness, ringins, ringout, shadein, shadout;
+ path fullplanet, fullring, backdark, sunplanet, backring;
+ path nearringout, nearringins, hdtv, darkplanet;
+ numeric planetray, ringinsray, ringoutray, cutmargin, athmosray;
+ color sunposition, axedirection, labelpos, darknesstart, darknessend;
+ numeric inclinangle, labelray, begintime, endtime, colorfactor;
+ color planetcolor, ringcolor, toptextcolor, deepskycolor, bottextcolor;
+ picture storepicture;
+ planetray = 1;
+ ringinsray = 1.6;
+ ringoutray = 2.3;
+ labelray = 2.1;
+ cutmargin = 0.01;
+ inclinangle = 15;
+ sunposition = (-7,15,4);
+ colorfactor = 1.3;
+ bboxmargin := 6mm;
+ planetcolor = colorfactor*(255,152,55)/255;
+ ringcolor = colorfactor*(221,57,199)/255;
+ toptextcolor = colorfactor*(187,164,109)/255;
+ deepskycolor = colorfactor*(11,18,84)/255;
+ bottextcolor = colorfactor*(15,103,23)/255;
+ viewcentr := (0,0.5[planetray,ringinsray],0);
+ labelpos = (0,labelray,0);
+ athmosray = planetray+cutmargin;
+ axedirection = (0,-sind(inclinangle),cosd(inclinangle));
+ planet = rigorousfearpath( black, planetray );
+ twilight = spatialhalfcircle( black, sunposition, athmosray, true );
+ darknesstart = athmosray*ncrossprod( sunposition, axedirection );
+ darknessend = darknesstart - labelray*N( sunposition );
+ darkness = pathofstraightline( darknesstart, darknessend );
+ darknesstart := -darknesstart;
+ darknessend := darknesstart - labelray*N( sunposition );
+ backdark = pathofstraightline( darknesstart, darknessend );
+ ringins = goodcirclepath( black, axedirection, ringinsray );
+ ringout = goodcirclepath( black, axedirection, ringoutray );
+ endtime = xpart ( planet intersectiontimes twilight );
+ begintime = xpart ( reverse planet intersectiontimes twilight );
+ sunplanet = subpath (-begintime-cutmargin,endtime+cutmargin) of planet;
+ darkplanet = planet cutbefore twilight cutafter twilight;
+ fullplanet = buildcycle( sunplanet, reverse twilight );
+ fill fullplanet withcolor planetcolor;
+ endtime := xpart ( ringins intersectiontimes darkness );
+ begintime := xpart ( reverse ringins intersectiontimes sunplanet );
+ nearringins = subpath (-begintime-cutmargin,endtime+cutmargin) of ringins;
+ endtime := xpart ( ringout intersectiontimes darkness );
+ begintime := xpart ( reverse ringout intersectiontimes sunplanet );
+ nearringout = subpath (-begintime-cutmargin,endtime+cutmargin) of ringout;
+ backring = buildcycle( backdark, ringout, reverse darkplanet, reverse ringins );
+ fullring = buildcycle( nearringout, reverse darkness, reverse nearringins, sunplanet );
+ fill backring withcolor ringcolor;
+ fill fullring withcolor ringcolor;
+ picture thestatement;
+ thestatement = thelabel(
+ btex
+ \begin{tabular}{c}
+ \textbf{\textsf{{\Large T}$\!$ecnumbria}} \\
+ \textsf{\scriptsize a sombra da tecnologia}
+ \end{tabular}
+ etex,
+ origin);
+ pickup pencircle scaled 1pt;
+ draw thestatement scaled 2 shifted rp(labelpos) withcolor toptextcolor;
+ storepicture = currentpicture;
+ z1 = lrcorner currentpicture;
+ z2 = urcorner currentpicture;
+ z3 = ulcorner currentpicture;
+ z4 = llcorner currentpicture;
+ z5 = z1+down*bboxmargin;
+ z6 = z1+right*bboxmargin;
+ z7 = z2+right*bboxmargin;
+ z8 = z2+up*bboxmargin;
+ z9 = z3+up*bboxmargin;
+ z10= z3+left*bboxmargin;
+ z11= z4+left*bboxmargin;
+ z12= z4+down*bboxmargin;
+ z13= 0.5[z5,z12]+down*3*bboxmargin;
+ hdtv = z5..z6---z7..z8---z9..z10---z11..z12---cycle;
+ fill hdtv withcolor deepskycolor;
+ draw storepicture;
+ label(btex \texttt{\LARGE http://tecnumbria.com} etex, z13 );
+endfig;
+
+beginfig(2);
+ prologues := 1;
+ pickup pencircle scaled 5pt;
+ draw fullplanet;
+ unfill fullring;
+ draw fullring;
+ draw backring;
+endfig;
+
+verbatimtex \end{document} etex
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/sharpraytrace.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/sharpraytrace.mp
new file mode 100644
index 00000000000..120f272f5fe
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/sharpraytrace.mp
@@ -0,0 +1,102 @@
+% sharpraytrace.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+f := (5,1.5,4.5);
+Spread := 60;
+PrintStep := 5;
+
+numeric phi;
+phi = 0.5*(1+sqrt(5));
+
+V1 := ( 1, phi,0);
+V2 := (-1, phi,0);
+V3 := (-1,-phi,0);
+V4 := ( 1,-phi,0);
+V5 := (0, 1, phi);
+V6 := (0,-1, phi);
+V7 := (0,-1,-phi);
+V8 := (0, 1,-phi);
+V9 := ( phi,0, 1);
+V10:= ( phi,0,-1);
+V11:= (-phi,0,-1);
+V12:= (-phi,0, 1);
+makeface1(1,2,3,4);
+makeface2(5,6,7,8);
+makeface3(9,10,11,12);
+
+beginfig(1);
+ pickup pencircle scaled 2pt;
+% numeric asize;
+% asize = 0.5*(phi+1);
+% cartaxes(asize,asize,asize);
+ sharpraytrace;
+endfig;
+
+Spread := 120;
+f:=3*(1,0.5,0.75);
+PrintStep := 0.15;
+
+numeric a, b, c, d, e;
+a = 0.1;
+b = 0.3;
+c = 1.1;
+d = 2.9;
+e = 0.5;
+
+V1 := ( a , b , c);
+V2 := ( a-1, b , 0);
+V3 := ( a-1-e, b-d,0);
+V4 := (-b , a , c);
+V5 := (-b , a-1, 0);
+V6 := (-b+d,a-1-e, 0);
+V7 := (-a , -b , c);
+V8 := (-a+1,-b , 0);
+V9 := (-a+1+e,-b+d,0);
+V10:= ( b , -a , c);
+V11:= ( b ,-a+1, 0);
+V12:= (b-d,-a+1+e, 0);
+makeface1(1,2,3);
+makeface2(4,5,6);
+makeface3(7,8,9);
+makeface4(10,11,12);
+
+beginfig(2);
+ pickup pencircle scaled 2pt;
+ sharpraytrace;
+endfig;
+
+Spread := 120;
+f:=(3,5,-0.6);
+PrintStep := 5;
+
+numeric a, b, c, d;
+a = 0.2;
+b = 0.3;
+c = 1.3;
+d = 1.4;
+
+V1 := ( b, 2.5*a, b);
+V2 := ( b,-2.5*a, b);
+V3 := (-c,-2.5*a,-3*b);
+V4 := (-c, 2.5*a,-3*b);
+V5 := (-b, 4*a, b);
+V6 := (-b,-4*a, b);
+V7 := ( c,-4*a,-3*b);
+V8 := ( c, 4*a,-3*b);
+V9 := ( d, 2*a,-b);
+V10:= ( d,-2*a,-b);
+V11:= (-d,-2*a,-b);
+V12:= (-d, 2*a,-b);
+makeface1(1,2,3,4);
+makeface2(5,6,7,8);
+makeface3(9,10,11,12);
+
+beginfig(3);
+ pickup pencircle scaled 2pt;
+ sharpraytrace;
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/simplecar.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/simplecar.mp
new file mode 100644
index 00000000000..48224c4fc11
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/simplecar.mp
@@ -0,0 +1,25 @@
+% simplecar.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+%f := 0.25*(2,2.15,15.3);
+f := (2,0.15,1.1);
+Spread := 320;
+HoriZon := -0.2;
+
+beginfig(1);
+ color refpos, angcol, lencol, froncol, rearcol;
+ refpos = black;
+ angcol = black;
+ lencol = (0.6, 0.35, 0.28);
+ froncol = (0.026, 0.12, 0.06);
+ rearcol = froncol;
+ setthearena( 12, 1.3 );
+ simplecar( refpos, angcol, lencol, froncol, rearcol );
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/simplecarparam.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/simplecarparam.mp
new file mode 100644
index 00000000000..c98c6bcdd87
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/simplecarparam.mp
@@ -0,0 +1,56 @@
+% simplecarparam.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{palatino}
+\begin{document}
+etex
+
+%f := 0.25*(2,2.15,15.3);
+f := (3.5,8,1.1);
+Spread := 160;
+
+beginfig(1);
+ color refpos, angcol, lencol, froncol, rearcol;
+ color a, b, c, d;
+ numeric lx, ly, lz, fx, fy, fz, hei;
+ lx = 0.8;
+ ly = 0.35;
+ lz = 0.18;
+ fx = 0.1;
+ fy = 0.2;
+ fz = 0.132;
+ hei = 0.05;
+ refpos = black;
+ angcol = black;
+ lencol = (lx, ly, lz);
+ froncol = (fx, fy, fz);
+ rearcol = froncol;
+ a = (0.5*lx,0.5*ly,-0.5*lz);
+ b = (0.5*lx-fx,0.5*ly,-0.5*lz);
+ c = (0.5*lx-fx,0.5*ly+fy,-0.5*lz);
+ d = (0.5*lx-fx-fz,0.5*ly+fy,-0.5*lz);
+ simplecar( refpos, angcol, lencol, froncol, rearcol );
+ drawdblarrow rp(a)--rp(b);
+ drawdblarrow rp(b)--rp(c);
+ drawdblarrow rp(c)--rp(d);
+ drawoptions( withcolor 0.87red );
+ labelinspace( true, 0.3[a,b], -red, hei*blue, btex X etex );
+ labelinspace( true, 0.3[b,c], green, hei*blue, btex Y etex );
+ labelinspace( true, 0.3[c,d], -red, hei*blue, btex Z etex );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/spatialhalfsfear.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/spatialhalfsfear.mp
new file mode 100644
index 00000000000..d80e3e3f5a6
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/spatialhalfsfear.mp
@@ -0,0 +1,15 @@
+% spatialhalfsfear.mp
+% L. Nobre G.
+% 2004
+
+f := (3,-0.2,3);
+beginfig(1);
+ spatialhalfsfear( black, blue, 1 );
+ drawoptions( withpen pencircle scaled 3pt withcolor (blue+green) );
+ spatialhalfsfear( black, blue+green, 0.8 );
+ drawoptions( withpen pencircle scaled 3pt withcolor red );
+ spatialhalfsfear( black, red, 0.6 );
+ drawoptions( withpen pencircle scaled 3pt withcolor green );
+ spatialhalfsfear( black, green, 0.7 );
+endfig;
+end. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/spltwiben.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/spltwiben.mp
new file mode 100644
index 00000000000..5c85736f7bc
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/spltwiben.mp
@@ -0,0 +1,81 @@
+% spltwiben.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+def zsurface( expr xc, yc ) =
+ ((3*xc-5)*(3*xc+5)/(3*sqrt(3)*yc-5))
+enddef;
+
+f := (4,-5,3);
+Spread := 120;
+
+beginfig(1);
+ numeric i, j, nx, ny, lowx, higx, lowy, higy;
+ numeric posx, posy, posz, facz;
+ color gridx[], pos, reforig, endbeta, endpsip;
+ color endfiel, kdiv, krot, kben, akdiv, akrot, akben;
+ path facex;
+ facz = 7;
+ nx = 15;
+ ny = 50;
+ lowx = 0;
+ higx = 0.5*sqrt(3);
+ reforig = (0,-0.5,0);
+ endpsip = (0.3,-0.5,0);
+ endbeta = (0,-0.2,0);
+ endfiel = (0,-0.5,9/facz);
+ kdiv = (0,-0.5,8/facz);
+ krot = (0,-0.5,2/facz);
+ kben = (0,-0.5,5/facz);
+ akdiv = (higx,0.5,8/facz);
+ akrot = (higx,-0.5,2/facz);
+ akben = (0,0,5/facz);
+ draw rp((0,0,0))--rp((0,0,5/facz));
+ for i=1 upto nx:
+ posx := lowx + i*( higx - lowx )/nx;
+ lowy := -sqrt(3)*posx/3;
+ higy := -lowy;
+ for j=0 upto ny:
+ posy := lowy + j*( higy - lowy )/ny;
+ posz := zsurface( posx, posy )/facz;
+ gridx[j] := ( posx, posy, posz );
+ % show gridx[j];
+ endfor;
+ pos := ( posx, lowy, 0 );
+ facex := rp( pos )--rp( gridx0 );
+ for j=1 upto ny:
+ facex := facex--rp( gridx[j] );
+ endfor;
+ facex:=facex--rp((posx,higy,0))--cycle;
+ unfill facex;
+ draw facex;
+ endfor;
+ drawarrow rp(reforig)--rp(endpsip);
+ drawarrow rp(reforig)--rp(endbeta);
+ drawarrow rp(reforig)--rp(endfiel);
+ label.ulft(btex $\mathcal{X}$ etex, rp(endbeta) );
+ label.llft(btex $\mathcal{Z}$ etex, rp(endpsip) );
+ label.llft(btex $\mathcal{H}$ etex, rp(endfiel) );
+ dotlabel("",rp(reforig+(0,0,Z(gridx[ny]))));
+ dotlabel("",rp(reforig+(0,0,Z(gridx0))));
+ dotlabel("",rp(kben));
+ dotlabel.rt(btex $\mathcal{K}_1$ etex,rp(gridx[ny]));
+ dotlabel.lrt(btex $\mathcal{K}_2$ etex,rp(gridx0));
+ dotlabel.lft(btex $\mathcal{K}_3$ etex,rp(akben));
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/stageforthree.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/stageforthree.mp
new file mode 100644
index 00000000000..f0d81f26e60
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/stageforthree.mp
@@ -0,0 +1,115 @@
+% stageforthree.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+Spread := 35;
+f := (13,7,3.5);
+
+beginfig(1);
+ numeric i, len, wang, reflen, frac, coordg;
+ numeric fws, NumLines, inray, outay;
+ path conepath, cira, cirb, ella, ellb, tuba, tubb, tubc;
+ color axe, aroc, cubevertex, conecenter, conevertex;
+ color allellaxe, ellaaxe, ellbaxe, pca, pea, pcb, peb;
+ frac := 0.5;
+ len := 0.6;
+ wang := 60;
+ axe := (0,cosd(90-wang),sind(90-wang));
+ fws := 4;
+ reflen := 0.2*fws;
+ outay := 0.45*fws;
+ inray := 0.7*outay;
+ coordg := frac*fws;
+ NumLines := 30;
+ HoriZon := -0.5*fws;
+ setthestage( 0.5*NumLines, 2*fws );
+ cubevertex = (0.12*fws,-0.5*fws,-0.5*fws);
+ kindofcube(false,true,cubevertex,180,0,0,0.65*fws,0.2*fws,fws);
+ aroc := outay*(0,cosd(wang),sind(wang))-0.5*(0,fws,fws);
+ rigorousdisc( inray, true, aroc, outay, axe*len );
+ allellaxe := reflen*( 0.707, 0.707, 0 );
+ ellaaxe := reflen*( 0.707, -0.707, 1.0 );
+ ellbaxe := reflen*( -0.707, 0.707, 1.0 );
+ conecenter = ( coordg, coordg, -0.5*fws );
+ pca := ( coordg, -coordg, -0.5*fws );
+ pcb := ( -coordg, coordg, -0.5*fws );
+ pea := ( coordg, -coordg, 0.9*fws );
+ peb := ( -coordg, coordg, 0.9*fws );
+ cira := goodcirclepath( pca, blue, reflen );
+ cirb := goodcirclepath( pcb, blue, reflen );
+ ella := ellipticpath( pea, allellaxe, ellaaxe );
+ ellb := ellipticpath( peb, allellaxe, ellbaxe );
+ tuba := twocyclestogether( cira, ella );
+ tubb := twocyclestogether( cirb, ellb );
+ tubc := twocyclestogether( ella, ellb );
+ unfill tubb; draw tubb;
+ unfill tubc; draw tubc;
+ unfill tuba; draw tuba;
+ conevertex = conecenter + ( -3.5*reflen, 0, 0.8*fws );
+ verygoodcone(false,conecenter,blue,reflen,conevertex);
+endfig;
+
+Spread := 23;
+f := (6,13,3);
+ShadowOn := true;
+
+beginfig(2);
+ numeric reflen, frac, coordg;
+ numeric fws, NumLines;
+ path ella, ellb;
+ color axe, cubevertex;
+ color allellaxe, ellaaxe, pca, pcb;
+ frac := 0.5;
+ wang := 60;
+ axe := (0,cosd(90-wang),sind(90-wang));
+ fws := 4;
+ reflen := 0.35*fws;
+ coordg := frac*fws;
+ NumLines := 52;
+ HoriZon := -0.5*fws;
+ setthestage( 0.5*NumLines, 3.6*fws );
+ cubevertex = (0.3*fws,-0.5*fws,-0.5*fws);
+ kindofcube(false,true,cubevertex,180,0,0,0.6*fws,0.2*fws,fws);
+ allellaxe := reflen*( 0.707, 0.707, 0 );
+ ellaaxe := reflen*( 0.5, -0.5, 0 );
+ pca := ( coordg, coordg, -0.5*fws );
+ pcb := ( -coordg, coordg, -0.5*fws );
+
+ whatisthis( pca, 0.5*ellaaxe, allellaxe, reflen, 0.3 );
+ whatisthis( pcb, ellaaxe*sqrt(2), allellaxe/sqrt(2), 2*reflen, 0.6 );
+
+endfig;
+
+Spread := 23;
+f := (13,6,4.5);
+ShadowOn := true;
+LightSource := 10*(4,-3,6);
+beginfig(3);
+ numeric reflen, frac, coordg;
+ numeric fws, NumLines;
+ path ella, ellb;
+ color axe, cubevertex, conecenter, conevertex;
+ color allellaxe, ellaaxe, pca, pcb;
+ frac := 0.5;
+ wang := 60;
+ axe := (0,cosd(90-wang),sind(90-wang));
+ fws := 4;
+ reflen := 0.35*fws;
+ coordg := frac*fws;
+ NumLines := 45;
+ HoriZon := -0.5*fws;
+ setthestage( 0.5*NumLines, 3.3*fws );
+ cubevertex = (0.3*fws,-0.5*fws,0);
+ tropicalglobe( 7, cubevertex, 0.5*fws, axe );
+ allellaxe := reflen*( 0.707, 0.707, 0 );
+ ellaaxe := reflen*( 0.5, -0.5, 0 );
+ pcb := ( -coordg, coordg, 0 );
+ rigorousdisc( 0, true, pcb, 0.5*fws, -ellaaxe );
+ conecenter = ( coordg, coordg, -0.5*fws );
+ conevertex = conecenter + ( 0, 0, 0.9*fws );
+ verygoodcone(false,conecenter,blue,reflen,conevertex);
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/tangencypoint.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/tangencypoint.mp
new file mode 100644
index 00000000000..7c6d8f79601
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/tangencypoint.mp
@@ -0,0 +1,38 @@
+% tangencypoint.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ numeric u, i;
+ u = 5mm;
+ pen a, b, c;
+ a = pencircle scaled 3pt;
+ b = pencircle scaled 5pt;
+ c = pencircle scaled 1pt;
+ z1 = (1u,1u);
+ z2 = (4u,4u);
+ z3 = (4u,5u);
+ z4 = (3u,5u);
+ z5 = (3u,6u);
+ z6 = (4u,7u);
+ z7 = (6u,1u);
+ path cp;
+ cp = z1{up}..z2..z3..z4..z5..{up}z6;
+ draw cp withpen c;
+ for i=1 upto 6:
+ draw z[i] withpen a withcolor 0.5*(red+green);
+ endfor;
+ z8 = firsttangencypoint( cp, z7, 5 );
+ draw z7 withpen b withcolor green;
+ draw z7--z8 withpen c withcolor blue;
+endfig;
+
+end.
+
+
+
+
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/tdarrow.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/tdarrow.mp
new file mode 100644
index 00000000000..5ef43d52524
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/tdarrow.mp
@@ -0,0 +1,26 @@
+% tdarrow.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ numeric size, num, i, j, coos[];
+ string comm;
+ color tmpc, fro, tip;;
+ size = 1.5;
+ num = 250;
+ draw rp(black)--rp((size,0,0))--rp((size,size,0))--rp((0,size,0))--cycle;
+ for i=1 upto num:
+ for j=1 upto 6:
+ coos[j] := uniformdeviate(size);
+ endfor;
+ fro := (coos1,coos2,coos3);
+ tip := (coos4,coos5,coos6);
+ comm := "tdarrow(" & cstr(fro) & "," & cstr(tip) & ");";
+ tmpc := 0.5[fro,tip];
+ getready( comm, tmpc );
+ endfor;
+ doitnow;
+endfig;
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/thearchicon.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/thearchicon.mp
new file mode 100644
index 00000000000..3c9acb10391
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/thearchicon.mp
@@ -0,0 +1,59 @@
+% thearchicon.mp
+% L. Nobre G.
+% 2002
+
+%input featpost3Dplus2D;
+
+f := 0.8*(6,3,4);
+
+beginfig(1);
+ color tracecol, lockcol;
+ numeric altura, compri, radius, altfrac, comfrac, radang;
+ path theside, thefront, thelocka, thelockb, thelock;
+ color poi[];
+ numeric numpl, aux, i;
+ altura = 1;
+ compri = 2;
+ radius = 0.8;
+ altfrac = 0.2;
+ comfrac = 0.15;
+ radang = 37;
+ numpl = 9;
+ tracecol = blue;
+ lockcol = black;
+ currentpen := pencircle scaled 3mm;
+ drawoptions( withcolor tracecol );
+ rigorousdisc( 0, true, (-0.5compri,0,0), radius, (compri,0,0) );
+ poi1 = (0.5compri,-radius,0);
+ poi2 = (0.5compri,radius,0);
+ poi3 = (-0.5compri,radius,0);
+ poi4 = (0.5compri,-radius,-altura);
+ poi5 = (0.5compri,radius,-altura);
+ poi6 = (-0.5compri,radius,-altura);
+ theside = rp(poi1)--rp(poi2)--rp(poi5)--rp(poi4)--cycle;
+ thefront= rp(poi2)--rp(poi3)--rp(poi6)--rp(poi5)--cycle;
+ drawoptions( withcolor background );
+ fill theside;
+ fill thefront;
+ thelocka = rp((comfrac*compri,radius,-altfrac*altura))
+ --rp((comfrac*compri,radius,0));
+ thelockb = rp((-comfrac*compri,radius,-altfrac*altura))
+ --rp((-comfrac*compri,radius,0));
+ for i=1 upto numpl:
+ aux := i*radang/numpl;
+ poi7 := (comfrac*compri,radius*cosd(aux),radius*sind(aux));
+ poi8 := (-comfrac*compri,radius*cosd(aux),radius*sind(aux));
+ thelocka := thelocka...rp(poi7);
+ thelockb := thelockb...rp(poi8);
+ endfor;
+ thelock = thelocka--reverse thelockb--cycle;
+ drawoptions( withcolor lockcol );
+ filldraw thelock;
+ drawoptions( withcolor tracecol );
+ draw theside;
+ draw thefront;
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/thethreekindsofperspec.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/thethreekindsofperspec.mp
new file mode 100644
index 00000000000..3d9ffe9e0d1
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/thethreekindsofperspec.mp
@@ -0,0 +1,195 @@
+% thethreekindsofperspec.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+% bash: export TEX=latex
+% tcsh: setenv TEX latex
+
+f := (4,2,2.5);
+Spread := 45;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton,concmath,ccfonts}
+\begin{document}
+etex
+
+color psdf, psdu, psdv, rll, rlr, rur, rul, pll, plr, pur, pul;
+color pc;
+numeric projecplanesize, sizefraction, positfraction, aspectratio, rectsize;
+pen realpen, lightpen, projpen, dotpen;
+path projecplanepath, realpath;
+psdf = 3.1*(0,1,0.37);
+projecplanesize = 1.7;
+sizefraction = 0.19;
+positfraction = 0.65;
+aspectratio = 1.0;
+rectsize = 0.15;
+realpen = pencircle scaled 2.6pt;
+lightpen = pencircle scaled 0.55pt;
+projpen = pencircle scaled 1.8pt;
+dotpen = pencircle scaled 3.8pt;
+psdv = N( (-Y(psdf), X(psdf), 0) );
+psdu = ncrossprod( psdf, psdv );
+pll = projecplanesize*(-aspectratio*psdv-psdu);
+plr = projecplanesize*(+aspectratio*psdv-psdu);
+pur = projecplanesize*(+aspectratio*psdv+psdu);
+pul = projecplanesize*(-aspectratio*psdv+psdu);
+projecplanepath = rp(pll)--rp(plr)--rp(pur)--rp(pul)--cycle;
+pc = positfraction*psdf;
+rll = pc+sizefraction*projecplanesize*(-psdv-psdu);
+rlr = pc+sizefraction*projecplanesize*(+psdv-psdu);
+rur = pc+sizefraction*projecplanesize*(+psdv+psdu);
+rul = pc+sizefraction*projecplanesize*(-psdv+psdu);
+realpath = rp(rll)--rp(rlr)--rp(rur)--rp(rul)--cycle;
+
+beginfig(1);
+ draw projecplanepath withpen realpen;
+ draw realpath withpen realpen;
+ draw rp(psdf) withpen lightpen;
+ drawoptions( withpen lightpen );
+ squareangline( psdf, psdv, black, rectsize );
+ squareangline( psdf, psdu, black, rectsize );
+ drawoptions();
+ pair prll, prlr, prur, prul;
+ prll = rp(rll-pc);
+ prlr = rp(rlr-pc);
+ prur = rp(rur-pc);
+ prul = rp(rul-pc);
+ path projpath;
+ projpath = prll--prlr--prur--prul--cycle;
+ draw projpath withpen projpen;
+ draw prll--rp(rll+(1-positfraction)*psdf) withpen lightpen;
+ draw prlr--rp(rlr+(1-positfraction)*psdf) withpen lightpen;
+ draw prur--rp(rur+(1-positfraction)*psdf) withpen lightpen;
+ draw prul--rp(rul+(1-positfraction)*psdf) withpen lightpen;
+ draw rp(black)--rp(psdf) withpen lightpen;
+ draw rp(black) withpen dotpen;
+ draw rp(psdf) withpen dotpen;
+ label.rt( btex f etex, rp(psdf) );
+% label.bot( btex viewcentr etex, rp(black) );
+endfig;
+
+beginfig(2);
+ draw projecplanepath withpen realpen;
+ draw realpath withpen realpen;
+ draw rp(psdf) withpen lightpen;
+ drawoptions( withpen lightpen );
+ squareangline( psdf, psdv, black, rectsize );
+ squareangline( psdf, psdu, black, rectsize );
+ drawoptions();
+ pair prll, prlr, prur, prul;
+ LightSource:=psdf;
+ prll = rp(projectpoint(black,rll));
+ prlr = rp(projectpoint(black,rlr));
+ prur = rp(projectpoint(black,rur));
+ prul = rp(projectpoint(black,rul));
+ path projpath;
+ projpath = prll--prlr--prur--prul--cycle;
+ draw projpath withpen projpen;
+ draw prll--rp(psdf) withpen lightpen;
+ draw prlr--rp(psdf) withpen lightpen;
+ draw prur--rp(psdf) withpen lightpen;
+ draw prul--rp(psdf) withpen lightpen;
+ draw rp(black)--rp(psdf) withpen lightpen;
+ draw rp(black) withpen dotpen;
+ draw rp(psdf) withpen dotpen;
+ label.rt( btex f etex, rp(psdf) );
+ label.bot( btex viewcentr etex, rp(black) );
+endfig;
+
+beginfig(3);
+ draw projecplanepath withpen realpen;
+ draw realpath withpen realpen;
+ draw rp(psdf) withpen lightpen;
+ drawoptions( withpen lightpen );
+ squareangline( psdf, psdv, black, rectsize );
+ squareangline( psdf, psdu, black, rectsize );
+ numeric dist;
+ dist = conorm( psdf );
+ color ml, mt, mr, mb;
+ mb = 0.5[rll,rlr];
+ ml = 0.5[rll,rul];
+ mr = 0.5[rur,rlr];
+ mt = 0.5[rur,rul];
+ drawoptions( withpen projpen );
+ angline( rll, mb, psdf, dist, "", top );
+ angline( rll, ml, psdf, dist, "", top );
+ angline( rur, mt, psdf, dist, "", top );
+ angline( rur, mr, psdf, dist, "", top );
+ angline( mb, rlr, psdf, dist, "", top );
+ angline( ml, rul, psdf, dist, "", top );
+ angline( mr, rlr, psdf, dist, "", top );
+ angline( mt, rul, psdf, dist, "", top );
+ angline( black, mb, psdf, dist, "", top );
+ angline( black, ml, psdf, dist, "", top );
+ angline( black, mr, psdf, dist, "", top );
+ angline( black, mt, psdf, dist, "", top );
+ drawoptions();
+ numeric marc, darc, dmarc, ddarc;
+ marc = 0.01745*getangle(-psdf,mt-psdf)*dist;
+ darc = 0.01745*getangle(-psdf,rll-psdf)*dist*0.707;
+ color pro[], esf[], proc[], esfc[];
+ pro1 = darc*(-psdv-psdu);
+ pro2 = marc*(-psdu);
+ pro3 = darc*(+psdv-psdu);
+ pro4 = marc*(+psdv);
+ pro5 = darc*(+psdv+psdu);
+ pro6 = marc*(+psdu);
+ pro7 = darc*(-psdv+psdu);
+ pro8 = marc*(-psdv);
+ esf1 = psdf+dist*N(rll-psdf);
+ esf2 = psdf+dist*N(mb-psdf);
+ esf3 = psdf+dist*N(rlr-psdf);
+ esf4 = psdf+dist*N(mr-psdf);
+ esf5 = psdf+dist*N(rur-psdf);
+ esf6 = psdf+dist*N(mt-psdf);
+ esf7 = psdf+dist*N(rul-psdf);
+ esf8 = psdf+dist*N(ml-psdf);
+ ddarc = conorm(pro1-esf1)/3;
+ dmarc = conorm(pro2-esf2)/3;
+ proc1 = pro1+ddarc*N(psdf);
+ proc2 = pro2+dmarc*N(psdf);
+ proc3 = pro3+ddarc*N(psdf);
+ proc4 = pro4+dmarc*N(psdf);
+ proc5 = pro5+ddarc*N(psdf);
+ proc6 = pro6+dmarc*N(psdf);
+ proc7 = pro7+ddarc*N(psdf);
+ proc8 = pro8+dmarc*N(psdf);
+ esfc1 = esf1+ddarc*N(rll-psdf);
+ esfc2 = esf2+dmarc*N(mb-psdf);
+ esfc3 = esf3+ddarc*N(rlr-psdf);
+ esfc4 = esf4+dmarc*N(mr-psdf);
+ esfc5 = esf5+ddarc*N(rur-psdf);
+ esfc6 = esf6+dmarc*N(mt-psdf);
+ esfc7 = esf7+ddarc*N(rul-psdf);
+ esfc8 = esf8+dmarc*N(ml-psdf);
+ numeric i;
+ drawoptions( withpen lightpen );
+ for i=1 upto 8:
+ draw rp(esf[i])..controls rp(esfc[i]) and rp(proc[i])..rp(pro[i]);
+ draw rp(psdf)--rp(esf[i]);
+ endfor;
+ draw rp(pro2)--rp(pro6);
+ draw rp(pro4)--rp(pro8);
+ draw rp(mb)--rp(mt);
+ draw rp(ml)--rp(mr);
+ drawoptions( withpen projpen );
+ draw rp(pro1)...rp(pro2)..rp(pro3);
+ draw rp(pro3)...rp(pro4)..rp(pro5);
+ draw rp(pro5)...rp(pro6)..rp(pro7);
+ draw rp(pro7)...rp(pro8)..rp(pro1);
+ draw rp(black)--rp(psdf) withpen lightpen;
+ draw rp(black) withpen dotpen;
+ draw rp(psdf) withpen dotpen;
+ label.rt( btex f etex, rp(psdf) );
+% label.ulft( btex viewcentr etex, rp(black) );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end; \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/torus.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/torus.mp
new file mode 100644
index 00000000000..e629e85823a
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/torus.mp
@@ -0,0 +1,297 @@
+% torus
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+% Draw a torus with NP dots, a section of 3.14*RS^2
+% and a total diameter of 2*(RB+RS). The dots are placed
+% on a single closed line that turns around the $z$ axis
+% NB times and around the section NS times.
+% figure(1) exemplifies the use of signalvertex.
+
+def flask( expr TheVal ) =
+ begingroup
+ numeric RB, RS, RP, NB, NS, NM, phi, theta, first, second, third;
+ RB=1;
+ RS=0.3;
+ RP=0.02;
+ NB=8;
+ NS=5;
+ NM=4;
+ theta=360*NB*TheVal;
+ phi=360*NS*TheVal;
+ first =(RB+(RS+RP*sind(NM*theta))*cosd(phi))*cosd(theta);
+ second=(RB+(RS+RP*sind(NM*theta))*cosd(phi))*sind(theta);
+ third = (RS+RP*sind(NM*theta))*sind(phi);
+ ( (first,second,third) )
+ endgroup
+enddef;
+
+def blask( expr TheVal ) =
+ begingroup
+ numeric RB, RS, NB, NS, phi, theta, first, second, third;
+ RB=1;
+ RS=0.1;
+ NB=1;
+ NS=24;
+ theta=360*NB*TheVal;
+ phi=360*NS*TheVal;
+ first =(RB+RS*cosd(phi))*cosd(theta);
+ second=(RB+RS*cosd(phi))*sind(theta);
+ third = RS*sind(phi);
+ ( (first,second,third) )
+ endgroup
+enddef;
+
+beginfig(5);
+ Spread := 200;
+ numeric NP, i, varfrac;
+ path cl;
+ string comm;
+ pen bip, sp;
+ varfrac = 1.25;
+ bip = pencircle scaled 15pt;
+ sp = pencircle scaled 9pt;
+ NP=600;
+ cl = for i=1 upto NP: rp(flask(i/NP)).. endfor cycle;
+ draw cl;
+ for i=1 upto NP:
+ comm:="draw subpath ("
+ & decimal(i-0.5)
+ & ","
+ & decimal(i+0.5)
+ & ") of cl withpen bip; undraw subpath ("
+ & decimal(i-varfrac)
+ & ","
+ & decimal(i+varfrac)
+ & ") of cl withpen sp;";
+ getready( comm, flask( i/NP ) );
+ endfor;
+ closedline( true, 300, 0.5, 1 )( blask );
+ doitnow;
+endfig;
+
+beginfig(6);
+ Spread := 100;
+ f := (7,3,9);
+ HoriZon := -2;
+ LightSource := (1,-1,15);
+ numeric sinthe, costhe, ux, uz, lx, lz, co, i;
+ costhe = (4*sqrt(5)-sqrt(3))/11;
+ sinthe = sqrt(1-(costhe**2));
+ ux = costhe*sqrt(2)/2;
+ uz = sinthe/2;
+ lx = sqrt(4/3)*sinthe;
+ lz = -sqrt(2/3)*costhe;
+ co = sqrt(2)*(2*sqrt(5)+5*sqrt(3))/22;
+ V1 := (ux,0,-uz);
+ V2 := (lx,0,-lz);
+ V3 := (0,ux,uz); V15:= (0,-ux,uz);
+ V4 := (0,lx,lz); V16:= (0,-lx,lz);
+ V5 := (co,co,0); V14:= (-co,-co,0);
+ V6 := (-ux,0,-uz);
+ V7 := (-lx,0,-lz);
+ V8 := (-co,co,0); V13:= (co,-co,0);
+ V9 := improvertex( V5, 1, V4, 1, V3, sqrt(3)-1, (0,1,0) );
+ V10:= (-X(V9),-Y(V9),Z(V9));
+ V11:= (Y(V9),-X(V9),-Z(V9));
+ V12:= (-Y(V9),X(V9),-Z(V9));
+ makeface1(1,2,3);
+ makeface2(1,2,5);
+ makeface3(2,3,5);
+ makeface4(9,4,5);
+ makeface5(3,4,1);
+ makeface6(1,4,5);
+ makeface7(3,6,7);
+ makeface8(3,7,8);
+ makeface9(6,7,8);
+ makeface10(9,8,4);
+ makeface11(4,6,8);
+ makeface12(3,4,6);
+ makeface13(3,5,9);
+ makeface14(3,8,9);
+ makeface15(7,8,12);
+ makeface16(7,14,12);
+ makeface17(6,8,12);
+ makeface18(6,14,12);
+ makeface19(2,5,11);
+ makeface20(2,13,11);
+ makeface21(1,5,11);
+ makeface22(1,13,11);
+ makeface23(10,15,13);
+ makeface24(10,15,14);
+ makeface25(10,16,13);
+ makeface26(10,16,14);
+ makeface27(2,1,15);
+ makeface28(6,7,15);
+ makeface29(13,15,2);
+ makeface30(14,15,7);
+ makeface31(16,1,15);
+ makeface32(16,6,15);
+ for i=1 upto 32:
+ FC[i] := TableColors;
+ FCD[i]:= true;
+ endfor;
+ ShadowOn := true;
+ setthearena(15,6);
+ fill_faces();
+ draw_invisible( false, false, TableC3, TableC0 );
+% drawoptions( withcolor red );
+% for i=1 upto 16:
+% label.bot( decimal( i ), rp( V[i] ) );
+% endfor;
+endfig;
+
+beginfig(1);
+ Spread := 140;
+ NP:=2000;
+ RB:=1;
+ RS:=0.2;
+ R3:=0.1;
+ NB:=8;
+ NS:=5;
+ jB:=360*NB/NP;
+ jS:=360*NS/NP;
+ for i=1 upto NP:
+ phi :=i*jS;
+ theta :=i*jB;
+ first :=(RB+(RS+R3*sind(4*theta))*cosd(phi))*cosd(theta);
+ second:=(RB+(RS+R3*sind(4*theta))*cosd(phi))*sind(theta);
+ third := (RS+R3*sind(4*theta))*sind(phi);
+ signalvertex( (first,second,third), 1, black );
+ endfor;
+endfig;
+
+% Draw a torus with faces.
+
+beginfig(2);
+
+ PrintStep := 7;
+
+ f := ( 3,1,1 );
+
+ RB:=1;
+ RS:=0.25;
+ NB:=3;
+ NS:=5;
+ jB:=360/NB;
+ jS:=360/NS;
+ iS:=jS;
+ iB:=jB;
+ counter:=0;
+ for i=1 upto NB:
+ for j=1 upto NS:
+ counter := incr(counter);
+ npf[counter]:= 4;
+ phi :=j*jS;
+ theta:=i*jB;
+ f1 :=(RB+(RS)*cosd(phi))*cosd(theta);
+ s1 :=(RB+(RS)*cosd(phi))*sind(theta);
+ t1 := (RS)*sind(phi);
+ F[counter]p[1]:=(f1,s1,t1);
+ f2 :=(RB+(RS)*cosd(phi))*cosd(theta+iB);
+ s2 :=(RB+(RS)*cosd(phi))*sind(theta+iB);
+ t2 := (RS)*sind(phi);
+ F[counter]p[2]:=(f2,s2,t2);
+ f3 :=(RB+(RS)*cosd(phi+iS))*cosd(theta+iB);
+ s3 :=(RB+(RS)*cosd(phi+iS))*sind(theta+iB);
+ t3 := (RS)*sind(phi+iS);
+ F[counter]p[3]:=(f3,s3,t3);
+ f4 :=(RB+(RS)*cosd(phi+iS))*cosd(theta);
+ s4 :=(RB+(RS)*cosd(phi+iS))*sind(theta);
+ t4 := (RS)*sind(phi+iS);
+ F[counter]p[4]:=(f4,s4,t4);
+ endfor;
+ endfor;
+ NF:=counter;
+% faceraytrace(0.3, blue);
+% draw_all_test(false);
+ sharpraytrace;
+endfig;
+
+beginfig(3);
+ f := (6,2,4);
+% f := (6,2,7); % NO CUSP.
+ Spread:=70;
+ HoriZon := -2;
+ ShadowOn := true;
+ numeric bigray, smaray, angstep;
+ color toruscenter, torusmoment, nearaxe, sideaxe, viewline;
+ color circlecenter, circlemoment;
+ numeric ang, ind, i, anglim;
+ path cpath, apath, opath, ipath, wp, ep;
+ pair outerp[], innerp[], refpair;
+ pen markpen;
+ boolean cuspcond;
+ picture holepic;
+ markpen = pencircle scaled 5pt;
+ pickup markpen;
+ bigray = 2;
+ smaray = 1;
+ angstep= 2;
+ toruscenter = black;
+ torusmoment = (0,1,2);
+ refpair = unitvector( rp(toruscenter+torusmoment)-rp(toruscenter) );
+ viewline = f-toruscenter;
+ ind = 0;
+ sideaxe = bigray*ncrossprod( torusmoment, viewline );
+ nearaxe = bigray*ncrossprod( sideaxe, torusmoment );
+ anglim = 0.5*angstep-180;
+ if ShadowOn:
+ for ang=anglim step angstep until -anglim:
+ circlecenter:= nearaxe*cosd(ang)+sideaxe*sind(ang);
+ circlemoment:=-nearaxe*sind(ang)+sideaxe*cosd(ang);
+ filldraw circleshadowpath(circlecenter,circlemoment,smaray);
+ endfor;
+ fi;
+ for ang=anglim step angstep until -anglim:
+ ind := incr( ind );
+ circlecenter:= nearaxe*cosd(ang)+sideaxe*sind(ang);
+ circlemoment:=-nearaxe*sind(ang)+sideaxe*cosd(ang);
+ cpath:=spatialhalfcircle(circlecenter,circlemoment,smaray,true);
+ if ang>=0:
+ outerp[ind]=point 0 of cpath;
+ innerp[ind]=point (length cpath) of cpath;
+ elseif ang<0:
+ innerp[ind]=point 0 of cpath;
+ outerp[ind]=point (length cpath) of cpath;
+ fi;
+ endfor;
+ opath = for i=1 upto ind: outerp[i].. endfor cycle;
+ ipath = for i=1 upto ind: innerp[i].. endfor cycle;
+ holepic = currentpicture;
+ clip holepic to ipath;
+ unfill opath;
+ draw holepic;
+ draw opath withcolor green;
+ draw ipath withcolor red;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Perhaps there is an analytic way of getting the angle of the cusp point? %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ i := ceiling(1+180/angstep);
+ forever:
+ i := incr( i );
+ cuspcond := refpair dotprod innerp[i+1] < refpair dotprod innerp[i];
+ exitif cuspcond or ( i > ind-1 );
+ endfor;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ ep = outerp[ind-i]--innerp[ind-i];
+ wp = innerp[i]--outerp[i];
+ unfill buildcycle(opath,ep,reverse ipath,wp);
+ draw opath withcolor green;
+ draw subpath (i,ind-i) of ipath withcolor red;
+endfig;
+
+beginfig(4);
+ f := (16,2,3.8);
+ Spread:=40;
+ pickup pencircle scaled 3pt;
+ smoothtorus( black-3*blue, blue, 4, 1 );
+ smoothtorus( black, blue, 4, 1 );
+ smoothtorus( black+3*blue, blue, 4, 1 );
+endfig;
+
+end.
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/trajectoryline.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/trajectoryline.mp
new file mode 100644
index 00000000000..30fe6235713
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/trajectoryline.mp
@@ -0,0 +1,88 @@
+% trajectoryline.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+Spread := 30;
+f := (10,0,0);
+
+color posa, posb, axer;
+numeric kfac, refrad;
+posa = -5*green;
+posb = 5*green;
+axer = blue;
+kfac = 2.5;
+refrad = 1;
+
+def vecfunc( expr posit )=
+ begingroup
+ save modula, modulb, field;
+ color field;
+ numeric modula, modulb;
+ modula = conorm( posit-posa );
+ modulb = conorm( posit-posb );
+ field = ( posit-posa )/(modula**3)+kfac*( posit-posb )/(modulb**3);
+ ( -field )
+ endgroup
+enddef;
+
+def magfunc( expr posit )=
+ begingroup
+ save perpd, refvec, dist;
+ color perpd, refvec;
+ numeric dist;
+ perpd = ccrossprod( axer, posit );
+ refvec = posit - refrad*ncrossprod( perpd, axer );
+ dist = conorm( refvec );
+ ( ncrossprod( refvec, perpd )/(dist**2) )
+ endgroup
+enddef;
+
+beginfig(1);
+ numeric i, lena, numa, sa, diffstep, ray;
+ color stp, svl;
+ path oneline;
+ pen grossa, fina;
+ grossa = pencircle scaled 3pt;
+ fina = pencircle scaled 2pt;
+ lena = 400;
+ numa = 58;
+ diffstep = 0.12;
+ ray = 3.5;
+ sa = 168;
+ for i=sa step numa until (180):
+ stp := ( 0, ray*cosd(i), ray*sind(i) );
+ svl := N( -stp );
+ oneline := trajectorypath( lena, stp, svl, diffstep, vecfunc );
+ draw oneline withpen grossa;
+ draw oneline withpen fina withcolor background;
+ endfor;
+ draw rp(posa) withpen grossa;
+ draw rp(posb) withpen grossa;
+endfig;
+
+beginfig(2);
+ numeric i, lena, numa, sa, diffstep, ray;
+ color stp, svl;
+ path oneline;
+ pen grossa, fina;
+ grossa = pencircle scaled 3pt;
+ fina = pencircle scaled 2pt;
+ lena = 100;
+ numa = 4;
+ diffstep = 1;
+ ray = 5.5;
+ sa = 97;
+ for i=sa step numa until (120):
+ stp := ( 0, ray*cosd(i), ray*sind(i) );
+ svl := 0.8*N( -stp );
+ oneline := magnetictrajectorypath( lena, stp, svl, diffstep, magfunc );
+ draw oneline withpen grossa;
+ draw oneline withpen fina withcolor background;
+ endfor;
+ draw rp(black) withpen grossa;
+endfig;
+
+end.
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/triangulartrimesh.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/triangulartrimesh.mp
new file mode 100644
index 00000000000..1a19c776976
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/triangulartrimesh.mp
@@ -0,0 +1,39 @@
+% triangulartrimesh.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+def zsurface( expr xc, yc ) =
+ cosd(xc*57)*cosd(yc*57)+4*mexp(-(xc**2+yc**2)*6.4)
+enddef;
+
+f := 16*(4,1,1);
+Spread := 35;
+LightSource := 10*(4,-3,4);
+defaultfont := "cmvtt10";
+beginfig(1);
+ numeric np, ssize, lx, ly, topl, ystep, i, zl;
+ string L[];
+ L0 = "P";
+ L1 = "H";
+ L2 = "Y";
+ L3 = "S";
+ L4 = "I";
+ L5 = "C";
+ L6 = "S";
+ np = 72;
+ ssize = 15;
+ ly = -0.5*ssize;
+ lx = -sqrt(3)*ssize/6;
+ ystep = ssize/7;
+ topl = 2*zsurface( 0, 0 );
+ for i=0 upto 6:
+ zl := zsurface(lx,i*ystep+ly);
+ labelinspace(false,(lx,i*ystep+ly,zl),green*ystep,blue*(topl-zl),L[i]);
+ endfor;
+ hexagonaltrimesh( false,np,ssize,zsurface);
+ label.ulft("matagalatlante.org",lrcorner currentpicture);
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/tropicalglobe.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/tropicalglobe.mp
new file mode 100644
index 00000000000..e861c8c4462
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/tropicalglobe.mp
@@ -0,0 +1,23 @@
+% tropicalglobe.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ numeric radius, numc;
+ pen thickp;
+
+ f := (3,0,2);
+ viewcentr := 0.5*(1,1,1);
+ Spread := 20;
+ radius = 1;
+ numc = 18;
+ thickp = pencircle scaled 1mm;
+
+ drawoptions( withpen thickp );
+ tropicalglobe( numc, black, radius, blue );
+ produce_auto_scale;
+endfig;
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/tshirtfig.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/tshirtfig.mp
new file mode 100644
index 00000000000..3873ab3c1fa
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/tshirtfig.mp
@@ -0,0 +1,39 @@
+% tshirtfig.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ f := (5,4,3);
+ Spread := 70;
+ pickup pencircle scaled 2.4pt;
+ numeric gridstep, cylength, cyradius, numcylis;
+ numeric i, j, curcoord, curangle, curnorma, tmp;
+ numeric othcoord, othangle, zcoord, coef, othnorma;
+ color base, lenvec;
+ cylength := 0.2;
+ cyradius := 0.3;
+ gridstep := cyradius*2.2;
+ numcylis := 7;
+ coef := 0.22;
+ for i=1 upto numcylis: % saddle
+ curnorma := i-0.5*(numcylis+1);
+ curcoord := curnorma*gridstep;
+ curangle := -curcoord*2*coef;
+ for j=1 upto numcylis:
+ othnorma := j-0.5*(numcylis+1);
+ othcoord := othnorma*gridstep;
+ othangle := othcoord*2*coef;
+ zcoord:=coef*(othcoord**2-curcoord**2);
+ base := (curcoord,othcoord,zcoord);
+ lenvec := cylength*N((-curangle,-othangle,1));
+ tmp := zcoord/2.4+0.8;
+ if tmp > 1: show tmp; fi;
+ background := tmp*TableC2;
+ rigorousdisc( 0, true,base,cyradius,lenvec);
+ endfor;
+ endfor;
+endfig;
+
+end. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/tuftescatter.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/tuftescatter.mp
new file mode 100644
index 00000000000..2df874ec1dc
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/tuftescatter.mp
@@ -0,0 +1,83 @@
+% tuftescatter.mp
+% L. Nobre G.
+% IYP (2005)
+
+% input featpost3Dplus2D;
+
+def linscatter = uniformdeviate( 2 ) - 1 enddef;
+
+def fullcalculator =
+ begingroup
+ color aux;
+ numeric cx, cy;
+ forever:
+ cx := linscatter;
+ cy := linscatter;
+ exitif cx ++ cy < 0.8; % Saddle ray
+ endfor;
+ aux = ( cx, cy, cx*cx-cy*cy );
+ ( eulerrotation( -25, -15, -5, aux ) ) % Rotation angles
+ endgroup
+enddef;
+
+beginfig(1);
+ numeric totalnum, classnum, sparksiz, pointray;
+ totalnum = 350; % Number of data points
+ classnum = 30; % Number of sparkline classes
+ sparksiz = 0.34; % Maximum sparkline height
+ pointray = 0.025; % Size of the data points
+ f := ( 7, 6, 5 );
+ Spread := 150;
+ numeric i, j, k, l, hx[], hy[], hz[], classtep;
+ classtep = 2/classnum;
+ color tmp;
+ for j=0 upto classnum:
+ hx[j] = 0;
+ hy[j] = 0;
+ hz[j] = 0;
+ endfor;
+ for l=1 upto totalnum:
+ tmp := fullcalculator;
+ for k=1 upto classnum:
+ if ( X(tmp) <= k*classtep-1 ) and ( X(tmp) > (k-1)*classtep-1 ):
+ hx[k] := incr( hx[k] );
+ fi;
+ if ( Y(tmp) <= k*classtep-1 ) and ( Y(tmp) > (k-1)*classtep-1 ):
+ hy[k] := incr( hy[k] );
+ fi;
+ if ( Z(tmp) <= k*classtep-1 ) and ( Z(tmp) > (k-1)*classtep-1 ):
+ hz[k] := incr( hz[k] );
+ fi;
+ endfor;
+ draw rigorouscircle( (-1,Y(tmp),Z(tmp)), red, pointray );
+ draw rigorouscircle( (X(tmp),-1,Z(tmp)), green, pointray );
+ draw rigorouscircle( (X(tmp),Y(tmp),-1), blue, pointray );
+ getready("fill rigorousfearpath("
+ & cstr( tmp )
+ & ",pointray) withcolor blue; draw rigorousfearpath("
+ & cstr( tmp )
+ & ",pointray); ", tmp);
+ endfor;
+ numeric maxn, sparkfac;
+ maxn = 0;
+ for i=1 upto classnum:
+ if hx[i]>maxn: maxn := hx[i]; fi;
+ if hy[i]>maxn: maxn := hy[i]; fi;
+ if hz[i]>maxn: maxn := hz[i]; fi;
+ endfor;
+ sparkfac = sparksiz/maxn;
+ for j=1 upto classnum:
+ draw rp(((j-1)*classtep-1,1+sparkfac*hx[j-1],-1))
+ --rp(((j-1)*classtep-1,1+sparkfac*hx[j],-1))
+ --rp((j*classtep-1,1+sparkfac*hx[j],-1));
+ draw rp((-1,(j-1)*classtep-1,1+sparkfac*hy[j-1]))
+ --rp((-1,(j-1)*classtep-1,1+sparkfac*hy[j]))
+ --rp((-1,j*classtep-1,1+sparkfac*hy[j]));
+ draw rp((-1,1+sparkfac*hz[j-1],(j-1)*classtep-1))
+ --rp((-1,1+sparkfac*hz[j],(j-1)*classtep-1))
+ --rp((-1,1+sparkfac*hz[j],j*classtep-1));
+ endfor;
+ doitnow;
+endfig;
+
+end. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/twistflat.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/twistflat.mp
new file mode 100644
index 00000000000..080f3364282
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/twistflat.mp
@@ -0,0 +1,55 @@
+% twistflat.mp
+% L. Nobre G.
+% Y2K
+
+%input featpost3Dplus2D;
+
+
+
+beginfig(1);
+
+ f := 0.7*(1.5,0.3,1.2);
+
+ Spread := 700;
+
+ color gridvec, sizevec, currpos, starpos, bordpos;
+ numeric i, j, k, counter, theta, phi, thetamin,
+ thetamax, thetastp, long, base;
+ sizevec := (11,6,1);
+ gridvec := (0.05,0.1,0.1);
+ thetamin := 55;
+ thetamax := 125;
+ long := 0.08;
+ base := 0.1;
+ thetastp := (thetamax-thetamin)/(X(sizevec)-1);
+ starpos := ( -0.5*X(gridvec)*(X(sizevec)-1) ,
+ -0.5*Y(gridvec)*(Y(sizevec)-1) ,
+ -0.5*Z(gridvec)*(Z(sizevec)-1) );
+ bordpos := starpos - 0.5*gridvec;
+ npf1 := 4;
+ F1p1 := bordpos;
+ F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
+ F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
+ NF := 1;
+ draw facepath(1);
+ counter := 1;
+ for i=1 upto X(sizevec):
+ for j=1 upto Y(sizevec):
+ for k=1 upto Z(sizevec):
+ phi := 90;
+ theta := thetamin+(i-1)*thetastp;
+ currpos := starpos+( (i-1)*X(gridvec) ,
+ (j-1)*Y(gridvec) ,
+ (k-1)*Z(gridvec) );
+ generatedirline( counter, phi, theta, long, currpos );
+ counter := incr(counter);
+ endfor;
+ endfor;
+ endfor;
+ NL := decr(counter);
+ director_invisible( true, base, false );
+endfig;
+
+end;
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/twoholes.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/twoholes.mp
new file mode 100644
index 00000000000..07cf6c31964
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/twoholes.mp
@@ -0,0 +1,31 @@
+% twoholes.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3Dplus2D;
+
+f := 1.5*(0,1.5,1);
+Spread := 100;
+
+beginfig(1);
+ numeric stagelevel, holediam, outerdiam, stagemargin;
+ numeric numberofstagesidesquares, stagesidesize;
+ numeric centercoord;
+ color centerposdisc, centerpostorus;
+ stagelevel = 0.2;
+ holediam = 0.6;
+ stagemargin = 0.2;
+ numberofstagesidesquares = 20;
+ outerdiam = holediam+4*stagelevel;
+ stagesidesize = 2*( outerdiam + stagemargin );
+ centercoord = 0.3535*outerdiam;
+ HoriZon := -stagelevel;
+ centerpostorus = ( centercoord, -centercoord, 0 );
+ centerposdisc = ( -centercoord, centercoord, HoriZon );
+ setthestage( numberofstagesidesquares, stagesidesize );
+ smoothtorus( centerpostorus, blue,
+ 0.5*holediam+stagelevel, stagelevel );
+ rigorousdisc( 0.5*holediam, true, centerposdisc,
+ 0.5*outerdiam, 1.5*stagelevel*blue );
+endfig;
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/unperfection.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/unperfection.mp
new file mode 100644
index 00000000000..0e95bc05451
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/unperfection.mp
@@ -0,0 +1,59 @@
+% unperfection.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+Spread := 70;
+f := (10,4,5);
+
+beginfig(1);
+ numeric i, len, polelen;
+ numeric fws, NumLines, linex, inray, outay, axray;
+ numeric wang, poleray;
+ path aro[], oneline;
+ color axe, pole, polec, aroc;
+ picture floorwall;
+ len := 0.6;
+ wang := 60;
+ axe := (0,cosd(90-wang),sind(90-wang));
+ pole := (0,1,0);
+ fws := 4;
+ polelen := 0.8*fws;
+ outay := 0.45*fws;
+ inray := 0.7*outay;
+ poleray := 0.07*inray;
+ NumLines := 30;
+ for i=0 upto NumLines:
+ linex := fws*(i/NumLines-0.5);
+ oneline := rp((linex,0.5*fws,-0.5*fws))
+ --rp((linex,-0.5*fws,-0.5*fws))
+ --rp((linex,-0.5*fws,0.5*fws));
+ draw oneline withcolor (0.7*background);
+ endfor;
+ aroc := outay*(0,cosd(wang),sind(wang))-0.5*(0,fws,fws);
+ polec := (0,(outay-inray)*cosd(wang)-fws/2,
+ (outay+inray)*sind(wang)-poleray-fws/2);
+ aro1 := goodcirclepath( aroc, axe, inray );
+ aro2 := goodcirclepath( aroc+len*axe, axe, inray );
+ aro3 := buildcycle( aro1, aro2 );
+ floorwall := currentpicture;
+ clip floorwall to aro3;
+ aro4 := spatialhalfcircle( aroc+len*axe, axe, inray, false );
+ aro5 := spatialhalfcircle( aroc+len*axe, axe, outay, false );
+ aro6 := reverse aro5;
+ aro7 := aro4--aro6--cycle;
+ fill aro7 withcolor (0.6*background);
+ rigorousdisc( 0, true, aroc, inray, axe*len );
+ draw floorwall;
+ draw aro3;
+ rigorousdisc( 0, true, polec, poleray, pole*polelen );
+ aro8 := spatialhalfcircle( aroc+len*axe, axe, inray, true );
+ aro9 := spatialhalfcircle( aroc+len*axe, axe, outay, true );
+ aro10 := reverse aro9;
+ aro11 := aro8--aro10--cycle;
+ fill aro11 withcolor (0.6*background);
+ rigorousdisc( 0, false, aroc, outay, axe*len );
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/unperfectionremoved.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/unperfectionremoved.mp
new file mode 100644
index 00000000000..1829b9e7787
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/unperfectionremoved.mp
@@ -0,0 +1,34 @@
+% unperfectionremoved.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+Spread := 70;
+f := (13,4,3);
+
+beginfig(1);
+ numeric i, len;
+ numeric fws, NumLines, linex, inray, outay, axray;
+ numeric wang;
+ path oneline;
+ color axe, aroc;
+ len := 0.6;
+ wang := 60;
+ axe := (0,cosd(90-wang),sind(90-wang));
+ fws := 4;
+ outay := 0.45*fws;
+ inray := 0.7*outay;
+ NumLines := 30;
+ for i=0 upto NumLines:
+ linex := fws*(i/NumLines-0.5);
+ oneline := rp((linex,0.5*fws,-0.5*fws))
+ --rp((linex,-0.5*fws,-0.5*fws))
+ --rp((linex,-0.5*fws,0.5*fws));
+ draw oneline withcolor (0.7*background);
+ endfor;
+ aroc := outay*(0,cosd(wang),sind(wang))-0.5*(0,fws,fws);
+ rigorousdisc( inray, true, aroc, outay, axe*len );
+endfig;
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/vanallenbelt.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/vanallenbelt.mp
new file mode 100644
index 00000000000..83c636ab380
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/vanallenbelt.mp
@@ -0,0 +1,51 @@
+% vanallenbelt.mp
+% L. Nobre G.
+% 2004
+
+% input featpost3Dplus2D;
+
+def magnfield( expr pos ) =
+ begingroup
+ save dist, anga, angb, angp, bv, bh, br, bx, by, bz, fin;
+ numeric dist, anga, angb, bv, bh, br, bx, by, bz;
+ pair angp;
+ color fin;
+ dist = conorm( pos );
+ angp = getanglepair( pos );
+ anga = xpart( angp );
+ angb = ypart( angp );
+ bh = 0.5*cosd( angb )/dist**3;
+ bv = sind( angb )/dist**3;
+ br = bv*cosd( angb ) - bh*sind( angb );
+ bz = bv*sind( angb ) + bh*cosd( angb );
+ bx = br*cosd( anga );
+ by = br*sind( anga );
+ fin = ( bx, by, bz );
+ ( 25*fin )
+ endgroup
+enddef;
+
+def pmf( expr pos ) =
+ (2*red/(((greenpart pos) ++ (bluepart pos))**2))
+enddef;
+
+beginfig(1);
+ color vel;
+ vel = 1.1*(-0.25,0.0,0.1);
+ cartaxes(1,1,1);
+ draw magnetictrajectorypath(200, red, vel, 0.22, magnfield );
+% draw magnetictrajectorypath(400, red,-vel, 0.22, magnfield );
+endfig;
+
+beginfig(2);
+ f := 2*red;
+ Spread := 200;
+ numeric ang;
+ color vel;
+ ang = 145;
+ vel = 0.8*( 0, cosd( ang ), sind( ang ) );
+ draw magnetictrajectorypath(200, green, vel, 0.1, pmf );
+ drawarrow reverse (rp(blue)--rp(black)--rp(green));
+endfig;
+
+end. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/verygoodcone.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/verygoodcone.mp
new file mode 100644
index 00000000000..8ce59552a21
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/verygoodcone.mp
@@ -0,0 +1,28 @@
+% verygoodcone.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3Dplus2D;
+
+beginfig(1);
+ numeric radiusin, fac, i, numc, stepang, xcoor, ycoor, radc;
+
+ f := (5,0.3,1.5);
+ Spread := 70;
+ radiusin = 0.3;
+ numc = 9;
+ fac = 3;
+ stepang = 360/numc;
+ radc = (fac-1)*radiusin*sind(0.5*stepang);
+
+ for i=0 step stepang until 180:
+ xcoor := -radiusin*cosd(i);
+ ycoor := radiusin*sind(i);
+verygoodcone(true,fac*(xcoor,-ycoor,0),(-xcoor,ycoor,0),radc,(xcoor,-ycoor,0));
+verygoodcone(true,fac*(xcoor,ycoor,0),-(xcoor,ycoor,0),radc,(xcoor,ycoor,0));
+ endfor;
+endfig;
+
+end;
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/standard/xraycamera.mp b/Master/texmf-dist/doc/metapost/featpost/example/standard/xraycamera.mp
new file mode 100644
index 00000000000..b3f6e51c6de
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/standard/xraycamera.mp
@@ -0,0 +1,117 @@
+% xraycamera.mp
+% L. Nobre G.
+% IYP (2005)
+
+%input featpost3Dplus2D;
+
+verbatimtex
+\documentclass{article}
+\usepackage{beton}
+\usepackage{concmath}
+\usepackage{ccfonts}
+\begin{document}
+etex
+
+beginfig(1);
+ f := (10,7,8);
+ Spread := 45;
+ numeric w, h, l, d, t, tr, tl, ma, mb, we, ar;
+ w = 3;
+ h = 2;
+ l = 4;
+ d = 0.75;
+ t = 1.2;
+ tr= 0.15;
+ tl= 0.25;
+ ma= 0.3;
+ mb= 0.2;
+ ar= 2;
+ we= 0.6*(h-t);
+ pen thin, thick, aver;
+ thin = pencircle scaled 0.5pt;
+ thick= pencircle scaled 1.5pt;
+ aver = pencircle scaled 1.0pt;
+ ahlength:=2mm;
+ ahangle:=30;
+ color p[];
+ p1 = (0,w/2,-ma-mb);
+ p2 = (0,w/2,-ma);
+ p3 = (0,w/2,0);
+ p4 = (0,w/2,h);
+ p5 = (0,-w/2,-ma-mb);
+ p6 = (0,-w/2,-ma);
+ p7 = (0,-w/2,0);
+ p8 = (0,-w/2,h);
+ p9 = (0,-w/2-ma-mb,0);
+ p10= (0,-w/2-ma,0);
+ p11= (0,-w/2-ma-mb,h);
+ p12= (0,-w/2-ma,h);
+ p13= (-l,-w/2-ma-mb,h);
+ p14= (-l,-w/2-ma,h);
+ p15= (-l,-w/2,h);
+ p16= (-l,-w/2,0);
+ p17= (-l,w/2,0);
+ p18= (-l,w/2,h);
+ p19= (-l+d,0,0);
+ p20= (-l+d,0,t);
+ p21= (-l-ma,0,t);
+ p22= (-l-ma-mb,0,t);
+ p23= (-l-ma,0,0);
+ p24= (-l-ma-mb,0,0);
+ p25= (-l+d,w/2+ma,0);
+ p26= (-l+d,w/2+ma+mb,0);
+ p27= (-l,w/2+ma,0);
+ p28= (-l,w/2+ma+mb,0);
+ p29= 0.5[p2,p6];
+ p30= 0.5[p10,p12];
+ p31= 0.5[p12,p14];
+ p32= 0.5[p21,p23];
+ p33= 0.5[p25,p27];
+ p34= (0,0,h);
+ p35= (0,0,2*t-h);
+ drawoptions( withpen thick );
+ draw rp(p8)--rp(p4)--rp(p3)--rp(p7)--rp(p8)--rp(p15)--rp(p16);
+ draw rp(p15)--rp(p18)--rp(p17)--rp(p3)--rp(p4)--rp(p18);
+ path pat[];
+ pat1 = rp(p8)--rp(p4);
+ pat2 = rp(p7)--rp(p16)--rp(p17);
+ pat3 = rp(p4)--rp(p18);
+ pat4 = pat2 cutbefore pat1 cutafter pat3;
+ draw pat4;
+ drawoptions( withpen thin );
+ drawdblarrow rp(p2)--rp(p6);
+ drawdblarrow rp(p10)--rp(p12);
+ drawdblarrow rp(p14)--rp(p12);
+ drawdblarrow rp(p21)--rp(p23);
+ drawdblarrow rp(p25)--rp(p27);
+ draw rp(p1)--rp(p3);
+ draw rp(p5)--rp(p7);
+ draw rp(p7)--rp(p9);
+ draw rp(p8)--rp(p11);
+ draw rp(p13)--rp(p15);
+ draw rp(p20)--rp(p22);
+ draw rp(p19)--rp(p24);
+ draw rp(p17)--rp(p28);
+ draw rp(p19)--rp(p26);
+ drawoptions( withpen thick );
+ rigorousdisc( 0, true, p20, tr, (-tl,0,0) );
+ draw rp(p19)--rp(p20) withpen thin;
+ drawoptions( withpen aver );
+ draw rp(p34)--rp(p20)--rp(p35);
+ fill ellipticpath( (0,0,t), (h-t)*blue, we*green ) withcolor 0.5white;
+ draw pat2 dashed evenly withpen thick;
+ draw rp(p20)--rp(p35)--rp(p34) dashed evenly;
+ draw rp((0,0,t)-we*green)--rp((0,0,t)+we*green) dashed evenly;
+ angline( p34, p35, p20, ar, btex $\alpha$ etex, llft );
+ label.bot(btex $w$ etex, rp(p29));
+ label.lft(btex $h$ etex, rp(p30));
+ label.top(btex $l$ etex, rp(p31));
+ label.lft(btex $t$ etex, rp(p32));
+ label.rt(btex $d$ etex, rp(p33));
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/cone.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/cone.mp
new file mode 100644
index 00000000000..883f01ff625
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/cone.mp
@@ -0,0 +1,37 @@
+% cone.mp
+% L. Nobre G.
+% 2004
+
+verbatimtex \documentclass{article}\begin{document}{\sffamily etex
+
+beginfig(1);
+ f := (5,3,4);
+ numeric labscal;
+ picture labr, labc, laba, labv;
+ labscal = 2;
+ ahlength := 8pt;
+ ahangle := 30;
+ labc = btex $\vec{c}$ etex scaled labscal;
+ laba = btex $\vec{A}$ etex scaled labscal;
+ labr = btex $R$ etex scaled labscal;
+ labv = btex $\vec{v}$ etex scaled labscal;
+ drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue );
+ verygoodcone(true,black,blue,0.8,blue+green);
+ drawoptions( withpen pencircle scaled 1.3pt );
+ draw rp(black)--rp(green)--rp(blue+green) dashed evenly;
+ drawdblarrow rp(black)--rp(0.8green);
+ label.urt( labr, rp(0.4green) );
+ drawarrow rp(black)--rp(0.45*blue);
+ label.rt( laba, rp((0,0,0.25)) );
+ dotlabel.llft( labc, rp(black) );
+ dotlabel.rt( labv, rp(blue+green) );
+
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end.
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/ellipticprism.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/ellipticprism.mp
new file mode 100644
index 00000000000..6106c980adf
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/ellipticprism.mp
@@ -0,0 +1,39 @@
+% ellipticprism.mp
+% L. Nobre G.
+% 2004
+
+verbatimtex \documentclass{article}\begin{document}{\sffamily etex
+
+beginfig(1);
+ f := (5,3,4);
+ numeric labscal;
+ picture labsa, labba, labsb, labd, labc;
+ labscal = 2;
+ ahlength := 8pt;
+ ahangle := 30;
+ labc = btex $\vec{c}$ etex scaled labscal;
+ labsa = btex $\vec{S}_1$ etex scaled labscal;
+ labsb = btex $\vec{S}_2$ etex scaled labscal;
+ labba = btex $\vec{B}_1$ etex scaled labscal;
+ labd= btex $D$ etex scaled labscal;
+ drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue );
+ whatisthis( black, 0.5red, green, 0.85, 0.8 );
+ drawoptions( withpen pencircle scaled 1.3pt );
+ drawdblarrow rp(black)--rp(0.85blue);
+ label.rt( labd, rp(0.4blue) );
+ drawarrow rp(black)--rp(0.5red);
+ label.ulft( labsa, rp(0.25red) );
+ drawarrow rp(black)--rp(green);
+ label.top( labba, rp((0,0.5,0)) );
+ drawarrow rp(0.85blue)--rp(0.8*0.5*red+0.85blue);
+ label.ulft( labsb, rp(0.2red+0.85blue) );
+ dotlabel.bot( labc, rp(black) );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end.
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/intersection2D.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/intersection2D.mp
new file mode 100644
index 00000000000..d482fde6ed0
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/intersection2D.mp
@@ -0,0 +1,46 @@
+% intersection2D.mp
+% L. Nobre G.
+% 2004
+
+verbatimtex \documentclass{article}\begin{document}{\sffamily etex
+
+beginfig(1);
+ numeric u;
+ pair Aa, Ab, Ba, Bb, Un, Kn, Or;
+ pen dotpen, penpen;
+ color knowncolour, notknowncol;
+ picture kn, un;
+ u = 4mm;
+ Aa = (0,8u);
+ Ab = (15u,0);
+ Ba = (12u,0.5u);
+ Bb = (13u,6u);
+ Kn = (0,1u);
+ Or = (1.5u,1.5u);
+ dotpen = pencircle scaled 0.5u;
+ penpen = pencircle scaled 0.2u;
+ knowncolour = blue;
+ notknowncol = red;
+ kn = btex given etex;
+ un = btex unknown etex;
+ draw Aa--Ab;
+ draw Ba--Bb;
+ drawoptions( withpen dotpen withcolor knowncolour );
+ draw Aa;
+ draw Ab;
+ draw Ba;
+ draw Bb;
+ draw Kn+Or;
+ drawoptions( withpen dotpen withcolor notknowncol );
+ Un = whatever[Aa,Ab];
+ Un = whatever[Ba,Bb];
+ draw Un;
+ draw Or;
+ drawoptions();
+ label.rt( kn, Kn+Or );
+ label.rt( un, Or );
+endfig;
+
+verbatimtex }\end{document} etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/kindofcube.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/kindofcube.mp
new file mode 100644
index 00000000000..c29d727bd61
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/kindofcube.mp
@@ -0,0 +1,57 @@
+% kindofcube.mp
+% L. Nobre G.
+% 2004
+
+verbatimtex \documentclass{article}\begin{document}{\sffamily etex
+
+beginfig(1);
+ f := (4,1.2,0.5);
+ Spread := 120;
+ numeric lena, lenb, lenc, aa, ab, ac, angray, micr, labscal;
+ pair zeror;
+ color axa, axb, axc, returnedcorner, dummyc, auxx, auxy;
+ lena=0.3;
+ lenb=0.6;
+ lenc=0.9;
+ aa=130;
+ ab=32;
+ ac=67;
+ labscal=1.6;
+ angray=0.85;
+ micr=0.01;
+ zeror=rp(black);
+ cartaxes(1.2,1,1.15);
+ axa = ( cosd(aa), sind(aa), 0 );
+ axb = axa*cosd(ab)+blue*sind(ab);
+ auxx= ( cosd(aa+90), sind(aa+90), 0);
+ auxy = ncrossprod( axb, auxx );
+ axc = auxx*cosd(ac)+auxy*sind(ac);
+ draw zeror--rp(axa);
+ draw zeror--rp(axb);
+ draw zeror--rp(-0.6*axa);
+ draw zeror--rp(axc);
+ draw zeror--rp(auxx);
+ label.rt( btex $a$ etex scaled labscal, rp(axa) );
+ label.rt( btex $b$ etex scaled labscal, rp(axb) );
+ label.lft( btex $c$ etex scaled labscal, rp(auxx) );
+ label.lft( btex $d$ etex scaled labscal, rp(axc) );
+ angline( axa,red,black,angray,btex $\alpha_1$ etex scaled labscal,bot );
+ angline( axb,axa,black,angray,btex $\alpha_2$ etex scaled labscal,rt );
+ angline( axc,auxx,black,angray,btex $\alpha_3$ etex scaled labscal,lft );
+ squareangline( -axa,auxx,black,0.2);
+ drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue );
+ kindofcube( false, true, black, aa, ab, ac, lena, lenb, lenc );
+ drawoptions();
+ dotlabel.bot( btex $\vec{o}$ etex scaled labscal, zeror );
+ label.bot( btex $l_1$ etex scaled labscal, rp(lena*axb) );
+ label.bot( btex $l_2$ etex scaled labscal, rp(0.5*lenb*axc) );
+ label.ulft( btex $l_3$ etex scaled labscal,rp(0.5*lenc*ncrossprod(axb,axc)));
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end.
+
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/newexperimental.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/newexperimental.mp
new file mode 100644
index 00000000000..bfacd32ae1f
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/newexperimental.mp
@@ -0,0 +1,157 @@
+% newexperimental.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3D;
+%input featpost2D;
+
+%verbatimtex
+%\documentclass{article}
+%\usepackage{beton}
+%\usepackage{concmath}
+%\usepackage{ccfonts}
+%\begin{document}
+%etex
+
+verbatimtex
+\documentclass{article}
+\usepackage{palatino}
+\begin{document}
+etex
+
+f := (4.5,-6,5);
+%f := (-4.5,-6,5);
+
+beginfig(1);
+ numeric len[], ray[];
+ color axe[], pos[], fix[], lab[];
+ color reflabpos, reflabpoi, lincolor;
+ picture txt[], dashpatt;
+ numeric inclang, aberang, sampang, stepang;
+ numeric squside, sqlevel, ul, outermagpos;
+ numeric innerray, polesep, fracone, fracsam;
+ numeric labelscale;
+ path tmpath, aupath, copath;
+
+ pickup pencircle scaled 1.2pt;
+ dashpatt = evenly scaled 3;
+ inclang = 150;
+ aberang = 17;
+ sampang = 30;
+ stepang = 20;
+ ul = 0.1;
+ labelscale = 5;
+ outermagpos = 30ul;
+ squside = outermagpos;
+ sqlevel = -20ul;
+ polesep = 15ul;
+ fracone = 0.33;
+ fracsam = 0.86;
+ ray1 = 10ul;
+ ray2 = 6ul;
+ ray3 = 8ul;
+ ray4 = 1.5ul;
+ ray5 = 4ul;
+ ray6 = 3ul;
+ ray7 = 3.5ul;
+ ray8 = 2ul;
+ len3 = 7ul;
+ len4 = 20ul;
+ len5 = 3ul;
+ len7 = 3.5ul;
+ len8 = 7ul;
+ lincolor = 0.5background;
+
+ reflabpos = ( -squside, 0, -sqlevel );
+ reflabpoi = ( -squside, squside, -sqlevel );
+ V1 := (squside,squside,-sqlevel);
+ V2 := (-squside,squside,-sqlevel);
+ V3 := (-squside,-squside,-sqlevel);
+ V4 := (squside,-squside,-sqlevel);
+% makeface1(1,2,3,4);
+% draw_all_test( false );
+
+ len1 = (1-fracone)*(outermagpos-ray5-polesep);
+ pos1 = (-outermagpos,0,0);
+ len2 = fracone*(outermagpos-ray5-polesep);
+ pos2 = (len1-outermagpos,0,0);
+ lab2 = reflabpos;
+ txt2 = thelabel.top( btex magnet etex scaled labelscale, rp( lab2 ) );
+ fix2 = (-outermagpos+0.5len1,0,ray1);
+ axe3 = ( 0, cosd( inclang ), sind( inclang ) );
+ pos3 = -( len3 + len4 + len5 )*axe3;
+ lab3 = (1-fracone)*reflabpoi+fracone*V1;
+ txt3 = thelabel.rt( btex rotor etex scaled labelscale, rp( lab3 ) );
+ axe4 = axe3;
+ pos4 = -( len4 + len5 )*axe4;
+ fix3 = pos4+fracsam*ray3*(0,cosd( inclang -90 ),sind( inclang -90 ));
+ axe5 = axe3;
+ pos5 = -( len5 )*axe5;
+ lab5 = (1-fracone)*reflabpoi+fracone*V2;
+ txt5 = thelabel.rt( btex sample etex scaled labelscale, rp(lab5) );
+ fix5 = fracsam*ray5*(0,cosd( inclang -90 ),sind( inclang -90 ));
+
+ V5 := fracsam*ray5*( sind( sampang ),
+ cosd( sampang )*cosd( inclang -90 ),
+ cosd( sampang )*sind( inclang -90 ) );
+ V6 := fracsam*ray5*( -sind( sampang ),
+ cosd( sampang )*cosd( inclang -90 ),
+ cosd( sampang )*sind( inclang -90 ) );
+ V8 := fracsam*ray5*( sind( sampang ),
+ -cosd( sampang )*cosd( inclang -90 ),
+ -cosd( sampang )*sind( inclang -90 ) );
+ V7 := fracsam*ray5*( -sind( sampang ),
+ -cosd( sampang )*cosd( inclang -90 ),
+ -cosd( sampang )*sind( inclang -90 ) );
+ axe6 = ( 0, cosd( inclang+aberang ), sind( inclang+aberang ) );
+ pos6 = ray1*axe6;
+ len6 = len4;
+ axe7 = ( 0, cosd( inclang-aberang ), sind( inclang-aberang ) );
+ pos7 = ( ray1 + 0.5len6 )*axe7;
+ lab6 = fracone*reflabpos+(1-fracone)*V3;
+ txt6=thelabel.lft(btex camera etex scaled labelscale,rp(lab6));
+ fix6 = pos6+len6*axe6;
+ pos8 = pos7+len7*axe7;
+ axe8 = axe7;
+ lab8 = (1-fracone)*reflabpos+fracone*V3;
+ txt8 = thelabel.lft( btex lamp etex scaled labelscale, rp( lab8 ) );
+ fix8 = pos8+len8*axe8;
+ len9 = len2;
+ pos9 = (ray5+polesep,0,0);
+ ray9 = ray2;
+ ray10 = ray1;
+ pos10 = pos9+len9*(1,0,0);
+ len10 = len1;
+
+ getready( "rigorousdisc( 0, true, pos1, ray1, len1*(1,0,0) )", pos1 );
+ getready( "whatisthis(pos2,ray1*green,ray1*blue,conorm((-ray5-polesep,0,0)-pos2),ray2/ray1)", pos2 );
+ getready( "rigorousdisc( 0, true, pos3, ray3, len3*axe3 )", pos3 );
+ getready( "rigorousdisc( 0, true, pos4, ray4, len4*axe4 )", pos4 );
+ getready( "rigorousdisc( 0, true, pos5, ray5, len5*axe5 )", pos5 );
+ getready( "draw rp(V5)--rp(V6)--rp(V7)--rp(V8)--cycle", black );
+ getready( "draw rp(pos6)--rp((0,0,0))--rp(pos7) dashed dashpatt",0.5*pos6);
+ getready( "rigorousdisc( 0, true, pos6, ray6, len6*axe6 )", pos6 );
+ getready( "whatisthis(pos7,ray7*red,-ray7*ncrossprod(red,axe7),conorm(pos8-pos7),ray8/ray7)", pos7 );
+ getready( "rigorousdisc( 0, true, pos8, ray8, len8*axe8 );", pos8 );
+ getready( "whatisthis(pos9,ray9*green,ray9*blue,conorm(pos10-pos9),ray10/ray9)", pos9 );
+ getready( "rigorousdisc( 0, true, pos10, ray10, len10*(1,0,0) )", pos10 );
+ doitnow;
+ draw llcorner txt2--lrcorner txt2--rp(fix2) withcolor lincolor;
+ draw lrcorner txt3--llcorner txt3--rp(fix3) withcolor lincolor;
+ draw lrcorner txt5--llcorner txt5--rp(fix5) withcolor lincolor;
+ draw llcorner txt6--lrcorner txt6--rp(fix6) withcolor lincolor;
+ draw llcorner txt8--lrcorner txt8--rp(fix8) withcolor lincolor;
+ draw txt2;
+ draw txt3;
+ draw txt5;
+ draw txt6;
+ draw txt8;
+
+ produce_auto_scale;
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/perspec.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/perspec.mp
new file mode 100644
index 00000000000..09efea9ab2f
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/perspec.mp
@@ -0,0 +1,77 @@
+% perspec.mp
+% L. Nobre G.
+% 2004
+
+%input featpost3D;
+%input featpost2D;
+
+% bash: export TEX=latex
+% tcsh: setenv TEX latex
+
+f := (4,2,2.5);
+Spread := 45;
+
+verbatimtex \documentclass{article} \begin{document} etex
+
+color psdf, psdu, psdv, rll, rlr, rur, rul, pll, plr, pur, pul;
+color pc;
+numeric projecplanesize, sizefraction, positfraction, aspectratio, rectsize;
+pen realpen, lightpen, projpen, dotpen;
+path projecplanepath, realpath;
+psdf = 3.1*(0,1,0.37);
+projecplanesize = 1.7;
+sizefraction = 0.19;
+positfraction = 0.65;
+aspectratio = 1.0;
+rectsize = 0.15;
+realpen = pencircle scaled 2.6pt;
+lightpen = pencircle scaled 0.55pt;
+projpen = pencircle scaled 1.8pt;
+dotpen = pencircle scaled 3.8pt;
+psdv = N( (-Y(psdf), X(psdf), 0) );
+psdu = ncrossprod( psdf, psdv );
+pll = projecplanesize*(-aspectratio*psdv-psdu);
+plr = projecplanesize*(+aspectratio*psdv-psdu);
+pur = projecplanesize*(+aspectratio*psdv+psdu);
+pul = projecplanesize*(-aspectratio*psdv+psdu);
+projecplanepath = rp(pll)--rp(plr)--rp(pur)--rp(pul)--cycle;
+pc = positfraction*psdf;
+rll = pc+sizefraction*projecplanesize*(-psdv-psdu);
+rlr = pc+sizefraction*projecplanesize*(+psdv-psdu);
+rur = pc+sizefraction*projecplanesize*(+psdv+psdu);
+rul = pc+sizefraction*projecplanesize*(-psdv+psdu);
+realpath = rp(rll)--rp(rlr)--rp(rur)--rp(rul)--cycle;
+
+beginfig(1);
+ draw projecplanepath withpen realpen;
+ draw realpath withpen realpen;
+ draw rp(psdf) withpen lightpen;
+ drawoptions( withpen lightpen );
+ squareangline( psdf, psdv, black, rectsize );
+ squareangline( psdf, psdu, black, rectsize );
+ drawoptions();
+ pair prll, prlr, prur, prul;
+ LightSource:=psdf;
+ prll = rp(projectpoint(black,rll));
+ prlr = rp(projectpoint(black,rlr));
+ prur = rp(projectpoint(black,rur));
+ prul = rp(projectpoint(black,rul));
+ path projpath;
+ projpath = prll--prlr--prur--prul--cycle;
+ draw projpath withpen projpen;
+ draw prll--rp(psdf) withpen lightpen;
+ draw prlr--rp(psdf) withpen lightpen;
+ draw prur--rp(psdf) withpen lightpen;
+ draw prul--rp(psdf) withpen lightpen;
+ draw rp(black)--rp(psdf) withpen lightpen;
+ draw rp(black) withpen dotpen;
+ draw rp(psdf) withpen dotpen;
+ label.rt( btex \texttt{f} etex, rp(psdf) );
+ label.bot( btex \texttt{viewcentr} etex, rp(black) );
+endfig;
+
+verbatimtex
+\end{document}
+etex
+
+end; \ No newline at end of file
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/planintersection.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/planintersection.mp
new file mode 100644
index 00000000000..a3ab18237c4
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/planintersection.mp
@@ -0,0 +1,105 @@
+% planintersection.mp
+% L. Nobre G.
+% 2004
+
+verbatimtex \documentclass{article}\begin{document}{\sffamily etex
+
+beginfig(1);
+ f := 0.5*(10,14,5.5);
+ color a, x, b, c, D, y, w, g, h;
+ color auxa, auxb, auxc, auxd, auxe, auxf;
+ pair appear;
+ numeric wid, hei, alfa, beta, forw, back, labscal;
+ pen thedotpen, borderpen, normalpen;
+ picture dasha, dashb, labx, laba, labb, labc, labD;
+ path outerb, innerb, apath, bpath;
+ wid = 1.5;
+ hei = 1;
+ forw = 1.5;
+ back = 1.5;
+ alfa = -10;
+ beta = -30;
+ labscal = 2.8;
+ labeloffset := 8pt;
+ ahangle := 30;
+ ahlength := 10pt;
+ a = ( 0.7*forw, 0.15*wid, 0.3*hei );
+ b = ( -0.7*back, 0.5*wid, 0.8*hei );
+ c = ( 0, 0.7*wid, 0.5*hei );
+ D = ( cosd( alfa )*cosd( beta ), sind( alfa )*cosd( beta ), sind( beta ) );
+ labx = btex $\vec{x}$ etex scaled labscal;
+ laba = btex $\vec{a}$ etex scaled labscal;
+ labb = btex $\vec{b}$ etex scaled labscal;
+ labc = btex $\vec{c}$ etex scaled labscal;
+ labD = btex $\vec{D}$ etex scaled labscal;
+ thedotpen = pencircle scaled 4pt;
+ borderpen = pencircle scaled 2pt;
+ normalpen = pencircle scaled 1.5pt;
+ dasha = evenly scaled 2;
+% dashb = dashpattern( on 7pt off 5pt on 7pt );
+ dashb = withdots;
+ apath = rp((X(a),Y(a),0))--rp(a)--rp((X(a),0,Z(a)));
+ bpath = rp((X(b),Y(b),0))--rp(b)--rp((X(b),0,Z(b)));
+ auxa = ( forw, 0, 0 );
+ auxb = ( forw, 0, hei );
+ auxc = ( -back, 0, hei );
+ auxd = ( -back, 0, 0 );
+ auxe = ( -back, wid, 0 );
+ auxf = ( forw, wid, 0 );
+ outerb = rp(auxa)--rp(auxb)--rp(auxc)--rp(auxd)--rp(auxe)--rp(auxf)--cycle;
+ draw outerb withpen borderpen;
+ draw rp(auxa)--rp(auxd) withpen borderpen;
+
+ draw bpath dashed dasha withpen normalpen;
+ draw rp(b) withpen thedotpen;
+ label.top( labb, rp(b) );
+
+ draw rp(a)--rp(b) withpen normalpen;
+
+ cdotprod( y-c, D ) = 0;
+ cdotprod( y-black, green ) = 0;
+ cdotprod( y-black, blue ) = 0;
+
+ cdotprod( w-c, D ) = 0;
+ cdotprod( w-black, green ) = 0;
+ cdotprod( w-hei*blue, blue ) = 0;
+
+ cdotprod( g-c, D ) = 0;
+ cdotprod( g-wid*green, green ) = 0;
+ cdotprod( g-hei*blue, blue ) = 0;
+
+ cdotprod( h-c, D ) = 0;
+ cdotprod( h-wid*green, green ) = 0;
+ cdotprod( h-black, blue ) = 0;
+
+ innerb = rp(y)--rp(w)--rp(g)--rp(h)--cycle;
+ unfill innerb;
+ draw innerb withpen borderpen;
+
+ draw apath dashed dasha withpen normalpen;
+ draw rp(a) withpen thedotpen;
+ label.top( laba, rp(a) );
+
+ x = whatever[a,b];
+ cdotprod( x-c, D ) = 0;
+ draw rp(x) withpen thedotpen;
+ label.top( labx, rp(x) );
+
+ draw rp(a)--rp(x) withpen normalpen;
+ draw rp(x)--rp(b) withpen normalpen dashed dashb;
+
+ draw rp(c) withpen thedotpen;
+ drawarrow rp(c)--rp(c+0.7*D) withpen borderpen;
+ label.top( labc, rp(c) );
+
+ label.bot( labD, rp(c+0.5*D) );
+
+ draw rp(x)--rp(c) dashed dasha withpen normalpen;
+ drawoptions( withpen normalpen );
+ squareangline( x, c+D, c, 0.08*wid );
+
+endfig;
+
+verbatimtex }\end{document} etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/revolvers.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/revolvers.mp
new file mode 100644
index 00000000000..41fd7a9c4e2
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/revolvers.mp
@@ -0,0 +1,112 @@
+% revolvers.mp
+% L. Nobre G.
+% 2004
+
+verbatimtex \documentclass{article}\begin{document}{\sffamily etex
+
+def posang( expr Angul ) =
+ rp( green*cosd( Angul ) + blue*sind( Angul ) )
+enddef;
+
+beginfig(1);
+ f := (3,5,4);
+ numeric labscal;
+ picture labr, labc, laba, labum, labdo, labtr, labqu, labci;
+ labscal = 2;
+ ahlength := 8pt;
+ ahangle := 30;
+ labc = btex $\vec{c}$ etex scaled labscal;
+ laba = btex $\vec{A}$ etex scaled labscal;
+ labr = btex $R$ etex scaled labscal;
+ labum= btex 1 etex scaled labscal;
+ labdo= btex 2 etex scaled labscal;
+ labtr= btex 3 etex scaled labscal;
+ labqu= btex 4 etex scaled labscal;
+ labci= btex 5 etex scaled labscal;
+ drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue );
+ tropicalglobe( 5, black, 1, blue );
+ drawoptions( withpen pencircle scaled 1.3pt );
+ drawdblarrow rp(black)--rp(red);
+ label.top( labr, rp((0.5,0,0)) );
+ drawarrow rp(black)--rp(blue);
+ label.rt( laba, rp((0,0,0.5)) );
+ dotlabel.lrt( labc, rp(black) );
+ dotlabel.rt( labum, posang(-72) );
+ dotlabel.top( labdo, posang(-36) );
+ dotlabel.top( labtr, posang(0) );
+ dotlabel.top( labqu, posang(36) );
+ dotlabel.top( labci, posang(72) );
+endfig;
+
+beginfig(2);
+ f := (3,5,5.7);
+ numeric labscal;
+ picture labri, labc, laba, labro;
+ labscal = 2;
+ ahlength := 8pt;
+ ahangle := 30;
+ labc = btex $\vec{c}$ etex scaled labscal;
+ laba = btex $\vec{A}$ etex scaled labscal;
+ labri= btex $R_i$ etex scaled labscal;
+ labro= btex $R_o$ etex scaled labscal;
+ drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue );
+ rigorousdisc( 0.5, true, black, 1, 0.85*blue );
+ drawoptions( withpen pencircle scaled 1.3pt );
+ drawdblarrow rp(black)--rp(red);
+ label.lrt( labro, rp(0.5*red) );
+ drawdblarrow rp(black+0.85*blue)--rp(0.5*green+0.85*blue);
+ label.urt( labri, rp(0.25*green+0.85*blue) );
+ drawarrow rp(black)--rp(0.85*blue);
+ label.ulft( laba, rp((0,0,0.5)) );
+ dotlabel.rt( labc, rp(black) );
+endfig;
+
+beginfig(3);
+ f := (3,2.05,2.65);
+ numeric labscal, bray, sray;
+ picture labrb, labc, laba, labrs;
+ labscal = 2;
+ ahlength := 8pt;
+ ahangle := 30;
+ bray = 0.7;
+ sray = 0.4;
+ labc = btex $\vec{c}$ etex scaled labscal;
+ laba = btex $\vec{A}$ etex scaled labscal;
+ labrb= btex $R_b$ etex scaled labscal;
+ labrs= btex $R_s$ etex scaled labscal;
+ drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue );
+ smoothtorus( black, blue, bray, sray );
+ drawoptions( withpen pencircle scaled 1.3pt );
+ draw goodcirclepath( bray*red, green, sray ) dashed evenly;
+ drawdblarrow rp(black)--rp(bray*red);
+ label.ulft( labrb, rp(0.5*bray*red) );
+ drawdblarrow rp(bray*red+sray*blue)--rp(bray*red);
+ label.llft( labrs, rp(bray*red+0.5*sray*blue) );
+ drawarrow rp(black)--rp(sray*blue);
+ label.rt( laba, rp((0,0,0.5*sray)) );
+ dotlabel.lrt( labc, rp(black) );
+endfig;
+
+beginfig(4);
+ f := (3,5,4);
+ numeric labscal;
+ picture labr, labc, laba;
+ labscal = 2;
+ ahlength := 8pt;
+ ahangle := 30;
+ labc = btex $\vec{c}$ etex scaled labscal;
+ laba = btex $\vec{A}$ etex scaled labscal;
+ labr = btex $R$ etex scaled labscal;
+ drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue );
+ spatialhalfsfear( black, blue, 1 );
+ drawoptions( withpen pencircle scaled 1.3pt );
+ drawdblarrow rp(black)--rp(red);
+ label.ulft( labr, rp(0.5*red) );
+ drawarrow rp(black)--rp(0.4*blue);
+ label.rt( laba, rp((0,0,0.2)) );
+ dotlabel.lrt( labc, rp(black) );
+endfig;
+
+verbatimtex }\end{document} etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/tug04/tangency2D.mp b/Master/texmf-dist/doc/metapost/featpost/example/tug04/tangency2D.mp
new file mode 100644
index 00000000000..8682c43bc0d
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/tug04/tangency2D.mp
@@ -0,0 +1,56 @@
+% intersection2D.mp
+% L. Nobre G.
+% 2004
+
+verbatimtex \documentclass{article}\begin{document}{\sffamily etex
+
+beginfig(1);
+ numeric u, r, d;
+ pair Aa, Ab, Ba, Bb, Ca, Cb, Da, Db, Ea, Eb, Or, Kn;
+ pen dotpen, penpen;
+ color knowncolour, notknowncol;
+ picture kn, un, rl;
+ u = 4mm;
+ Aa = (5u,4u);
+ Ab = (3u,2u);
+ Ba = (13u,5u);
+ Bb = 0.5[Aa,Ab];
+ r = abs( Aa - Ab );
+ d = abs( Aa - Ba ) +-+ r;
+ Ea = radialcross( Aa, r, Ba, d, true );
+ Eb = radialcross( Aa, r, Ba, d, false );
+ Ca = 1.4[Ba,Ea];
+ Cb = 1.15[Ea,Ba];
+ Da = 1.5[Ba,Eb];
+ Db = 1.1[Eb,Ba];
+ Kn = (0,1u);
+ Or = (10u,1u);
+ dotpen = pencircle scaled 0.5u;
+ penpen = pencircle scaled 0.2u;
+ knowncolour = blue;
+ notknowncol = red;
+ kn = btex given etex;
+ un = btex unknown etex;
+ rl = btex $R$ etex;
+ draw fullcircle scaled 2r shifted Aa;
+ draw Ca--Cb;
+ draw Da--Db dashed evenly;
+ drawarrow Aa--Ab;
+ drawoptions( withpen dotpen withcolor knowncolour );
+ draw Aa;
+ draw Ba;
+ draw Kn+Or;
+ drawoptions( withcolor knowncolour );
+ label.ulft( rl, Bb );
+ drawoptions( withpen dotpen withcolor notknowncol );
+ draw Ea;
+ draw Eb;
+ draw Or;
+ drawoptions();
+ label.rt( kn, Kn+Or );
+ label.rt( un, Or );
+endfig;
+
+verbatimtex }\end{document} etex
+
+end;
diff --git a/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.rc b/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.rc
new file mode 100644
index 00000000000..c73971b5950
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.rc
@@ -0,0 +1,75 @@
+########################################################################
+# #
+# This is the configuration file for Galrey #
+# every line beginning with '#' will be discarded (they are comments) #
+# Carefully read every comment before each parameter #
+# ##########
+# Copyright 2001, Claudio Cicali # Galrey #
+# # 0.5 #
+#################################################################################
+
+# TITLE: used as the html <title> ad as ashort description at the bottom of the html files
+# default: "My Galrey pictures collection"
+title = FeatPost Example Collection
+
+# PATTERN: only the files that match this patters are processed
+# default: "*.jpg"
+pattern=*.png
+
+# THUMBSIZE: desidered size XxY of the generated thumbnails
+# default: 80x60 (this is scaled based upon a 640x480 full size)
+thumbsize=140x140
+
+# THUMBPREFIX: desidered prefix of the thumbnails filename
+# default: "t_"
+thumbprefix=t_
+
+# THUMBSPERROW: how many thumbnails in each row of the index file
+# default: 5
+thumbsperrow=6
+
+# INDEX: name of the (generated) index file. Used also in the html file
+# default: "index.html"
+# index=galreyindex.html
+
+# GENERATEDEXT: the extension the generated html files will have
+# Galrey will generate an html file for each image in the
+# collection. This is the extension they will have
+# default: html
+generatedext=html
+
+# IMAGESPATH: the directory where the images reside (do not add the final '/')
+# default: "."
+imagespath=../galreyimages
+
+# OUTPUTPATH: the directory where the generated file will be placed
+# default: "."
+outputpath=../galreyimages
+
+# TEMPLATE: the name and location of the template file to use
+# default: "./galrey.tpl"
+template=galrey.tpl
+
+# SHOWINFO: this enables (or disable) the visualization of some image informations.
+# This information will be displayed under each images thumbnail in
+# the form : [width x height] imagesize
+# default: yes
+showinfo=no
+
+# MEMOFILE: if set, galrey will read a description for each image from the
+# specified file and will put it into the relative html file in
+# corrispondence of the $DESCRIPTION$ special tag.
+# The file must be builded respecting the following syntax:
+# for each image, add a line containing the imagename, a space, and a description
+# (as long as you like)
+# Example (an entry for an image called garden.jpg):
+# garden.jpg My beautiful garden full of flowers !
+#
+# Note: you can build a file in this way, simply running the following
+# command in the dir containing your images:
+# ls *.jpg > galrey.nfo
+# Than edit the galrey.nfo adding the comments on the right of each image listed
+# The list sorting order is not relevant
+# default: not set
+memofile=galrey.memo
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.sh b/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.sh
new file mode 100644
index 00000000000..0cfee78ddce
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.sh
@@ -0,0 +1,6 @@
+ls ../galreyimages/ > ./galrey.ls
+dog -b ./galrey.ls > galrey.nms
+sed -e 's/.png//' galrey.nms > galrey.fn
+join -o 1.2,2.2 galrey.nms galrey.fn > galrey.memo
+galrey
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.tpl b/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.tpl
new file mode 100644
index 00000000000..df414141291
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/galrey/galrey.tpl
@@ -0,0 +1,42 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>$TITLE$</title>
+<style type="text/css">
+<!--
+.title {color: #CCCC00; font-family: Verdana, Arial; font-size: 16pt; font-weight: bold}
+.counter {color: #ffffcc; font-family: Verdana, Arial; font-size: 11pt; font-weight: bold}
+.nav {color: #CC9900; font-family: Verdana, Arial; font-size: 14pt; font-weight: normal; text-decoration: none}
+.nav:Hover {color: #CCCC00; font-family: Verdana, Arial; font-size: 14pt; font-weight: normal; text-decoration: underline}
+.memo {color: #ffffcc; font-family: Verdana, Arial; font-size: 10pt; font-weight: normal}
+-->
+</style>
+</head>
+
+<body bgcolor="#330066">
+<div align="center">
+<table cellpadding="0" cellspacing="0" width="600">
+<tr>
+<td>
+<a class="nav" href="$FIRST$">|&lt;</a>&nbsp;&nbsp;
+<a class="nav" href="$PREVIOUS$">&lt;&lt;</a>&nbsp;&nbsp;
+<a class="nav" href="$INDEX$">O</a>&nbsp;&nbsp;
+<a class="nav" href="$NEXT$">&gt;&gt;</a>&nbsp;&nbsp;
+<a class="nav" href="$LAST$">&gt;|</a>
+</td>
+<td>
+<div class="counter">$ID$/$TOTAL$</div>
+</td>
+<td align="right"><div class="title"><b>$TITLE$</b></div></td>
+</tr>
+</table>
+<br>
+<table cellpadding="3" cellspacing="0" bgcolor="#FFFFFF">
+<tr><td><img alt="imagefile: $CURRENT$" WIDTH="$WIDTH$" HEIGHT="$HEIGHT$" border="0" src="../galreyimages/$CURRENT$"></td></tr>
+</table>
+</div>
+<br>
+<div class="memo" align="center">$DESCRIPTION$</div>
+</body>
+</html>
diff --git a/Master/texmf-dist/doc/metapost/featpost/jpeg/cbxSmall.jpg b/Master/texmf-dist/doc/metapost/featpost/jpeg/cbxSmall.jpg
new file mode 100644
index 00000000000..d7291c3fbeb
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/jpeg/cbxSmall.jpg
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/jpeg/hiddenlinegraph1.jpg b/Master/texmf-dist/doc/metapost/featpost/jpeg/hiddenlinegraph1.jpg
new file mode 100644
index 00000000000..23f081024af
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/jpeg/hiddenlinegraph1.jpg
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/jpeg/mymetapostbackground.jpeg b/Master/texmf-dist/doc/metapost/featpost/jpeg/mymetapostbackground.jpeg
new file mode 100644
index 00000000000..14a6feecaf8
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/jpeg/mymetapostbackground.jpeg
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/jpeg/mymetapostclearback.jpeg b/Master/texmf-dist/doc/metapost/featpost/jpeg/mymetapostclearback.jpeg
new file mode 100644
index 00000000000..03a47cb2efe
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/jpeg/mymetapostclearback.jpeg
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/jpeg/par3Dplotexamples1.jpg b/Master/texmf-dist/doc/metapost/featpost/jpeg/par3Dplotexamples1.jpg
new file mode 100644
index 00000000000..cf12c9a6c73
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/jpeg/par3Dplotexamples1.jpg
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/jpeg/par3Dplotexamples2.jpg b/Master/texmf-dist/doc/metapost/featpost/jpeg/par3Dplotexamples2.jpg
new file mode 100644
index 00000000000..4eb188916c9
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/jpeg/par3Dplotexamples2.jpg
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/jpeg/planpau2.jpeg b/Master/texmf-dist/doc/metapost/featpost/jpeg/planpau2.jpeg
new file mode 100644
index 00000000000..4e357099980
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/jpeg/planpau2.jpeg
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/latex/linuxdoc-sgml.sty b/Master/texmf-dist/doc/metapost/featpost/latex/linuxdoc-sgml.sty
new file mode 100644
index 00000000000..a8ad9ad41e3
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/latex/linuxdoc-sgml.sty
@@ -0,0 +1,117 @@
+%% This is linuxdoc-sgml.sty, for use with SGML-generated LaTeX
+%% by Matt Welsh (mdw@sunsite.unc.edu)
+%%
+%% $Id: linuxdoc-sgml.sty,v 1.8 1998/05/14 20:06:13 cg Exp $
+%%
+%% Based on linuxdoc.sty by Michael K. Johnson, and latex.tex by
+%% Leslie Lamport. MODIFIED BY L. NOBRE G. TO BE USED IN TUGBOAT
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{linuxdoc-sgml}
+
+%%% GLOBAL LAYOUT THINGS
+
+%\marginparwidth 0.0 in
+%\parindent 0.0 in
+%\topmargin -0.5 in
+%\setlength{\textheight}{\paperheight}
+%\addtolength{\textheight}{-2 in}
+%\advance\headsep 2 ex
+%\advance\textheight -2 ex
+%\renewcommand{\baselinestretch}{1.14}
+%\addtolength{\parskip}{1.2 ex}
+
+%%% ONE-SIDED/TWO-SIDED DEPENDENCIES
+
+%\if@twoside % ``book'' style was chosen
+% \oddsidemargin 0.0 in
+% \evensidemargin 0 in
+% \textwidth 6 in
+% \def\ps@headings{\let\@mkboth\markboth
+% \def\@oddfoot{}\def\@evenfoot{}% No feet.
+% \def\@evenhead{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth
+% \rm \thepage\hfil \bf \leftmark} % Left heading.
+% \def\@oddhead{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth
+% {\bf \rightmark}\hfil \rm\thepage} % Right heading.
+% \def\chaptermark##1{\markboth {{\ifnum \c@secnumdepth >\m@ne
+% \@chapapp\ \thechapter. \ \fi ##1}}{}}%
+% \def\sectionmark##1{\markright {{\ifnum \c@secnumdepth >\z@
+% \thesection. \ \fi ##1}}}}
+
+%\else % if not book style, then
+% \oddsidemargin 0.0 in
+% \evensidemargin\oddsidemargin
+% \textwidth 6.5 in
+% \def\ps@headings{\let\@mkboth\markboth
+% \def\@oddfoot{}\def\@evenfoot{}% No feet.
+% \def\@oddhead{\protect\rule[-4pt]{\textwidth}{.5pt}\kern-\textwidth
+% {\bf \rightmark}\hfil \rm\thepage} % Right heading.
+% \def\@evenhead\@oddhead
+% \def\chaptermark##1{\markboth {{\ifnum \c@secnumdepth >\m@ne
+% \@chapapp\ \thechapter. \ \fi ##1}}{}}%
+% \def\sectionmark##1{\markright {{\ifnum \c@secnumdepth >\z@
+% \thesection. \ \fi ##1}}}}
+
+%\fi
+
+%% Titlepage stuff
+
+\gdef\@title{}
+\gdef\title#1{\gdef\@title{#1}}
+\gdef\@date{}
+\gdef\date#1{\gdef\@date{#1}}
+\gdef\@author{}
+\gdef\author#1{\gdef\@author{#1}}
+\gdef\@abstract{}
+\gdef\abstract#1{\gdef\@abstract{#1}}
+
+\def\maketitle{\thispagestyle{empty}\let\footnotesize\small%
+\let\footnoterule\relax
+%\setcounter{page}{0}%
+%\null
+%\vskip 3 in
+\noindent
+{\huge\sf \@title}\\
+%\rule{\textwidth}{1mm}\\ %%%%%%%%%%%%%%%%%%%%%% MAIN MODIFICATION
+\mbox{}\@author\ \hfill \@date\ \\
+\vskip 1 ex
+\noindent{\sf \@abstract}
+\setcounter{footnote}{0}%
+\gdef\@author{}\gdef\@title{}\gdef\@years{}\gdef\@abstract{}
+\let\maketitle\relax}
+
+%% Needs to be here for the previous ps@headings defs to work.
+\pagestyle{headings}
+
+%%% USEFUL MACROS
+
+\newcommand{\linux}{Linux} % Always use this when
+ % refering to the \linux\
+ % operating system, like that.
+\newcommand{\key}[1]{{\fbox{\small\tt #1}}} % Use this to mark keys, like
+ % \key{del} for the delete key.
+\newcommand{\ret}{\fbox{\sf return}} % Special case for the return key.
+\newcommand{\st}{\small\tt} % Small typewriter -- comes in handy.
+%\newcommand{\lb}{{\tt\char '173}} % Left Brace '{'
+%\newcommand{\rb}{{\tt\char '175}} % Right Brace '}'
+\newcommand{\lbr}{$\langle$} % Left Bracket '<'
+\newcommand{\rbr}{$\rangle$} % Right Bracket '>'
+\newcommand{\bs}{{\tt\char '134}} % BackSlash '\'
+\newcommand{\tm}{${}^{\mbox{\tiny\sf TM}}$}
+\newcommand{\TM}{\tm} % TM trademark symbol in
+ % either case
+\newcommand{\cparam}[1]{{\rm \lbr{\sl #1}\rbr}}
+ % Metavariables.
+
+%% Define NAMEURL macro to handle the optional name argument
+%% This calls on the \url macro from the url.sty package so the
+%% URL will be hyphenated correctly.
+\def\nameurl#1#2{{\em #2} {\tt <\url{#1}>}}
+\def\onlynameurl#1{{\em #1}}
+
+%% the tscreen environment automatically goes into typewriter type,
+%% but is otherwise like the screen environment
+
+\newenvironment{tscreen}%
+ {\begin{quote}\bgroup\small\tt}%
+ {\egroup\end{quote}}
diff --git a/Master/texmf-dist/doc/metapost/featpost/latex/logofeatpost.tex b/Master/texmf-dist/doc/metapost/featpost/latex/logofeatpost.tex
new file mode 100644
index 00000000000..b7c852c4b5c
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/latex/logofeatpost.tex
@@ -0,0 +1,18 @@
+\documentclass{article}
+\newfont{\normald}{logod10 scaled 10000}
+\usepackage{graphics,color}
+%\setlength{\textwidth}{724pt}
+%\setlength{\oddsidemargin}{-5.4mm}
+%\setlength{\textheight}{57mm}
+%\setlength{\topmargin}{-4mm}
+%\setlength{\headheight}{5mm}
+%\setlength{\headsep}{2mm}
+%\setlength{\footskip}{2\baselineskip}
+\pagestyle{empty}
+\begin{document}
+\fcolorbox{white}{white}{
+ \begin{tabular}{l}
+ {\normald FEATPOST}
+ \end{tabular}
+ }
+\end{document}
diff --git a/Master/texmf-dist/doc/metapost/featpost/latex/ltugboat.cls b/Master/texmf-dist/doc/metapost/featpost/latex/ltugboat.cls
new file mode 100644
index 00000000000..cc0ad276d09
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/latex/ltugboat.cls
@@ -0,0 +1,1225 @@
+%%
+%% This is file `ltugboat.cls',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% tugboat.dtx (with options: `latex,classtop,common,classtail,latex2e,ltugboatcls')
+%%
+%% Copyright (C) 1994,1995,1996 TeX Users Group
+%% All rights reserved.
+%%
+%% This file is part of the tugboat package.
+%% -----------------------------------------
+%%
+%% This is a generated file. Permission is granted to customize the
+%% declarations in this file to serve the needs of your installation.
+%% However, no permission is granted to distribute a modified version of
+%% this file under its original name.
+%%
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesClass {ltugboat}
+ [1998/09/10 v1.4r
+ TUGboat journal class%
+ ]
+\csname tugstyloaded@\endcsname
+\def\tugstyloaded@{\tugstyinit\endinput}
+\providecommand{\@tugclass}{ltugboat}
+\def\TBInfo{\ClassInfo{\@tugclass}}
+\def\TBError{\ClassError{\@tugclass}}
+\def\TBWarning{\ClassWarning{\@tugclass}}
+\newif\ifpreprint
+\def\preprint{\preprinttrue}
+\DeclareOption{draft}{%
+ \AtEndOfClass{%
+ \setcounter{page}{1001}%
+ \BlackBoxes
+ \def\MakeRegistrationMarks{}%
+ \PrelimDrafttrue
+ }%
+}
+\DeclareOption{preprint}{%
+ \preprinttrue
+}
+\DeclareOption{final}{%
+ \AtEndOfClass{%
+ \UseTrimMarks
+ \NoBlackBoxes
+ \PrelimDraftfalse
+ }%
+}
+\DeclareOption{11pt}{%
+ \TBWarning{The \@tugclass\space class only supports 10pt fonts:
+ \MessageBreak option \CurrentOption\space ignored}%
+}
+\DeclareOption{12pt}{\csname ds@11pt\endcsname}
+\DeclareOption{oneside}{\TBWarning{Option \CurrentOption\space ignored}}
+\DeclareOption{twoside}{\ds@oneside}
+\DeclareOption{onecolumn}{\ds@oneside}
+\DeclareOption{twocolumn}{\ds@oneside}
+\DeclareOption{tugproc}{%
+ \TBWarning{Option \CurrentOption\space ignored: use class ltugproc
+ instead of \@tugclass}%
+}
+\DeclareOption{rawcite}{\let\if@Harvardcite\iffalse}
+\DeclareOption{harvardcite}{\let\if@Harvardcite\iftrue}
+\DeclareOption{extralabel}{\let\UseExtraLabel\@firstofone}
+\DeclareOption{noextralabel}{\let\UseExtraLabel\@gobble}
+\DeclareOption{numbersec}{\let\if@numbersec\iftrue}
+\DeclareOption{nonumber}{\let\if@numbersec\iffalse}
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+\ExecuteOptions{draft,extralabel,numbersec,rawcite}
+\ProcessOptions
+\LoadClass[twoside]{article}
+\def\sectitlefont{\fontfamily\sfdefault\fontseries{bx}\fontshape{n}%
+ \fontsize\@xviipt\stbaselineskip\selectfont}
+\def\tensl{\fontseries{m}\fontshape{sl}\fontsize\@xpt\@xiipt
+ \selectfont}
+\def\EdNoteFont{\fontfamily{cmr}\fontseries{m}\fontshape{ui}%
+ \fontsize\@xpt\@xiipt\selectfont}
+\IfFileExists{mflogo.sty}%
+ {\RequirePackage{mflogo}}%
+ {\TBWarning
+ {Package mflogo.sty not available --\MessageBreak
+ Proceeding to emulate mflogo.sty}
+ \DeclareRobustCommand\logofamily{%
+ \not@math@alphabet\logofamily\relax
+ \fontencoding{U}\fontfamily{logo}\selectfont}
+ \DeclareTextFontCommand{\textlogo}{\logofamily}
+ \def\MF{\textlogo{META}\-\textlogo{FONT}\@}
+ \def\MP{\textlogo{META}\-\textlogo{POST}\@}
+ \DeclareFontFamily{U}{logo}{}
+ \DeclareFontShape{U}{logo}{m}{n}{%
+ <8><9>gen*logo%
+ <10><10.95><12><14.4><17.28><20.74><24.88>logo10%
+ }{}
+ \DeclareFontShape{U}{logo}{m}{sl}{%
+ <8><9>gen*logosl%
+ <10><10.95><12><14.4><17.28><20.74><24.88>logosl10%
+ }{}
+ \DeclareFontShape{U}{logo}{m}{it}{%
+ <->ssub*logo/m/sl%
+ }{}%
+ }
+\def\makeescape#1{\catcode`#1=\z@}
+\def\makebgroup#1{\catcode`#1=\@ne}
+\def\makeegroup#1{\catcode`#1=\tw@}
+\def\makemath #1{\catcode`#1=\thr@@}
+\def\makealign #1{\catcode`#1=4 }
+\def\makeeol #1{\catcode`#1=5 }
+\def\makeparm #1{\catcode`#1=6 }
+\def\makesup #1{\catcode`#1=7 }
+\def\makesub #1{\catcode`#1=8 }
+\def\makeignore#1{\catcode`#1=9 }
+\def\makespace #1{\catcode`#1=10 }
+\def\makeletter#1{\catcode`#1=11 }
+\chardef\other=12
+\let\makeother\@makeother
+\def\makeactive#1{\catcode`#1=13 }
+\def\makecomment#1{\catcode`#1=14 }
+\def\savecat#1{%
+ \expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}}
+\def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname}
+\def\SaveCS#1{\expandafter\let\csname saved@@#1\expandafter\endcsname
+ \csname#1\endcsname}
+\def\RestoreCS#1{\expandafter\let\csname#1\expandafter\endcsname
+ \csname saved@@#1\endcsname}
+\def\plaintubstyle{plain}
+\def\latextubstyle{latex}
+\providecommand\hb@xt@{\hbox to}
+\providecommand\textsuperscript[1]{\ensuremath{\m@th
+ ^{\mbox{\fontsize\sf@size\z@
+ \selectfont #1}}}}
+\def\AllTeX{(\La\kern-.075em)\kern-.075em\TeX}
+\def\AMS{American Mathematical Society}
+\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox
+ {$\mathcal{M}$}\kern-.125em$\mathcal{S}$}
+\def\AmSLaTeX{\AmS-\LaTeX}
+\def\AmSTeX{\AmS-\TeX}
+\def\aw{A\kern.1em-W}
+\def\AW{Addison\kern.1em-\penalty\z@\hskip\z@skip Wesley}
+\def\BibTeX{\textsc{Bib}\kern-.08em\TeX}
+\def\CandT{\textsl{Computers \& Typesetting}}
+\def\CTAN{\acro{CTAN}}
+\def\DTD{\acro{DTD}}
+\def\DVItoVDU{DVIto\kern-.12em VDU}
+\DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
+\def\HTML{\acro{HTML}}
+\def\ISBN{\acro{ISBN}}
+\def\ISSN{\acro{ISSN}}
+\def\JTeX{\leavevmode\hbox{\lower.5ex\hbox{J}\kern-.18em\TeX}}
+\def\JoT{\textsl{The Joy of \TeX}}
+\def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em
+ $\m@th$\fontsize\sf@size\z@\selectfont
+ $\m@th\mathcal{A}$}%
+ \kern-.2em\lower.376ex\hbox{$\m@th\mathcal{M}$}\kern-.125em
+ {$\m@th\mathcal{S}$}-\TeX}
+\newcommand{\La}%
+ {L\kern-.36em
+ {\setbox0\hbox{T}%
+ \vbox to\ht0{\hbox{$\m@th$%
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@
+ \math@fontsfalse\selectfont
+ A}%
+ \vss}%
+ }}
+\def\Mc{\setbox\TestBox=\hbox{M}M\vbox
+ to\ht\TestBox{\hbox{c}\vfil}} % for Robert McGaffey
+\def\mf{\textsc{Metafont}}
+\def\MFB{\textsl{The \MF book}}
+\let\TB@@mp\mp
+\DeclareRobustCommand\mp{\ifmmode\TB@@mp\else MetaPost\fi}
+\DeclareTextSymbol{\textohm}{OT1}{'012}
+\DeclareTextSymbolDefault{\textohm}{OT1}
+\newcommand\OMEGA{\textohm}
+\DeclareRobustCommand{\OTP}{\OMEGA\acro{TP}}
+\def\mtex{T\kern-.1667em\lower.424ex\hbox{\^E}\kern-.125emX\@}
+\DeclareRobustCommand\NTS{$\mathcal{N}$\lower.5ex\hbox
+ {$\mathcal{T}$}$\mathcal{S}$\@}
+\def\pcMF{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}MF\@}
+\def\PCTeX{PC\thinspace\TeX}
+\def\pcTeX{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}\TeX}
+\def\Pas{Pascal}
+\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\@}
+\def\PiCTeX{\PiC\kern-.11em\TeX}
+\def\plain{\texttt{plain}}
+\def\POBox{P.\thinspace O.~Box }
+\def\PS{{Post\-Script}}
+\def\SC{Steering Committee}
+\def\SGML{\acro{SGML}}
+\def\SliTeX{\textrm{S\kern-.06em\textsc{l\kern-.035emi}%
+ \kern-.06em\TeX}}
+ \def\slMF{\textsl{\MF}} % should never be used
+ \def\stTeX{\textsc{st}\kern-0.13em\TeX}
+\def\TANGLE{\texttt{TANGLE}\@}
+\def\TB{\textsl{The \TeX book}}
+\def\TP{\textsl{\TeX}: \textsl{The Program}}
+\DeclareRobustCommand\TeX{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\@}
+\def\TeXhax{\TeX hax}
+\def\TeXMaG{\TeX M\kern-.1667em\lower.5ex\hbox{A}%
+ \kern-.2267emG\@}
+\def\TeXtures{\textit{Textures}}
+\let\Textures=\TeXtures
+\def\TeXXeT{\TeX-{}-\XeT}
+\def\ttn{\textsl{TTN}\@}
+\def\TTN{\textsl{\TeX{} and TUG News}}
+\let\texttub\textsl % redefined in other situations
+\def\TUB{\texttub{TUGboat}}
+\def\TUG{\TeX\ \UG}
+\def\tug{\acro{TUG}}
+\def\UG{Users Group}
+\def\UNIX{\acro{UNIX}}
+\def\VAX{V\kern-.12em A\kern-.1em X\@}
+\def\VorTeX{V\kern-2.7\p@\lower.5ex\hbox{O\kern-1.4\p@ R}\kern-2.6\p@\TeX}
+\def\XeT{X\kern-.125em\lower.424ex\hbox{E}\kern-.1667emT\@}
+\def\WEB{\texttt{WEB}\@}
+\def\WEAVE{\texttt{WEAVE}\@}
+\newlinechar=`\^^J
+\normallineskiplimit=\p@
+\clubpenalty=10000
+\widowpenalty=10000
+\def\NoParIndent{\parindent=\z@}
+\newdimen\normalparindent
+\normalparindent=20\p@
+\def\NormalParIndent{\global\parindent=\normalparindent}
+\NormalParIndent
+\def\BlackBoxes{\overfullrule=5\p@}
+\def\NoBlackBoxes{\overfullrule=\z@}
+\def\newline{\hskip\z@\@plus\pagewd\break}
+\edef\allowhyphens{\noexpand\hyphenpenalty\the\hyphenpenalty\relax
+ \noexpand\exhyphenpenalty\the\exhyphenpenalty\relax}
+\def\nohyphens{\hyphenpenalty\@M\exhyphenpenalty\@M}
+\newbox\T@stBox \newbox\TestBox
+\newcount\T@stCount \newcount\TestCount
+\newdimen\T@stDimen \newdimen\TestDimen
+\newif\ifT@stIf \newif\ifTestIf
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }
+\newif\iftop@ \newif\ifbot@
+\def\topsmash{\top@true\bot@false\smash@}
+\def\botsmash{\top@false\bot@true\smash@}
+\def\smash{\top@true\bot@true\smash@}
+\def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}%
+ \else\let\next\makesm@sh\fi \next }
+\def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@}
+\long\def\ulap#1{\vbox to \z@{\vss#1}}
+\long\def\dlap#1{\vbox to \z@{#1\vss}}
+\def\xlap#1{\hb@xt@\z@{\hss#1\hss}}
+\long\def\ylap#1{\vbox to \z@{\vss#1\vss}}
+\long\def\zlap#1{\ylap{\xlap{#1}}}
+\def\basezero{\baselineskip\z@skip \lineskip\z@skip}
+\def\nullhrule{\hrule \@height\z@ \@depth\z@ \@width\z@ }
+\def\nullvrule{\vrule \@height\z@ \@depth\z@ \@width\z@ }
+\def\makestrut[#1;#2]{\vrule \@height#1 \@depth#2 \@width\z@ }
+\def\drawoutlinebox[#1;#2;#3]{\T@stDimen=#3
+ \vbox to#1{\hrule \@height\T@stDimen \@depth\z@
+ \vss\hb@xt@#2{\vrule \@width\T@stDimen
+ \hfil\makestrut[#1;\z@]%
+ \vrule \@width\T@stDimen}\vss
+ \hrule \@height\T@stDimen \@depth\z@}}
+\newcount\hours
+\newcount\minutes
+\def\SetTime{\hours=\time
+ \global\divide\hours by 60
+ \minutes=\hours
+ \multiply\minutes by 60
+ \advance\minutes by-\time
+ \global\multiply\minutes by-1 }
+\SetTime
+\def\now{\number\hours:\ifnum\minutes<10 0\fi\number\minutes}
+\def\Now{\today\ \now}
+\newif\ifPrelimDraft
+\def\midrtitle{\ifPrelimDraft {\textsl{preliminary draft, \Now}}\fi}
+\newdimen\raggedskip \raggedskip=\z@
+\newdimen\raggedstretch \raggedstretch=5em % ems of font set now (10pt)
+\newskip\raggedparfill \raggedparfill=\z@\@plus 1fil
+\def\raggedspaces{\spaceskip=.3333em \relax \xspaceskip=.5em \relax }
+\def\raggedright{%
+ \nohyphens
+ \rightskip=\raggedskip\@plus\raggedstretch \raggedspaces
+ \parfillskip=\raggedparfill }
+\def\raggedleft{%
+ \nohyphens
+ \leftskip=\raggedskip\@plus\raggedstretch \raggedspaces
+ \parfillskip=\z@skip }
+\def\raggedcenter{%
+ \nohyphens
+ \leftskip=\raggedskip\@plus\raggedstretch
+ \rightskip=\leftskip \raggedspaces
+ \parindent=\z@ \parfillskip=\z@skip }
+\def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip }
+\DeclareRobustCommand{\nobreakspace}{%
+ \unskip\nobreak\ \ignorespaces}
+\def\boxcs#1{\box\csname#1\endcsname}
+\def\setboxcs#1{\setbox\csname#1\endcsname}
+\def\newboxcs#1{\expandafter\newbox\csname#1\endcsname}
+\let\gobble\@gobble
+\def\vellipsis{%
+ \leavevmode\kern0.5em
+ \raise\p@\vbox{\baselineskip6\p@\vskip7\p@\hbox{.}\hbox{.}\hbox{.}}
+ }
+\def\bull{\vrule \@height 1ex \@width .8ex \@depth -.2ex }
+\def\cents{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}}
+\def\Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}}
+\def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em
+ /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces}
+\DeclareRobustCommand\sfrac[1]{\@ifnextchar/{\@sfrac{#1}}%
+ {\@sfrac{#1}/}}
+\def\@sfrac#1/#2{\leavevmode\kern.1em\raise.5ex
+ \hbox{$\m@th\mbox{\fontsize\sf@size\z@
+ \selectfont#1}$}\kern-.1em
+ /\kern-.15em\lower.25ex
+ \hbox{$\m@th\mbox{\fontsize\sf@size\z@
+ \selectfont#2}$}}
+\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
+\DeclareRobustCommand\meta[1]{%
+ \ensuremath{\langle}\emph{#1}\ensuremath{\rangle}}
+\DeclareRobustCommand\env[1]{%
+ \cs{begin}\texttt{\char`\{#1\char`\}}}
+\def\thinskip{\hskip 0.16667em\relax}
+\def\endash{--}
+\def\emdash{\endash-}
+\def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
+\def\dash{\d@sh\nobreak\endash}
+\def\Dash{\d@sh\nobreak\emdash}
+\def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}}
+\def\rdash{\d@sh\nobreak\endash}
+\def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}}
+\def\Rdash{\d@sh\nobreak\emdash}
+\def\hyph{-\penalty\z@\hskip\z@skip }
+\def\slash{/\penalty\z@\hskip\z@skip }
+\def\nth#1{%
+ \def\reserved@a##1##2\@nil{\ifcat##1n%
+ 0%
+ \let\reserved@b\ensuremath
+ \else##1##2%
+ \let\reserved@b\relax
+ \fi}%
+ \TestCount=\reserved@a#1\@nil\relax
+ \ifnum\TestCount <0 \multiply\TestCount by\m@ne \fi % subdue negatives
+ \T@stCount=\TestCount
+ \divide\T@stCount by 100 \multiply\T@stCount by 100
+ \advance\TestCount by-\T@stCount % n mod 100
+ \ifnum\TestCount >20 \T@stCount=\TestCount
+ \divide\T@stCount by 10 \multiply\T@stCount by 10
+ \advance\TestCount by-\T@stCount % n mod 10
+ \fi
+ \reserved@b{#1}%
+ \textsuperscript{\ifcase\TestCount th% 0th
+ \or st% 1st
+ \or nd% 2nd
+ \or rd% 3rd
+ \else th% nth
+ \fi}%
+ }
+\def\Review{\@ifnextchar:{\@Review}{\@Review:}}
+\def\@Review:{\@ifnextchar[%]
+ {\@Rev}%
+ {\@Rev[Book review]}}
+\def\@Rev[#1]#2{{\ignorespaces#1\unskip:\enspace\ignorespaces
+ \slshape\mdseries#2}}
+\def\reviewitem{\addvspace{\BelowTitleSkip}%
+ \def\revauth##1{\def\therevauth{##1, }\ignorespaces}%
+ \def\revtitle##1{\def\therevtitle{{\slshape##1}. }\ignorespaces}%
+ \def\revpubinfo##1{\def\therevpubinfo{##1.}\ignorespaces}%
+ }
+\def\endreviewitem{{\noindent\interlinepenalty=10000
+ \therevauth\therevtitle\therevpubinfo\endgraf}%
+ \vskip\medskipamount
+ }
+\def\booktitle#1{{\slshape#1\/}}
+\newcount\issueseqno \issueseqno=-1
+\def\v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}}
+\def\volyr{}
+\def\volno{}
+\def\vol #1,#2.{\gdef\volno{#1\unskip}%
+ \gdef\issno{\ignorespaces#2\unskip}%
+ \setbox\TestBox=\hbox{\volyr}%
+ \ifdim \wd\TestBox > .2em \v@lx \fi }
+\def\issdate #1#2 #3.{\gdef\issdt{#1#2 #3}\gdef\volyr{#3}%
+ \gdef\bigissdt{#1{\smc\uppercase{#2}} #3}%
+ \setbox\TestBox=\hbox{\volno}%
+ \ifdim \wd\TestBox > .2em \v@lx \fi }
+\vol 0, 0.
+\issdate Thermidor, 2001.
+\def\tubissue#1{\@ifnextchar(%)
+ {\@tubissue@b{#1}}
+ {\@tubissue@a{#1}}}
+\def\@tubissue@b#1(#2){\@tubissue@a{#1}{#2}}
+\def\@tubissue@a#1#2%
+ {\TUB~#1, no.~#2}
+\def\infil@{\jobname}
+\def\Input #1 {\ifnum\issueseqno<0
+ \def\infil@{#1}%
+ \else
+ \def\infil@{tb\number\issueseqno#1}
+ \fi
+ \edef\jobname{\infil@}\@readFLN
+ \@@input \infil@\relax
+ \if@RMKopen
+ \immediate\closeout\@TBremarkfile\@RMKopenfalse
+ \fi
+}
+\newif\if@RMKopen \@RMKopenfalse
+\newwrite\@TBremarkfile
+\def\@TBremark#1{%
+ \if@RMKopen
+ \else
+ \@RMKopentrue\immediate\openout\@TBremarkfile=\infil@.rmk
+ \fi
+ \toks@={#1}%
+ \immediate\write\@TBremarkfile{^^J\the\toks@}%
+ \immediate\write16{^^JTBremark:: \the\toks@^^J}%
+}
+\let\TBremark=\gobble
+\def\TBEnableRemarks{\let\TBremark\@TBremark}
+\def\TUBedit#1{}
+\def\TUBfilename#1#2{\expandafter\def\csname file@@#1\endcsname{#2}}
+\InputIfFileExists{\jobname.fln}%
+ {\TBInfo{Reading alternative file file \jobname.fln}}{}
+\def\@tubfilename#1{\expandafter\ifx\csname file@@#1\endcsname\relax
+ #1\else\csname file@@#1\endcsname\fi}
+\def\fileinput#1{\@@input\@tubfilename{#1} }
+\def\pagexrefON#1{%
+ \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
+ \write\ppoutfile{%
+ \def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
+ }
+\def\PageXrefON#1{%
+ \immediate\write-1{\def\expandafter
+ \noexpand\csname#1\endcsname{\number\c@page}}%
+ \immediate\write\ppoutfile{\def\expandafter
+ \noexpand\csname#1\endcsname{\number\c@page}}}
+\def\pagexrefOFF#1{}
+\let\pagexref=\pagexrefOFF
+\def\PageXrefOFF#1{}
+\let\PageXref=\PageXrefOFF
+\def\xreftoON#1{%
+ \ifundefined{#1}%
+ ???\TBremark{Need cross reference for #1.}%
+ \else\csname#1\endcsname\fi}
+\def\xreftoOFF#1{???}
+\let\xrefto=\xreftoOFF
+\let\TBdriver\gobble
+\hyphenation{Eijk-hout Hara-lam-bous man-u-script man-u-scripts}
+\PrelimDrafttrue
+\textheight 54pc
+\textwidth 39pc
+\columnsep 1.5pc
+\columnwidth 18.75pc
+\parindent \normalparindent
+\parskip \z@ % \@plus\p@
+\leftmargini 2em
+\leftmarginv .5em
+\leftmarginvi .5em
+\oddsidemargin \z@
+\evensidemargin \z@
+\topmargin -2.5pc
+\headheight 12\p@
+\headsep 20\p@
+\marginparwidth 48\p@
+\marginparsep 10\p@
+\partopsep=\z@
+\topsep=3\p@\@plus\p@\@minus\p@
+\parsep=3\p@\@plus\p@\@minus\p@
+\itemsep=\parsep
+\twocolumn
+\newdimen\pagewd \pagewd=39pc
+\newdimen\trimwd \trimwd=\pagewd
+\newdimen\trimlgt \trimlgt=11in
+\newdimen\headmargin \headmargin=3.5pc
+\newcommand\DeclareLaTeXLogo[5]{\expandafter\def
+ \csname @LaTeX@#1/#2/#3\endcsname{{#4}{#5}}}
+\def\@LaTeX@default{{.36}{.15}}
+\DeclareLaTeXLogo{cmss}{bx}n{.3}{.15}
+\DeclareLaTeXLogo{cmr}m{it}{.3}{.27}
+\DeclareLaTeXLogo{cmr}{bx}{it}{.3}{.27}
+\DeclareRobustCommand\LaTeX{\expandafter\let\expandafter\reserved@a
+ \csname @LaTeX@\f@family/\f@series/\f@shape\endcsname
+ \ifx\reserved@a\relax\let\reserved@a\@LaTeX@default\fi
+ \expandafter\@LaTeX\reserved@a}
+\newcommand\@LaTeX[2]{L\kern-#1em
+ {\sbox\z@ T%
+ \vbox to\ht0{\hbox{$\m@th$%
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@
+ \math@fontsfalse\selectfont
+ A}%
+ \vss}%
+ }%
+ \kern-#2em%
+ \TeX}
+\def\theauthor#1{\csname theauthor#1\endcsname}
+\def\theaddress#1{\csname theaddress#1\endcsname}
+\def\thenetaddress#1{\csname thenetaddress#1\endcsname}
+\def\thePersonalURL#1{\csname thePersonalURL#1\endcsname}
+\def\@defaultauthorlist{%
+ \count@\authornumber
+ \advance\count@ by -2
+ \@tempcnta0
+ \loop
+ \ifnum\count@>0
+ \advance\@tempcnta by \@ne
+ \ignorespaces\theauthor{\number\@tempcnta}\unskip,
+ \advance\count@ by \m@ne
+ \repeat
+ \count@\authornumber
+ \advance\count@ by -\@tempcnta
+ \ifnum\authornumber>0
+ \ifnum\count@>1
+ \count@\authornumber
+ \advance\count@ by \m@ne
+ \ignorespaces\theauthor{\number\count@}\unskip\ and
+ \fi
+ \ignorespaces\theauthor{\number\authornumber}\unskip
+ \fi
+}
+\def\signature#1{\def\@signature{#1}}
+\def\@signature{\@defaultsignature}
+\def\@defaultsignature{{%
+ \let\thanks\@gobble
+ \ifnum\authornumber<0
+ \medskip
+ \signaturemark
+ \theauthor{\number\authornumber}\\
+ \theaddress{\number\authornumber}\\
+ \allowhyphens
+ \thenetaddress{\number\authornumber}\\
+ \thePersonalURL{\number\authornumber}\\
+ \else
+ \count@=0
+ \loop
+ \ifnum\count@<\authornumber
+ \medskip
+ \advance\count@ by \@ne
+ \signaturemark
+ \theauthor{\number\count@}\\
+ \theaddress{\number\count@}\\
+ {%
+ \allowhyphens
+ \thenetaddress{\number\count@}\\
+ \thePersonalURL{\number\count@}\\
+ }%
+ \repeat
+ \fi
+ }%
+}
+\newdimen\signaturewidth \signaturewidth=12pc
+\newcommand\makesignature[1][\medskipamount]{%
+ \@tempdima\signaturewidth
+ \advance\@tempdima 1.5pc
+ \ifdim \@tempdima>\columnwidth
+ \signaturewidth \columnwidth
+ \advance\signaturewidth -1.5pc
+ \fi
+ \par
+ \penalty9000
+ \vspace{#1}%
+ \rightline{%
+ \vbox{\hsize\signaturewidth \ninepoint \raggedright
+ \parindent \z@ \everypar={\hangindent 1pc }
+ \parskip \z@skip
+ \def\|{\unskip\hfil\break}%
+ \def\\{\endgraf}%
+ \def\phone{\rm Phone: }
+ \rm\@signature}%
+ }%
+ \ifnum\authornumber<0 \endgroup\fi
+}
+\def\signaturemark{\leavevmode\llap{$\diamond$\enspace}}
+\newcount\authornumber
+\authornumber=0
+\def\author{%
+ \global\advance\authornumber\@ne
+ \TB@author
+}
+\def\contributor{%
+ \begingroup
+ \authornumber\m@ne
+ \TB@author
+}
+\def\TB@author#1{%
+ \expandafter\def\csname theauthor\number\authornumber\endcsname
+ {\ignorespaces#1\unskip}%
+ \expandafter\def\csname theaddress\number\authornumber\endcsname
+ {\TBWarning{Address for #1\space missing}\@gobble}%
+ \expandafter\def\csname thenetaddress\number\authornumber\endcsname
+ {\TBWarning{Net address for #1\space missing}\@gobble}%
+ \expandafter\let\csname thePersonalURL\number\authornumber\endcsname
+ \@gobble
+ }
+\def\address#1{%
+ \expandafter\def\csname theaddress\number\authornumber\endcsname
+ {\leavevmode\ignorespaces#1\unskip}}
+\def\network#1{\def\@network{#1: }}
+\newcommand\netaddress[1][\relax]{%
+ \begingroup
+ \def\@network{}%
+ #1\@sanitize\makespace\ \makeactive\@
+ \makeactive\.\makeactive\%\@relay@netaddress}%
+\def\@relay@netaddress#1{%
+ \ProtectNetChars
+ \expandafter\protected@xdef
+ \csname thenetaddress\number\authornumber\endcsname
+ {\protect\leavevmode\textrm{\@network}%
+ {\protect\NetAddrChars\net
+ \ignorespaces#1\unskip}}%
+ \endgroup
+ }
+\def\personalURL{\begingroup
+ \@sanitize\makespace\ \makeactive\@
+ \makeactive\.\makeactive\%\makeactive\/\@personalURL}%
+\def\@personalURL#1{%
+ \ProtectNetChars
+ \expandafter\protected@xdef
+ \csname thePersonalURL\number\authornumber\endcsname{%
+ \protect\leavevmode
+ {%
+ \protect\URLchars\net
+ \ignorespaces#1\unskip
+ }%
+ }%
+ \endgroup
+ }
+{%
+ \makecomment\*
+ \makeactive\@
+ \gdef\netaddrat{\makeactive\@*
+ \def@{\discretionary{\char"40}{}{\char"40}}}
+ \makeactive\%
+ \gdef\netaddrpercent{\makeactive\%*
+ \def%{\discretionary{\char"25}{}{\char"25}}}
+ \makeactive\.
+ \gdef\netaddrdot{\makeactive\.*
+ \def.{\discretionary{\char"2E}{}{\char"2E}}}
+ \gdef\NetAddrChars{\netaddrat \netaddrpercent \netaddrdot}
+ \makeactive\/
+ \gdef\URLchars{*
+ \NetAddrChars
+ \makeactive\/*
+ \def/{\discretionary{\char"2F}{}{\char"2F}}}
+ \gdef\ProtectNetChars{*
+ \def@{\protect@}*
+ \def%{\protect%}*
+ \def.{\protect.}*
+ \def/{\protect/}*
+ }
+}
+\if@compatibility
+ \DeclareRobustCommand\net{\normalfont\ttfamily\mathgroup\symtypewriter}
+\else
+ \DeclareOldFontCommand{\net}{\ttfamily\upshape\mdseries}{\mathtt}
+\fi
+\def\authorlist#1{\def\@author{#1}}
+\def\@author{\@defaultauthorlist}
+\def\maketitle{\par
+ \ifdim\PreTitleDrop > \z@
+ \loop
+ \ifdim \PreTitleDrop > \textheight
+ \vbox{}\vfil\eject
+ \advance\PreTitleDrop by -\textheight
+ \repeat
+ \vbox to \PreTitleDrop{}
+ \global\PreTitleDrop=\z@
+ \fi
+ \begingroup
+ \setcounter{footnote}{0}
+ \def\thefootnote{\fnsymbol{footnote}}
+ \@maketitle
+ \@thanks
+ \endgroup
+ \setcounter{footnote}{0}
+ \gdef\@thanks{}
+ }
+\def\secsep{\vskip 5\baselineskip}
+\newdimen\stbaselineskip \stbaselineskip=18\p@
+\newdimen\stfontheight
+ \settoheight{\stfontheight}{\sectitlefont O}
+\newif\ifSecTitle
+\SecTitlefalse
+\newif\ifWideSecTitle
+\newcommand\sectitle{%
+ \SecTitletrue
+ \@ifstar
+ {\WideSecTitletrue\def\s@ctitle}%
+ {\WideSecTitlefalse\def\s@ctitle}%
+}
+\newdimen\PreTitleDrop \PreTitleDrop=\z@
+\newskip\AboveTitleSkip \AboveTitleSkip=12\p@
+\newskip\BelowTitleSkip \BelowTitleSkip=8\p@
+\newdimen\strulethickness \strulethickness=.6\p@
+\def\@sectitle #1{%
+ \par
+ \penalty-1000
+ \ifWideSecTitle\else\secsep\fi
+ {%
+ \fboxrule\strulethickness
+ \fboxsep\z@
+ \noindent\framebox[\hsize]{%
+ \raggedcenter
+ \def\\{\unskip\break}%
+ \sectitlefont
+ \makestrut[2\stfontheight;\z@]%
+ #1%
+ \makestrut[\z@;\stfontheight]\endgraf
+ }%
+ }%
+ \nobreak
+ \vskip\baselineskip
+}
+\def\@makesectitle{\ifSecTitle
+ \global\SecTitlefalse
+ \ifWideSecTitle
+ \twocolumn[\@sectitle{\s@ctitle}]%
+ \global\WideSecTitlefalse
+ \else
+ \@sectitle{\s@ctitle}%
+ \fi
+ \else
+ \vskip\AboveTitleSkip
+ \kern\topskip
+ \hrule \@height\z@ \@depth\z@ \@width 10\p@
+ \kern-\topskip
+ \kern-\strulethickness
+ \hrule \@height\strulethickness \@depth\z@
+ \kern\medskipamount
+ \nobreak
+ \fi
+}
+\def\@maketitle{\@makesectitle
+ {%
+ \nohyphens \interlinepenalty\@M
+ \setbox0=\hbox{%
+ \let\thanks\@gobble
+ \let\\=\quad
+ \let\and=\quad
+ \ignorespaces\@author}%
+ {%
+ \noindent\bf\raggedright\ignorespaces\@title\endgraf
+ }%
+ \ifdim \wd0 < 5\p@ % omit if author is null
+ \else
+ \nobreak \vskip 4\p@
+ {%
+ \leftskip=\normalparindent
+ \raggedright
+ \def\and{\unskip\\}%
+ \noindent\@author\endgraf
+ }%
+ \fi
+ \nobreak
+ \vskip\BelowTitleSkip
+ }%
+ \global\@afterindentfalse
+ \aftergroup\@afterheading
+}
+\newenvironment{dedication}%
+ {\raggedright\noindent\itshape\ignorespaces}%
+ {\endgraf\medskip}
+\renewenvironment{abstract}%
+ {%
+ \begin{SafeSection}%
+ \section*{Abstract}%
+ }%
+ {\end{SafeSection}}
+\newenvironment{longabstract}%
+ {%
+ \begin{SafeSection}%
+ \section*{Abstract}%
+ \bgroup\small
+ }%
+ {%
+ \endgraf\egroup
+ \end{SafeSection}%
+ \vspace{.25\baselineskip}
+ \begin{center}
+ {$--*--$}
+ \end{center}
+ \vspace{.5\baselineskip}}
+\if@numbersec
+ \def\section{\TB@startsection{{section}%
+ 1%
+ \z@
+ {-8\p@}%
+ {4\p@}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\subsection{\TB@startsection{{subsection}%
+ 2%
+ \z@
+ {-8\p@}%
+ {4\p@}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\subsubsection{\TB@startsection{{subsubsection}%
+ 3%
+ \z@
+ {-8\p@}%
+ {4\p@}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\paragraph{\TB@startsection{{paragraph}%
+ 4%
+ \z@
+ {2.5ex\@plus 1ex}%
+ {-1em}%
+ {\normalsize\bf}}}
+\else
+ \setcounter{secnumdepth}{0}
+ \def\section{\TB@nolimelabel
+ \TB@startsection{{section}%
+ 1%
+ \z@
+ {-8\p@}%
+ {4\p@}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\subsection{\TB@nolimelabel
+ \TB@startsection{{subsection}%
+ 2%
+ \z@
+ {-8\p@}%
+ {-0.5em\@plus-\fontdimen3\font}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\subsubsection{\TB@nolimelabel
+ \TB@startsection{{subsubsection}%
+ 3%
+ \parindent
+ {-8\p@}%
+ {-0.5em\@plus-\fontdimen3\font}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+\fi
+\def\TB@startsection#1{\@ifstar
+ {\TBWarning{*-form of \expandafter\string\csname\@firstofsix#1%
+ \endcsname\space inappropriate}%
+ \@startsection#1}%
+ {\@startsection#1}}
+\def\@firstofsix#1#2#3#4#5#6{#1}
+\def\TB@safe@startsection#1{\@startsection#1}
+\newenvironment{SafeSection}%
+ {\let\TB@startsection\TB@safe@startsection}%
+ {}
+\if@numbersec
+ \def\subparagraph{\TB@nosection\subparagraph\paragraph}
+\else
+ \def\paragraph{\TB@nosection\paragraph\subsubsection}
+ \def\subparagraph{\TB@nosection\subparagraph\subsubsection}
+\fi
+\def\chapter{\TB@nosection\chapter\section}
+\def\part{\TB@nosection\part\section}
+\def\TB@nosection#1#2{\TBWarning{class does not support \string#1,
+ \string#2\space used instead}#2}
+\def\l@section#1#2{\addpenalty{\@secpenalty}%
+ \addvspace{1.0em\@plus\p@}%
+ \@tempdima 1.5em
+ \begingroup
+ \parindent\z@ \rightskip\z@ % article style makes \rightskip > 0
+ \parfillskip\z@
+ \bf\leavevmode\advance\leftskip\@tempdima\hskip-\leftskip#1\nobreak\hfil
+ \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+ \endgroup}
+\renewcommand\appendix{\par
+ \renewcommand\thesection{\@Alph\c@section}%
+ \setcounter{section}{0}%
+ \if@numbersec
+ \else
+ \setcounter{secnumdepth}{1}%
+ \fi
+ \def\@tempa{appendix}
+ \ifx\@tempa\@currenvir
+ \expandafter\@appendix@env
+ \fi
+}
+\newcommand\app@prefix@section{}
+\newcommand\@appendix@env[1][Appendix]{%
+ \renewcommand\@seccntformat[1]{\csname app@prefix@##1\endcsname
+ \csname the##1\endcsname\quad}%
+ \renewcommand\app@prefix@section{#1 }%
+}
+\let\endappendix\relax
+\def\TB@nolimelabel{\def\@currentlabel{\protect\TBWarning
+ {Invalid label on page \thepage\space used}%
+ \textbf{?!?}}}
+\let\TB@@sect\@sect
+\let\TB@@ssect\@ssect
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \def\@currentlabelname{#7}%
+ \TB@@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
+}
+\def\@ssect#1#2#3#4#5{%
+ \def\@currentlabelname{#5}%
+ \TB@@ssect{#1}{#2}{#3}{#4}{#5}%
+}
+\def\label#1{{%
+ \@bsphack
+ \let\label\@gobble
+ \let\index\@gobble
+ \if@filesw
+ \protected@write\@auxout{}%
+ {\string\newlabel{#1}{%
+ {\@currentlabel}{\thepage}{\@currentlabelname}}%
+ }%
+ \fi
+ \@esphack
+ }%
+}
+\let\@currentlabelname\@empty
+\DeclareRobustCommand\ref[1]{\expandafter\@setref
+ \csname r@#1\endcsname\@firstofthree{#1}}
+\DeclareRobustCommand\pageref[1]{\expandafter\@setref
+ \csname r@#1\endcsname\@secondofthree{#1}}
+\DeclareRobustCommand\nameref[1]{\expandafter\@setref
+ \csname r@#1\endcsname\@thirdofthree{#1}}
+\long\def\@firstofthree#1#2#3{#1}
+\long\def\@secondofthree#1#2#3{#2}
+\long\def\@thirdofthree#1#2#3{#3}
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ \raggedright\hyphenpenalty=\@M
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+\renewcommand\normalsize{%
+ \@setfontsize\normalsize\@xpt\@xiipt
+ \abovedisplayskip=3\p@\@plus 3\p@\@minus\p@
+ \belowdisplayskip=\abovedisplayskip
+ \abovedisplayshortskip=\z@\@plus 3\p@
+ \belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@
+}
+
+\renewcommand\small{%
+ \@setfontsize\small\@ixpt{11}%
+ \abovedisplayskip=2.5\p@\@plus 2.5\p@\@minus\p@
+ \belowdisplayskip=\abovedisplayskip
+ \abovedisplayshortskip=\z@\@plus 2\p@
+ \belowdisplayshortskip=\p@\@plus 2\p@\@minus\p@
+}
+\renewcommand\footnotesize{%
+ \@setfontsize\footnotesize\@viiipt{9.5}%
+ \abovedisplayskip=3\p@\@plus 3\p@\@minus\p@
+ \belowdisplayskip=\abovedisplayskip
+ \abovedisplayshortskip=\z@\@plus 3\p@
+ \belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@
+}
+\def\@listi{%
+ \leftmargin\leftmargini\parsep=\p@\@plus\p@\@minus\p@
+ \itemsep=\parsep
+ \listparindent=1em
+ }
+
+\def\@listii{%
+ \leftmargin\leftmarginii
+ \labelwidth=\leftmarginii \advance\labelwidth-\labelsep
+ \topsep=2\p@\@plus\p@\@minus\p@
+ \parsep=\p@\@plus\p@\@minus\p@
+ \itemsep=\parsep
+ \listparindent=1em
+ }
+
+\def\@listiii{%
+ \leftmargin=\leftmarginiii
+ \labelwidth=\leftmarginiii \advance\labelwidth-\labelsep
+ \topsep=\p@\@plus\p@\@minus\p@
+ \parsep=\z@
+ \itemsep=\topsep
+ \listparindent=1em
+ }
+\def\quote{\list{}{\rightmargin.5\leftmargin}\item[]}
+\renewcommand{\quotation}{\list{}{\listparindent 1.5em
+ \rightmargin.5\leftmargin\parsep \z@\@plus\p@}\item[]}
+\let\@TBverbatim\verbatim
+\let\@TBendverbatim\endverbatim
+\def\verbatim{\futurelet\reserved@a\@switch@sqbverbatim}
+\def\@switch@sqbverbatim{\ifx\reserved@a[%]
+ \expandafter\@sqbverbatim\else
+ \def\reserved@b{\@sqbverbatim[]}\expandafter\reserved@b\fi}
+\def\@sqbverbatim[#1]{%
+ \def\ruled{\let\if@ruled\iftrue}%
+ #1\@TBverbatim}
+\def\@verbatim{%
+ \if@ruled\trivlist\item\hrule\kern5\p@\nobreak\fi
+ \trivlist \item\relax
+ \if@minipage\else\vskip\parskip\fi
+ \leftskip\@totalleftmargin\rightskip\z@skip
+ \parindent\z@\parfillskip\@flushglue\parskip\z@skip
+ \@@par
+ \@tempswafalse
+ \def\par{%
+ \if@tempswa
+ \leavevmode \null \@@par\penalty\interlinepenalty
+ \else
+ \@tempswatrue
+ \ifhmode\@@par\penalty\interlinepenalty\fi
+ \fi}%
+ \obeylines \verbatim@font \@noligs
+ \let\do\@makeother \dospecials
+ \everypar \expandafter{\the\everypar \unpenalty}%
+}%
+\def\endverbatim{\@TBendverbatim
+ \if@ruled\kern5\p@\hrule\endtrivlist\fi}
+{\makeactive<
+ \gdef<#1>{{\reset@font\ensuremath{\langle}%
+ \textit{#1}%
+ \ensuremath{\rangle}}}
+}
+\let\if@ruled\iffalse
+\if@Harvardcite
+\let\@internalcite\cite
+\def\cite{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
+\def\citeNP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
+\def\citeN{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}%
+ \def\citeauthoryear##1##2##3{##1 (##3}\@citedata}
+\def\citeA{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##1}\@internalcite}
+\def\citeANP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##1}\@internalcite}
+\def\shortcite{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
+\def\shortciteNP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
+\def\shortciteN{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}%
+ \def\citeauthoryear##1##2##3{##2 (##3}\@citedata}
+\def\shortciteA{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##2}\@internalcite}
+\def\shortciteANP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##2}\@internalcite}
+\def\citeyear{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##3}\@citedata}
+\def\citeyearNP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##3}\@citedata}
+\def\@citedata{%
+ \@ifnextchar [{\@tempswatrue\@citedatax}%
+ {\@tempswafalse\@citedatax[]}%
+}
+
+\def\@citedatax[#1]#2{%
+\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
+ \def\@citea{}\@cite{\@for\@citeb:=#2\do%
+ {\@citea\def\@citea{, }\@ifundefined% by Young
+ {b@\@citeb}{{\bf ?}%
+ \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
+{\csname b@\@citeb\endcsname}}}{#1}}%
+\def\@citex[#1]#2{%
+\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
+ \def\@citea{}\@cite{\@for\@citeb:=#2\do%
+ {\@citea\def\@citea{; }\@ifundefined% by Young
+ {b@\@citeb}{{\bf ?}%
+ \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
+{\csname b@\@citeb\endcsname}}}{#1}}%
+\def\@biblabel#1{}
+\newlength{\bibhang}
+\setlength{\bibhang}{2em}
+\newdimen\bibindent
+\bibindent=1.5em
+\@ifundefined{refname}%
+ {\newcommand{\refname}{References}}%
+ {}%
+\def\thebibliography#1{\let\TB@startsection\TB@safe@startsection
+ \section*{\refname\@mkboth
+ {\uppercase{\refname}}{\uppercase{\refname}}}\list
+ {[\arabic{enumi}]}{%
+ \labelwidth\z@ \labelsep\z@
+ \leftmargin\bibindent
+ \itemindent -\bibindent
+ \listparindent \itemindent
+ \parsep \z@
+ \usecounter{enumi}}
+ \def\newblock{}
+ \sloppy
+ \sfcode`\.=1000\relax}
+\def\etal{et\,al.\@}
+\def\bibentry{\smallskip
+ \hangindent=\parindent
+ \hangafter=1
+ \noindent
+ \sloppy
+ \clubpenalty500 \widowpenalty500
+ \frenchspacing}
+\def\bibliography#1{%
+ \if@filesw\immediate\write\@auxout{\string\bibdata{\@tubfilename{#1}}}\fi
+ \@input{\jobname.bbl}}
+
+\def\bibliographystyle#1{\if@filesw\immediate\write\@auxout
+ {\string\bibstyle{\@tubfilename{#1}}}\fi}
+\else
+\let\TB@save@thebibliography\thebibliography
+\def\thebibliography{\let\TB@startsection\TB@safe@startsection
+ \TB@save@thebibliography}
+\fi
+\def\HorzR@gisterRule{\vrule \@height 0.2\p@ \@depth\z@ \@width 0.5in }
+\def\DownShortR@gisterRule{\vrule \@height 0.2\p@ \@depth 1pc \@width 0.2\p@ }
+\def\UpShortR@gisterRule{\vrule \@height 1pc \@depth\z@ \@width 0.2\p@ }
+\def\ttopregister{\dlap{%
+ \hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
+ \HorzR@gisterRule \hfil \HorzR@gisterRule}%
+ \hb@xt@\trimwd{\hfil \DownShortR@gisterRule \hfil}}}
+\def\tbotregister{\ulap{%
+ \hb@xt@\trimwd{\hfil \UpShortR@gisterRule \hfil}%
+ \hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
+ \HorzR@gisterRule \hfil \HorzR@gisterRule}}}
+\def\topregister{\ttopregister}
+\def\botregister{\tbotregister}
+\def \rtitlex{\def\texttub##1{{\normalsize\textrm{##1}}}\TUB, \volx }
+
+\def\PrelimDraftfooter{%
+ \dlap{\kern\textheight\kern3pc
+ \rlap{\hb@xt@\pagewd{\midrtitle\hfil\midrtitle}}
+ }}
+
+\def\MakeRegistrationMarks{}
+\def\UseTrimMarks{%
+ \def\MakeRegistrationMarks{%
+ \ulap{\rlap{%
+ \vbox{\dlap{\vbox to\trimlgt{\vfil\botregister}}%
+ \topregister\vskip \headmargin \vskip 10\p@}}}}%
+ }
+
+\def\@oddhead{\MakeRegistrationMarks\PrelimDraftfooter
+ \normalsize\csname normalshape\endcsname\rm
+ \rtitlex\qquad\midrtitle \hfil \thepage}
+\def\@evenhead{\MakeRegistrationMarks\PrelimDraftfooter
+ \normalsize\csname normalshape\endcsname\rm
+ \thepage\hfil\midrtitle\qquad\rtitlex}
+\def\@oddfoot{}
+\def\@evenfoot{}
+\def\ps@headings{}
+\pagestyle{headings}
+\def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse
+ \global\setbox\@leftcolumn\box\@outputbox
+ \global\brokenpenalty10000
+ \else \global\@firstcolumntrue
+ \global\brokenpenalty100
+ \setbox\@outputbox\vbox{\hb@xt@\textwidth{\hb@xt@\columnwidth
+ {\box\@leftcolumn \hss}\hfil \vrule \@width\columnseprule\hfil
+ \hb@xt@\columnwidth{\box\@outputbox \hss}}}\@combinedblfloats
+ \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn
+ \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup
+ \fi}
+\newif\ifFirstPar \FirstParfalse
+\def\smc{\sc}
+\def\ninepoint{\small}
+\DeclareRobustCommand\SMC{%
+ \ifx\@currsize\normalsize\small\else
+ \ifx\@currsize\small\footnotesize\else
+ \ifx\@currsize\footnotesize\scriptsize\else
+ \ifx\@currsize\large\normalsize\else
+ \ifx\@currsize\Large\large\else
+ \ifx\@currsize\LARGE\Large\else
+ \ifx\@currsize\scriptsize\tiny\else
+ \ifx\@currsize\tiny\tiny\else
+ \ifx\@currsize\huge\LARGE\else
+ \ifx\@currsize\Huge\huge\else
+ \small\SMC@unknown@warning
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+\newcommand\SMC@unknown@warning{\TBWarning{\string\SMC: unrecognised
+ text font size command -- using \string\small}}
+\newcommand\textSMC[1]{{\SMC #1}}
+\newcommand\acro[1]{\textSMC{#1}\@}
+\def\xEdNote{{\EdNoteFont Editor's note:\enspace }}
+\def \EdNote{\@ifnextchar[%]
+ {%
+ \ifvmode
+ \smallskip\noindent\let\@EdNote@\@EdNote@v
+ \else
+ \unskip\quad\def\@EdNote@{\unskip\quad}%
+ \fi
+ \@EdNote
+ }%
+ \xEdNote
+}
+\long\def\@EdNote[#1]{%
+ [\thinspace\xEdNote\ignorespaces
+ #1%
+ \unskip\thinspace]%
+ \@EdNote@
+}
+\def\@EdNote@v{\par\smallskip}
+\def\SelfDocumenting{%
+ \setlength\textwidth{31pc}
+ \onecolumn
+ \parindent \z@
+ \parskip 2\p@\@plus\p@\@minus\p@
+ \oddsidemargin 8pc
+ \evensidemargin 8pc
+ \marginparwidth 8pc
+ \toks@\expandafter{\@oddhead}%
+ \xdef\@oddhead{\hss\hb@xt@\pagewd{\the\toks@}}%
+ \toks@\expandafter{\@evenhead}%
+ \xdef\@evenhead{\hss\hb@xt@\pagewd{\the\toks@}}%
+ \def\ps@titlepage{}%
+}
+\def\ps@titlepage{}
+
+\long\def\@makefntext#1{\parindent 1em\noindent\hb@xt@2em{}%
+ \llap{\@makefnmark}\null$\mskip5mu$#1}
+
+\def\fnum@figure{{\bf Figure \thefigure}}
+\if@Harvardcite
+ \AtBeginDocument{%
+ \bibliographystyle{ltugbib}%
+ }
+\fi
+\authornumber\z@
+\let\@signature\@defaultsignature
+\InputIfFileExists{ltugboat.cfg}{\TBInfo{Loading ltugboat
+ configuration information}}{}
+\endinput
+%%
+%% End of file `ltugboat.cls'.
diff --git a/Master/texmf-dist/doc/metapost/featpost/latex/macroMan.tex b/Master/texmf-dist/doc/metapost/featpost/latex/macroMan.tex
new file mode 100644
index 00000000000..4e8c9f3a333
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/latex/macroMan.tex
@@ -0,0 +1,1737 @@
+\documentclass[a4paper]{article}
+\newif\ifpdf
+\ifx\pdfoutput\undefined
+ \pdffalse % we do not use PDFLaTeX
+\else
+ \pdfoutput=1 % we use PDFLaTeX
+ \pdftrue
+\fi
+\usepackage{linuxdoc-sgml}
+\usepackage{qwertz}
+\usepackage{url}
+\usepackage[latin1]{inputenc}
+\ifpdf
+ \usepackage[pdftex,colorlinks=true,urlcolor=blue,linkcolor=blue]{hyperref}
+ \pdfcompresslevel=9
+\else
+ \usepackage{t1enc}
+%% \usepackage[dvips]{hyperref}
+\fi
+\usepackage[english]{babel}
+\usepackage{epsfig}
+\usepackage{null}
+\def\addbibtoc{
+\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
+}%end-preamble
+\setcounter{page}{1}
+\urldef{\aaaurl} \url{http://www-math.univ-poitiers.fr/~phan/m3Dplain.html}
+\urldef{\aaburl} \url{http://directory.fsf.org/GNU/3DLDF.html}
+\urldef{\aacurl} \url{http://www.povray.org/}
+\urldef{\aadurl} \url{http://www.blender3d.org/}
+\urldef{\aaeurl} \url{http://jl.photodex.com/dog/}
+\urldef{\aafurl} \url{http://www.flexer.it/galrey/}
+\urldef{\aagurl} \url{http://lince.cii.fc.ul.pt/xcmd/xcmd.html}
+\urldef{\aahurl} \url{http://www.ctan.org/tex-archive/graphics/metapost/contrib/macros/latexmp/}
+\urldef{\aaiurl} \url{http://www.ida.liu.se/~joned/download/mps2eps/}
+\urldef{\aajurl} \url{http://matagalatlante.org/nobre/hyt/technicaldrawfromphoto.html}
+\urldef{\aakurl} \url{http://www.gnuplot.info/}
+\urldef{\aalurl} \url{http://gri.sourceforge.net/}
+\title{FEATPOST macros}
+\author{L. Nobre G., {\ttfamily http://matagalatlante.org}}
+\date{December 2004}
+\abstract{ This document intends to be an explanation of the MetaPost macros defined in the {\ttfamily FEATPOST} package. Its purpose is to draw
+ two or three-dimensional physics diagrams.
+ The {\ttfamily FEATPOST} package is supposed to help you draw figures
+ containing 3D dots, vectors, flat arrows, angles, parametric
+ lines, circles, ellipses, cones, cylinders, spheres, globes, hemispheres, toruses, elliptical frusta,
+ polygons, polyhedra, functional and parametric surfaces, direction fields, field lines
+ and trajectories in vector fields, schematic automobiles, electric charges, etc.
+ The fact that it is a programming language instead of Computer Aided Design (CAD) helps the user to experiment different figure layouts without changing specified geometric relationships among figure elements. Two of the intrinsic MetaPost features which may be important for physics
+ diagrams are: (i) the typesetting power of
+ TeX is easily called when needed and (ii) besides a sufficient
+ number of mathematical operators, geometric relationships may
+ be expressed by linear equations, without explicit assignements.
+ }
+
+
+\begin{document}
+\maketitle
+
+\section{Introduction}
+
+3D in MetaPost is not a new idea. Denis Roegel
+contributed related packages to CTAN some years ago. It was the
+subject of a 1997 TUGboat article (V18, N4, 274-283). Anthony
+Phan has been developing a very elegant package
+called
+{\em m3D} {\tt \aaaurl}
+. Due to his skilled coding, {\ttfamily m3D} can
+handle larger objects and can produce more realistic renderings than
+{\ttfamily FEATPOST}. Another possibilty is
+{\em GNU 3DLDF} {\tt \aaburl}
+.
+In any case we are talking about vector-based abstract diagrams,
+so the functionality of
+these packages is nearer to {\ttfamily GNUPLOT} than to {\ttfamily OpenGL}.
+We could also talk about {\ttfamily
+{\em POV-ray} {\tt \aacurl}
+} or
+{\ttfamily
+{\em blender} {\tt \aadurl}
+} but these
+are focused on ray-traced images, a completely different thing.
+
+Regarding software {\ttfamily FEATPOST} requires only MetaPost but
+reccomends {\ttfamily LaTeX, bash, ImageMagick, ghostscript,
+Linuxdoc, Textutils, dvips, epstopdf, sed, gv, plaympeg,
+{\em dog} {\tt \aaeurl}
+,
+{\em galrey} {\tt \aafurl}
+} and {\ttfamily
+{\em xcmd} {\tt \aagurl}
+}. Also, it is highly beneficial to
+be able to understand and cope with MetaPost error messages as
+{\ttfamily FEATPOST} has no protection against mistaken inputs. One
+probable cause of errors is the use of variables with the name of
+procedures, like
+\begin{tscreen}
+\begin{verbatim}
+X, Y, Z, N, rp, cb, ps
+\end{verbatim}
+\end{tscreen}
+All other procedure names have six or more characters.
+
+The user must be aware that MetaPost has a limited arithmetic power
+and that the author has limited programming skills,
+which may lead to unperfect 3D figures or very long processing time.
+It's advisable not to try very complex diagrams and it's recommended to
+keep 3D coordinates within order 1 (default MetaPost units).
+
+All {\ttfamily FEATPOST} macros are build apon the MetaPost
+{\ttfamily color} variable type. It looks like this:
+\begin{tscreen}
+\begin{verbatim}
+(red,green,blue)
+\end{verbatim}
+\end{tscreen}
+Its components may, nevertheless,
+be arbtitrary numbers, like:
+\begin{tscreen}
+\begin{verbatim}
+(X,Y,Z)
+\end{verbatim}
+\end{tscreen}
+So, the
+{\ttfamily color} type is adequate to define not only colors but
+also 3D points and vectors.
+
+
+\section{Small Tutorial}
+
+One very minimalistic example program could be:
+\begin{tscreen}
+\begin{verbatim}
+beginfig(1);
+ cartaxes(1,1,1);
+endfig;
+end;
+\end{verbatim}
+\end{tscreen}
+where {\ttfamily cartaxes} is a
+{\ttfamily FEATPOST} macro that produces
+the Cartesian referential.
+
+One small example program may be:
+\begin{tscreen}
+\begin{verbatim}
+f := 5.4*(1.5,0.5,1);
+Spread := 30;
+beginfig(1);
+ numeric gridstep, sidenumber, i, j, coord, aa, ab, ac;
+ color pa;
+ gridstep = 0.9;
+ sidenumber = 10;
+ coord = 0.5*sidenumber*gridstep;
+ for i=0 upto sidenumber:
+ for j=0 upto sidenumber:
+ pa := (-coord+j*gridstep,-coord+i*gridstep,0);
+ aa := uniformdeviate(360);
+ ab := uniformdeviate(180);
+ ac := uniformdeviate(90);
+ kindofcube( false, false, pa, aa, ab, ac, 0.4, 0.4, 0.9 );
+ endfor;
+ endfor;
+endfig;
+end.
+\end{verbatim}
+\end{tscreen}
+where {\ttfamily kindofcube}
+is a {\ttfamily FEATPOST} macro that produces
+a rectangular prism (cuboid).
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/kindofcube.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/kindofcube.1.png}}\fi
+\caption{Example that uses {\ttfamily kindofcube}.}
+\end{figure}
+\label{figkindofcube1}
+
+The main variable of any three-dimensional figure is the
+point of view. {\ttfamily FEATPOST} uses the variable {\ttfamily f}
+as the point of view. {\ttfamily Spread} is another global
+variable that controls the size of the projection.
+
+Another example may be:
+\begin{tscreen}
+\begin{verbatim}
+f := (13,7,3.5);
+Spread := 35;
+beginfig(1);
+ numeric i, len, wang, reflen, frac, coordg;
+ numeric fws, NumLines, inray, outay;
+ path conepath, cira, cirb, ella, ellb, tuba, tubb, tubc;
+ color axe, aroc, cubevertex, conecenter, conevertex;
+ color allellaxe, ellaaxe, ellbaxe, pca, pea, pcb, peb;
+ frac := 0.5;
+ len := 0.6;
+ wang := 60;
+ axe := (0,cosd(90-wang),sind(90-wang));
+ fws := 4;
+ reflen := 0.2*fws;
+ outay := 0.45*fws;
+ inray := 0.7*outay;
+ coordg := frac*fws;
+ NumLines := 30;
+ HoriZon := -0.5*fws;
+ setthestage( 0.5*NumLines, 2*fws );
+ cubevertex = (0.12*fws,-0.5*fws,-0.5*fws);
+ kindofcube(false,true,cubevertex,180,0,0,0.65*fws,0.2*fws,fws);
+ aroc := outay*(0,cosd(wang),sind(wang))-0.5*(0,fws,fws);
+ rigorousdisc( inray, true, aroc, outay, axe*len );
+ allellaxe := reflen*( 0.707, 0.707, 0 );
+ ellaaxe := reflen*( 0.707, -0.707, 1.0 );
+ ellbaxe := reflen*( -0.707, 0.707, 1.0 );
+ conecenter = ( coordg, coordg, -0.5*fws );
+ pca := ( coordg, -coordg, -0.5*fws );
+ pcb := ( -coordg, coordg, -0.5*fws );
+ pea := ( coordg, -coordg, 0.9*fws );
+ peb := ( -coordg, coordg, 0.9*fws );
+ cira := goodcirclepath( pca, blue, reflen );
+ cirb := goodcirclepath( pcb, blue, reflen );
+ ella := ellipticpath( pea, allellaxe, ellaaxe );
+ ellb := ellipticpath( peb, allellaxe, ellbaxe );
+ tuba := twocyclestogether( cira, ella );
+ tubb := twocyclestogether( cirb, ellb );
+ tubc := twocyclestogether( ella, ellb );
+ unfill tubb; draw tubb;
+ unfill tubc; draw tubc;
+ unfill tuba; draw tuba;
+ conevertex = conecenter + ( -3.5*reflen, 0, 0.8*fws );
+ verygoodcone(false,conecenter,blue,reflen,conevertex);
+endfig;
+end.
+\end{verbatim}
+\end{tscreen}
+where we find a {\ttfamily rigorousdisc}
+and a {\ttfamily verygoodcone}
+(the nicest {\ttfamily FEATPOST} macros) in addition to
+{\ttfamily setthestage}, {\ttfamily twocyclestogether} and
+{\ttfamily kindofcube}.
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/stageforthree.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/stageforthree.1.png}}\fi
+\caption{Example that uses {\ttfamily rigorousdisc} and {\ttfamily verygoodcone}.}
+\end{figure}
+\label{figstageforthree}
+
+
+\subsection{Mechanics}
+
+The following is the sequence of steps necessary to produce
+the diagrams.
+\begin{enumerate}
+\item To use LaTeX fonts enter the shell command
+\par
+\addvspace{\medskipamount}
+\nopagebreak\hrule
+\begin{verbatim}
+export TEX=latex
+\end{verbatim}
+\nopagebreak\hrule
+\addvspace{\medskipamount}
+\item Make your MetaPost program know {\ttfamily FEATPOST} macros.
+This may be accomplished in two ways:
+\begin{itemize}
+\item Insert the line:
+\begin{tscreen}
+\begin{verbatim}
+input featpost3Dplus2D;
+\end{verbatim}
+\end{tscreen}
+at
+the beginning
+of your program and
+then enter the shell command
+\par
+\addvspace{\medskipamount}
+\nopagebreak\hrule
+\begin{verbatim}
+mpost yourprogram.mp
+\end{verbatim}
+\nopagebreak\hrule
+\addvspace{\medskipamount}
+ or
+\item Pre-compile the macros into a {\ttfamily mem} file,
+for instance:
+\par
+\addvspace{\medskipamount}
+\nopagebreak\hrule
+\begin{verbatim}
+inimpost featpost.mp
+\end{verbatim}
+\nopagebreak\hrule
+\addvspace{\medskipamount}
+ and then run your
+program with
+\par
+\addvspace{\medskipamount}
+\nopagebreak\hrule
+\begin{verbatim}
+mpost -mem featpost yourprogram.mp
+\end{verbatim}
+\nopagebreak\hrule
+\addvspace{\medskipamount}
+\end{itemize}
+\item If your program contains LaTeX text you may insert, at the
+beginning, the lines
+\begin{tscreen}
+\begin{verbatim}
+verbatimtex
+\documentclass{article}
+\begin{document}
+etex
+\end{verbatim}
+\end{tscreen}
+and at the end
+\begin{tscreen}
+\begin{verbatim}
+verbatimtex
+\end{document}
+etex
+\end{verbatim}
+\end{tscreen}
+or make use of the
+
+{\em latexmp} {\tt \aahurl}
+ package.
+\item Pass the produced figure(s) through {\ttfamily dvips}
+if they contain any text. You may do this with the provided
+shell script {\ttfamily laproof}.
+\par
+\addvspace{\medskipamount}
+\nopagebreak\hrule
+\begin{verbatim}
+laproof yourprogram N
+\end{verbatim}
+\nopagebreak\hrule
+\addvspace{\medskipamount}
+ where {\ttfamily N}
+is the figure number. This
+script produces an EPS figure that may be viewed with
+{\ttfamily gv} but that should not be inserted in LaTeX
+documents. Insert the original figure in LaTeX
+documents. Instead of {\ttfamily laproof} you may just as
+well use
+{\em MPS2EPS} {\tt \aaiurl}
+.
+\end{enumerate}
+
+
+
+\subsection{Main Features}
+
+
+\subsubsection{Perspectives}
+
+{\ttfamily FEATPOST} can do three kinds of perspective.
+\begin{tscreen}
+\begin{verbatim}
+f := ( 1.2 , 2.0 , 1.6 );
+Spread := 75;
+
+V1 := (1,1,1);
+V2 := (-1,1,1);
+V3 := (-1,-1,1);
+V4 := (1,-1,1);
+V5 := (1,1,-1);
+V6 := (-1,1,-1);
+V7 := (-1,-1,-1);
+V8 := (1,-1,-1);
+makeface1(1,2,3,4);makeface2(5,6,7,8);
+makeface3(1,2,6,5);makeface4(2,3,7,6);
+makeface5(3,4,8,7);makeface6(4,1,5,8);
+makeline1(1,7);makeline2(2,8);
+makeline3(3,5);makeline4(4,6);
+
+beginfig(1);
+ ParallelProj := true;
+ SphericalDistortion := false;
+ draw_all_test(red,true);
+endfig;
+
+beginfig(2);
+ ParallelProj := false;
+ SphericalDistortion := false;
+ draw_all_test(green,true);
+endfig;
+
+beginfig(3);
+ ParallelProj := false;
+ SphericalDistortion := true;
+ PrintStep := 5;
+ draw_all_test(blue,true);
+endfig;
+
+end;
+\end{verbatim}
+\end{tscreen}
+
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/cubicfigures.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/cubicfigures.1.png}}\fi
+\caption{Orthogonal perspective.}
+\end{figure}
+\label{figcubicfigures1}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/cubicfigures.2,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/cubicfigures.2.png}}\fi
+\caption{Rigorous perspective.}
+\end{figure}
+\label{figcubicfigures2}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/cubicfigures.3,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/cubicfigures.3.png}}\fi
+\caption{Fish-eye perspective.}
+\end{figure}
+\label{figcubicfigures3}
+
+
+\subsubsection{From 3D to 2D}
+
+The most important macro is {\ttfamily rp} that converts 3D points
+to two-dimensional (2D) rigorous, orthogonal
+or fish-eye projections. To draw a line in
+3D-space try
+\begin{tscreen}
+\begin{verbatim}
+draw rp(a)--rp(b);
+\end{verbatim}
+\end{tscreen}
+where
+{\ttfamily a} and {\ttfamily b} are points in space
+(of {\ttfamily color} type).
+But if you're going for fish-eye it's better to
+\begin{tscreen}
+\begin{verbatim}
+draw pathofstraightline(a,b);
+\end{verbatim}
+\end{tscreen}
+If
+you don't know, leave it as
+\begin{tscreen}
+\begin{verbatim}
+drawsegment(a,b,withpen somepen);
+\end{verbatim}
+\end{tscreen}
+
+
+
+\subsubsection{Angles}
+
+When {\ttfamily FEATPOST} was created its main ability was
+to mark and to calculate angles. This is done with the
+macros {\ttfamily angline} and {\ttfamily getangle} as in the
+following program:
+\begin{tscreen}
+\begin{verbatim}
+f := (5,3.5,1);
+beginfig(2);
+ cartaxes(1,1,1);
+ color va, vb, vc, vd;
+ va = (0.29,0.7,1.0);
+ vb = (X(va),Y(va),0);
+ vc = N((-Y(va),X(va),0));
+ vd = (0,Y(vc),0);
+ drawarrow rp(black)--rp(va);
+ draw rp(black)--rp(vb)--rp(va) dashed evenly;
+ draw rp(vc)--rp(vd) dashed evenly;
+ drawarrow rp(black)--rp(vc);
+ squareangline( va, vc, black, 0.15 );
+ angline(va,red,black,0.75,decimal getangle(va,red),lft);
+endfig;
+\end{verbatim}
+\end{tscreen}
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/cartaxes.2,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../allpng/cartaxes.2.gs.png}}\fi
+\caption{Example that uses {\ttfamily cartaxes}, {\ttfamily angline} and {\ttfamily getangle}.}
+\end{figure}
+\label{figcartaxes2}
+
+
+\subsubsection{Intersections}
+
+The most advanced feature of {\ttfamily FEATPOST} is the
+ability to calculate the intersections of planar and
+convex polygons\footnote{Unfortunately, this is also the
+most "bugged" feature.}. It can draw the visible
+part of arbitrary sets of polygons as in
+the following program:
+\begin{tscreen}
+\begin{verbatim}
+numeric phi;
+phi = 0.5*(1+sqrt(5));
+V1 := ( 1, phi,0);V2 := (-1, phi,0);
+V3 := (-1,-phi,0);V4 := ( 1,-phi,0);
+V5 := (0, 1, phi);V6 := (0,-1, phi);
+V7 := (0,-1,-phi);V8 := (0, 1,-phi);
+V9 := ( phi,0, 1);V10:= ( phi,0,-1);
+V11:= (-phi,0,-1);V12:= (-phi,0, 1);
+makeface1(1,2,3,4);makeface2(5,6,7,8);
+makeface3(9,10,11,12);
+beginfig(1);
+ sharpraytrace;
+endfig;
+end
+\end{verbatim}
+\end{tscreen}
+
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/sharpraytrace.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../allpng/sharpraytrace.1.gs.png}}\fi
+\caption{Example that uses {\ttfamily sharpraytrace}.}
+\end{figure}
+\label{figsharpraytrace}
+
+
+\subsubsection{Coming back to 3D from 2D}
+
+It is now possible to do an "automatic perspective tuning"
+with the aid of macro {\ttfamily photoreverse} which is under
+development. Please, refer to example
+{\ttfamily photoreverse.mp} and to
+{\em FeatPost Deeper Technicalities} {\tt \aajurl}
+.
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../alleps/photoreverse.1.eps,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../allpng/photoreverse.1.gs.png}}\fi
+\caption{Example that uses {\ttfamily photoreverse}. It may
+ not work when vertical lines are not vertical in
+ average on the photo.}
+\end{figure}
+\label{figphotoreverse}
+
+
+\paragraph{Coming back to 3D from 1D}
+
+Using the same algorithm of {\ttfamily photoreverse}, the
+macro {\ttfamily improvertex} allows one to approximate a
+point in 3D-space with given distances from three other
+points (an initial guess is required).
+
+
+\section{Reference Manual}
+
+Some words about notation.
+The meaning of macro, function, procedure and routine is the same.
+Global variables are presented like this:
+\begin{tscreen}
+\begin{verbatim}
+vartype var, anothervar
+anothervartype yetanothervar
+\end{verbatim}
+\end{tscreen}
+Explanation of var, anothervar and
+yetanothervar. vartype can be any one of
+MetaPost types but the meaning
+of {\ttfamily color} is a three-dimensional point or vector, not an
+actual color like yellow, black or white. If the meaning is
+an actual color then the type will be {\ttfamily colour}.
+All global variables have default values.
+
+Functions are presented like this:
+\begin{itemize}
+\item returntype {\bfseries function()}
+Explanation of function. returntype can be any one of MetaPost
+types plus global, draw or drawlabel.
+global means that the function
+changes some of the global variables. draw means that
+the function
+changes the currentpicture. drawlabel means that the
+function changes
+the currentpicture and adds text to it.
+\begin{enumerate}
+\item {\ttfamily type1}
+Explanation of the first argument. The type of
+one argument can be any one
+of MetaPost types plus {\ttfamily suffix} or
+{\ttfamily text}.
+\item {\ttfamily type2}
+Explanation of the second argument.
+There is the possibility that the
+function has no arguments. In that case the
+function is presented like
+"returntype {\bfseries function}".
+\item Etc.
+\end{enumerate}
+\end{itemize}
+
+
+
+\subsection{Global variables}
+
+\begin{tscreen}
+\begin{verbatim}
+boolean ParallelProj
+boolean SphericalDistortion
+\end{verbatim}
+\end{tscreen}
+Kind of projection calculated by {\ttfamily rp}.
+By default projections
+are rigorous but if {\ttfamily ParallelProj} is set
+{\ttfamily true} then
+parallel lines remain parallel in the projection.
+It is the same as
+placing the point of view infinitely far without loosing
+sight.
+If {\ttfamily SphericalDistortion} is set {\ttfamily true}
+there will be a
+distortion coming from: (i) the projection being done
+on a sphere of
+center {\ttfamily f} and (ii) this sphere being plaited
+onto the paper page.
+
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/rigorousdiscSD.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/rigorousdiscSD.1.png}}\fi
+\caption{Figure that uses {\ttfamily SphericalDistortion:=true} and {\ttfamily rigorousdisc}.}
+\end{figure}
+\label{sphericaldisc}
+
+\begin{tscreen}
+\begin{verbatim}
+color f, viewcentr
+\end{verbatim}
+\end{tscreen}
+The point of view is {\ttfamily f}. The plane or sphere
+of projection contains
+the center of view {\ttfamily viewcentr}.
+The axis parallel to zz that contains the
+{\ttfamily viewcentr} is projected on a vertical line.
+\begin{tscreen}
+\begin{verbatim}
+numeric Spread
+pair ShiftV, OriginProjPagePos
+numeric PageWidth
+numeric PageHeight
+\end{verbatim}
+\end{tscreen}
+These variables control
+the placement of the projection on the
+paper. {\ttfamily Spread} is the magnification
+and {\ttfamily ShiftV} is the position of the
+{\ttfamily viewcentr} projection on the
+paper. But, if at some point in your program you introduce
+{\ttfamily produce\_auto\_scale} then the
+{\ttfamily currentpicture} will be
+centered at {\ttfamily OriginProjPagePos}
+and scaled to fit inside a rectangle of
+{\ttfamily PageWidth} by {\ttfamily PageHeight}.
+\begin{tscreen}
+\begin{verbatim}
+color V[]
+color L[]p[]
+color F[]p[]
+\end{verbatim}
+\end{tscreen}
+Vertexes, lines and faces.
+The idea here is to draw
+polygons and/or arbitrary lines in 3D space.
+Defining the polygons and
+the lines can be a bit tedious as {\ttfamily FEATPOST} is not
+interactive. First, one defines a list of the
+vertexes ({\ttfamily V[]}) that define the
+polygons and/or the lines.
+There is a list of polygons and a list of
+lines. Each polygon ({\ttfamily F[]p[]}) or
+line ({\ttfamily L[]p[]}) is itself a list of vertexes.
+All vertexes of the same poligon should belong
+to the same plane.
+\begin{tscreen}
+\begin{verbatim}
+numeric NL
+numeric npl[]
+numeric NF
+numeric npf[]
+\end{verbatim}
+\end{tscreen}
+Number of lines, number of vertexes of each line,
+number of faces, number of vertexes of each face.
+\begin{tscreen}
+\begin{verbatim}
+numeric PrintStep
+\end{verbatim}
+\end{tscreen}
+
+{\ttfamily Printstep} is the size of iterative jumps
+along lines. Used by
+{\ttfamily lineraytrace}, {\ttfamily faceraytrace} and
+{\ttfamily pathofstraightline}.
+Big {\ttfamily Printstep}s make fast raytracings.
+\begin{tscreen}
+\begin{verbatim}
+boolean FCD[]
+colour TableC[]
+numeric TableColors
+numeric FC[]
+colour HigColor
+colour SubColor
+color LightSource
+\end{verbatim}
+\end{tscreen}
+{\ttfamily FCD} means "face color defined". The
+{\ttfamily draw\_invisible} macro draws
+polygons in colour, if it is defined. The colour must be
+selected from the table of colours {\ttfamily TableC} that has
+as many as {\ttfamily TableColors}. The colour {\ttfamily FC}
+of each polygon will depend on its position relatively to
+{\ttfamily LightSource} where we suppose there is a lamp that
+emits light coloured {\ttfamily HigColor}. Furthermore the
+colour of each polygon may be modified if it belongs to a
+functional or parametric surface. In this case, if we are
+looking at the polygon from below than {\ttfamily SubColor} is
+subtracted from its colour.
+\begin{tscreen}
+\begin{verbatim}
+numeric RopeColorSeq[]
+numeric RopeColors
+\end{verbatim}
+\end{tscreen}
+
+These are used by {\ttfamily ropepattern}.
+\begin{tscreen}
+\begin{verbatim}
+numeric TDAtiplen
+numeric TDAhalftipbase
+numeric TDAhalfthick
+\end{verbatim}
+\end{tscreen}
+
+These control the shape of Three-Dimensional Arrows.
+\begin{tscreen}
+\begin{verbatim}
+boolean ShadowOn
+numeric HoriZon
+\end{verbatim}
+\end{tscreen}
+
+When {\ttfamily ShadowOn} is set {\ttfamily true}, some objects can
+cast a black shadow on a horizontal plane of {\ttfamily Z}
+coordinate equal to {\ttfamily HoriZon} (an area from
+this plane may be drawn with {\ttfamily setthestage}) as if
+there is a punctual source of light at
+{\ttfamily LightSource}.
+The macros that can produce shadows, in addition to their
+specific production, are
+\begin{itemize}
+\item {\ttfamily emptyline}
+\item {\ttfamily rigorousdisc}
+\item {\ttfamily verygoodcone}
+\item {\ttfamily tropicalglobe}
+\item {\ttfamily whatisthis}
+\item {\ttfamily kindofcube}
+\item {\ttfamily draw\_all\_test}
+\item {\ttfamily fill\_faces}
+\item {\ttfamily positivecharge}
+\end{itemize}
+
+All macros that contain {\bfseries shadow} in their name
+calculate the location of shadows (using {\ttfamily cb}).
+\begin{tscreen}
+\begin{verbatim}
+path VGAborder
+\end{verbatim}
+\end{tscreen}
+
+This path and the macro {\ttfamily produce\_vga\_border} are
+meant to help you clip the {\ttfamily currentpicture} to a 4:3
+rectangle as in a movie frame.
+\begin{tscreen}
+\begin{verbatim}
+pair PhotoPair[]
+color PhotoPoint[]
+numeric PhotoMarks
+\end{verbatim}
+\end{tscreen}
+
+These are used by {\ttfamily photoreverse}.
+\begin{tscreen}
+\begin{verbatim}
+pen ForePen, BackPen
+path CLPath
+numeric NCL
+\end{verbatim}
+\end{tscreen}
+
+These are used by {\ttfamily closedline}.
+
+
+\subsection{Definitions}
+
+\begin{itemize}
+\item global makeline@\#( text1)
+\item global makeface@\#( text1)
+\end{itemize}
+
+Both of these functions ease the task of
+defining lines and polygons. Just
+provide a list of vertexes in the right
+sequence for each polygon and/or
+line. Suppose a tetrahedron
+\begin{tscreen}
+\begin{verbatim}
+V3:=(+1,-1,-1);V2:=(-1,+1,-1);
+V4:=(+1,+1,+1);V1:=(-1,-1,+1);
+makeface2(1,2,3);makeface3(1,2,4);
+makeface1(3,4,1);makeface4(3,4,2);
+\end{verbatim}
+\end{tscreen}
+The
+number in the last makeface or last
+makeline procedure name must be the
+number of polygons or lines. All polygons and lines from 1 upto this
+number must be defined but the sorting may be any of your liking.
+
+
+\subsection{Macros}
+
+
+\subsubsection{Very Basic Macros}
+
+\begin{itemize}
+\item numeric {\bfseries X()}
+Returns the first coordinate of a point or vector (of
+color type). Replaces {\ttfamily redpart}.
+\item numeric {\bfseries Y()}
+Returns the second coordinate of a point or vector.
+Replaces {\ttfamily greenpart}.
+\item numeric {\bfseries Z()}
+Returns the second coordinate of a point or vector.
+Replaces {\ttfamily bluepart}.
+\item draw {\bfseries produce\_auto\_scale}
+The currentpicture is centered in, and adjusted
+to the size of, an A4
+paper page. This avoids the control of {\ttfamily Spread} and
+{\ttfamily ShiftV}.
+\item string {\bfseries cstr()} Converts a color into its
+string. Usefull in combination with {\ttfamily getready}.
+\item string {\bfseries bstr()} Converts a boolean expression into its
+string. Usefull in combination with {\ttfamily getready}.
+\end{itemize}
+
+
+
+\subsubsection{Vector Calculus}
+
+\begin{itemize}
+\item color {\bfseries N()} Unit vector. Returns
+{\ttfamily black} (the null vector) when the argument has
+null norm. The "N" means "normalized".
+\item numeric {\bfseries cdotprod()} Dot product of two
+vectors.
+\item color {\bfseries ccrossprod()} Cross product of two
+vectors.
+\item numeric {\bfseries ndotprod()} Cossine of the angle
+beetween two vectors.
+\item color {\bfseries ncrossprod()} Normalized cross product
+of twovectors.
+\item numeric {\bfseries conorm()} Euclidean norm of a
+vector.
+\item numeric {\bfseries getangle()} Angle beetween two
+vectors.
+\item pair {\bfseries getanglepair()} Orientation angles
+of a vector. The first angle ({\ttfamily xpart}) is
+measured beetween the vector projection on the {\ttfamily XY}
+plane and the {\ttfamily X} axis. The second angle
+({\ttfamily ypart})is measured
+beetween the vector and its projection on the {\ttfamily XY}
+plane. This may be usefull to find the arguments of
+{\ttfamily kindofcube}
+\item color {\bfseries eulerrotation()} Three-dimensional
+rotation of a vector.
+\begin{enumerate}
+\item {\ttfamily numeric} Angle of rotation around the
+{\ttfamily Z} component.
+\item {\ttfamily numeric} Angle of rotation around the
+rotated {\ttfamily Y} component.
+\item {\ttfamily numeric} Angle of rotation around the
+two times rotated {\ttfamily X} component.
+\item {\ttfamily color} Vector to be rotated.
+\end{enumerate}
+\item color {\bfseries randomfear} Generates a randomly
+oriented unit vector.
+\end{itemize}
+
+
+
+\subsubsection{Projection Macros}
+
+\begin{itemize}
+\item pair {\bfseries rp()} Converts spatial positions into
+planar positions on the paper page. The conversion
+considers the values of the following global
+variables: {\ttfamily viewcentr},
+{\ttfamily ParallelProj}, {\ttfamily SphericalDistortion},
+{\ttfamily Spread} and {\ttfamily ShiftV}. When both
+{\ttfamily ParallelProj} and {\ttfamily SphericalDistortion}
+are {\ttfamily false} it won't work if either (i) the
+vectors {\ttfamily f-viewcentr} and {\ttfamily f-R} are
+perpendicular ({\ttfamily R} is the argument) or (ii)
+{\ttfamily f} and {\ttfamily viewcentr} share the same
+{\ttfamily X} and {\ttfamily Y} coordinates.
+\begin{enumerate}
+\item {\ttfamily color} Spatial position.
+\end{enumerate}
+\item color {\bfseries cb()} Calculates the position of the
+shadow of a point. Uses {\ttfamily HoriZon} and
+{\ttfamily LightSource}.
+\begin{enumerate}
+\item {\ttfamily color} Point position.
+\end{enumerate}
+\item color {\bfseries projectpoint()} Calculates the
+intersection beetween a plane and a straight
+line. The plane contains a given point and is
+perpendicular to the line connecting the
+{\ttfamily LightSource} and this same point.
+The line is defined by another given point and the
+{\ttfamily LightSource}. Summary: {\ttfamily projectpoint}
+returns the projection of the second argument on a
+plane that contains the first argument. Can be used to
+draw shadows cast on generic planes.
+\begin{enumerate}
+\item {\ttfamily color} Origin of the projection plane.
+\item {\ttfamily color} Point to be projected.
+\end{enumerate}
+\end{itemize}
+
+
+
+\subsubsection{Plain Basic Macros}
+
+\begin{itemize}
+\item draw {\bfseries signalvertex()} Draws a dot
+sized inversely proportional to its distance from
+the viewpoint {\ttfamily f}.
+\begin{enumerate}
+\item {\ttfamily color} Location.
+\item {\ttfamily numeric} Factor of proportionality
+("size of the dot").
+\item {\ttfamily colour} Colour of the dot.
+\end{enumerate}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/torus.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/torus.1.png}}\fi
+\caption{Figure that uses {\ttfamily signalvertex}.}
+\end{figure}
+\item path {\bfseries pathofstraightline()} When using
+{\ttfamily SphericalDistortion:=true}, straight lines
+look like curves. This macro returns the curved path
+of a straight line beetween two points. This path will
+have a greater {\ttfamily length} ("time") when
+{\ttfamily PrintStep} is made smaller.
+\item drawlabel {\bfseries cartaxes()}
+Cartesean axes with prescribed lenghtes and apropriate labels.
+\begin{enumerate}
+\item {\ttfamily numeric} Length of the {\ttfamily X} axe.
+\item {\ttfamily numeric} Length of the {\ttfamily Y} axe.
+\item {\ttfamily numeric} Length of the {\ttfamily Z} axe.
+\end{enumerate}
+\item draw {\bfseries emptyline()} This procedure produces
+a sort of a tube that can cross over itself. It
+facilitates the drawing of, for instance, thick
+helical curves but it won't
+look right if the curves are drawn getting apart from
+the point of view. Please, accept this inconveniance.
+As like many other {\ttfamily FEATPOST} macros this one
+can produce visually correct diagrams only in limited
+conditions. Can cast a shadow.
+\begin{enumerate}
+\item {\ttfamily boolean} Choose {\ttfamily true} to join
+this line with a previously drawn line.
+\item {\ttfamily numeric} Factor of proportionality
+("diameter of the tube"). The tubes are just
+sequences of dots drawn by {\ttfamily signalvertex}.
+\item {\ttfamily colour} Colour of the tube border.
+\item {\ttfamily colour} Colour of the tube.
+\item {\ttfamily numeric} Total number of dots on the
+tube line.
+\item {\ttfamily numeric} Fraction of the tube diameter
+that is drawn with the tube colour.
+\item {\ttfamily numeric} This is the number of dots
+that are redrawn with the colour of the tube for
+each drawn dot with the color of the tube
+border. Usually 1 or 2 are enough.
+\item {\ttfamily text} This is the name a function
+that returns a 3D point of the line for each value
+of a parameter in beetween 0 and 1.
+\end{enumerate}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/joinedemptylines.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/joinedemptylines.1.png}}\fi
+\caption{Figure that uses {\ttfamily emptyline}.
+ The junction point of two different lines is indicated
+ by an arrow. Note the unperfection on the top
+ right, inside the upper turn. }
+\end{figure}
+\label{joinedemptylines}
+\item draw {\bfseries closedline()} This procedure produces
+a tube that can cross over itself. It
+facilitates the drawing of, for instance, thick
+helical curves but it won't
+look right as its thickness does not change with the
+distance from the point of view. The drawing is
+entirely done in two dimensions, so the tube diameter
+depends on the global variables {\ttfamily ForePen} and
+{\ttfamily BackPen}. There can be more than one closed
+line in a figure but all get the same diameter.
+\begin{enumerate}
+\item {\ttfamily numeric} Total number of path segments
+on the tube line.
+\item {\ttfamily numeric} Use 0.5 or more.
+\item {\ttfamily numeric} Use 0.75 or more.
+\item {\ttfamily text} This is the name a function
+that returns a 3D point of the closed line for each value
+of a parameter in beetween 0 and 1.
+\end{enumerate}
+\item drawlabel {\bfseries angline()}
+Draws an arch beetween two straight lines with a
+common point and places a label
+near the middle of the arch (marks an
+angle).
+\begin{enumerate}
+\item {\ttfamily color} Point of one line.
+\item {\ttfamily color} Point ot the other line.
+\item {\ttfamily color} Common point.
+\item {\ttfamily numeric} Distance beetween the arch and
+the common point.
+\item {\ttfamily picture} Label.
+\item {\ttfamily suffix} Position of the label relatively
+to the middle of the arch. May
+be one of {\ttfamily lft, rt, top, bot, ulft, urt,
+llft} and {\ttfamily lrt}.
+\end{enumerate}
+\item drawlabel {\bfseries anglinen()}
+The same as the previous function but the
+sixth argument is numeric:
+0={\ttfamily rt};
+1={\ttfamily urt};
+2={\ttfamily top};
+3={\ttfamily ulft};
+4={\ttfamily lft};
+5={\ttfamily llft};
+6={\ttfamily bot};
+7={\ttfamily lrt};
+any other number places the label
+on the middle of the arch.
+\item draw {\bfseries squareangline()}
+This is supposed to mark 90 degree angles
+but works for any angle value.
+\begin{enumerate}
+\item {\ttfamily color} Point of one line.
+\item {\ttfamily color} Point ot the other line.
+\item {\ttfamily color} Common point.
+\item {\ttfamily numeric} Distance beetween the "arch"
+and the common point.
+\end{enumerate}
+\item path {\bfseries rigorouscircle()}
+3D circle. The total "time" of this path is 8. This
+small number makes it easy to select parts of the
+path. The circle is drawn using the
+"left-hand-rule". If you put your left-hand thumb
+parallel the circle axe then the other left-hand
+fingers curl in the same sense as the circle
+path. This path allways starts, approching the view
+point, from a point on a diameter of the
+circle that projects orthogonaly to its axe, and
+rotating around the axe in the way of the left-hand-rule.
+\begin{enumerate}
+\item {\ttfamily color} Center of the circle.
+\item {\ttfamily color} Direction orthogonal to the
+circle (circle axe).
+\item {\ttfamily numeric} Radius of the circle.
+\end{enumerate}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/anglinerigorouscircle.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../allpng/anglinerigorouscircle.1.gs.png}}\fi
+\caption{Figure that uses {\ttfamily anglinen} and {\ttfamily rigorouscircle}.}
+\end{figure}
+\item draw {\bfseries tdarrow()} Draws a flat arrow that
+begins at the first argument and ends at the second.
+The shape of the arrow is controled by the global
+variables {\ttfamily TDAtiplen, TDAhalftipbase, TDAhalfthick}.
+\item path {\bfseries twocyclestogether()} This macro
+allows you to draw any solid that has no vertexes
+and that has two, exactly two, planar cyclic edges.
+In fact, it doesn't need to be a solid. Just
+provide the pathes of both cyclic edges as arguments
+but note that the returned path is polygonal.
+In order to complete
+the drawing of this solid you have to choose one of
+the edges to be drawn immediatly afterwards. This is
+done automatically by the {\ttfamily whatisthis} macro
+for the case of two parallel and concentric ellipses.
+\item path {\bfseries ellipticpath()} Produces an elliptic
+path in 3D space.
+\begin{enumerate}
+\item {\ttfamily color} Position of the center.
+\item {\ttfamily color} Major or minor axe.
+\item {\ttfamily color} The other axe.
+\end{enumerate}
+\item drawlabel {\bfseries labelinspace()} Draw some 2D
+{\ttfamily picture} on some 3D plane (only when
+{\ttfamily ParallelProj:=true}).
+\begin{enumerate}
+\item {\ttfamily color} Position for the lower-left
+corner.
+\item {\ttfamily color} Orientation of the picture's
+bottom edge.
+\item {\ttfamily color} Orientation of the picture's
+letf edge.
+\item {\ttfamily text} 2D picture's name.
+\end{enumerate}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/labelinspace.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../allpng/labelinspace.1.gs.png}}\fi
+\caption{Example that uses {\ttfamily labelinspace}.}
+\end{figure}
+\end{itemize}
+
+
+
+\subsubsection{Standard Objects}
+
+\begin{itemize}
+\item path {\bfseries goodcirclepath()}
+Another 3D circle macro. More rigorous
+than {\ttfamily rigorouscircle} but when
+the direction ortogonal to the circle is almost
+orthogonal to the line {\ttfamily viewpoint--center}
+it doesn't work correctly.
+The total "time" of this path is 36.
+\begin{enumerate}
+\item {\ttfamily color} Center of the circle.
+\item {\ttfamily color} Direction ortogonal to
+the circle.
+\item {\ttfamily numeric} Radius of the
+circle.
+\end{enumerate}
+\item draw {\bfseries spatialhalfsfear()} An
+hemisphere. Doesn't work with {\ttfamily f} inside it.
+\begin{enumerate}
+\item {\ttfamily color} Center.
+\item {\ttfamily color} Vector ortogonal to
+the frontier circle and pointing
+out of the concavity.
+\item {\ttfamily numeric} Radius of the
+(hemi)sphere.
+\end{enumerate}
+\item path {\bfseries spatialhalfcircle()}
+And yet another 3D circle macro. Only the visible or the hidden
+part. This is usefull to mark sections of
+cylinders or spherical major circles.
+\begin{enumerate}
+\item {\ttfamily color} Center of the circle.
+\item {\ttfamily color} Direction ortogonal to the
+circle.
+\item {\ttfamily numeric} Radius of the circle.
+\item {\ttfamily boolean} The visible part is selected with
+{\ttfamily true} and the hidden
+with {\ttfamily false}.
+\end{enumerate}
+\item draw {\bfseries rigorousdisc()}
+3D opaque cylinder with/without a hole. Can cast a
+shadow (without the hole).
+\begin{enumerate}
+\item {\ttfamily numeric} Ray of an axial hole.
+\item {\ttfamily boolean} Option for completly opaque cylinder
+({\ttfamily true}) or partial
+pipe ({\ttfamily false}) when there is no hole. When
+the cylinder has an hole this option should be
+{\ttfamily true}.
+\item {\ttfamily color} Center of one circular base.
+\item {\ttfamily numeric} Radius of both circular bases.
+\item {\ttfamily color} Vector that defines the length and
+orientation of the
+cylinder. The addition the third and fifth
+arguments should give the
+position of the center of the other circular base.
+\end{enumerate}
+\item draw {\bfseries verygodcone()} 3D cone. Can cast a shadow.
+\begin{enumerate}
+\item {\ttfamily bolean} Option to draw dashed evenly
+the invisible edge ({\ttfamily true}) or not
+({\ttfamily false}).
+\item {\ttfamily color} Center of the circular base.
+\item {\ttfamily color} Direction ortogonal to the
+circular base.
+\item {\ttfamily numeric} Radius of the circular base.
+\item {\ttfamily color} Position of the vertex
+\end{enumerate}
+\item path {\bfseries rigorousfearpath()}
+3D sphere. Simple but hard.
+\begin{enumerate}
+\item {\ttfamily color} Center position.
+\item {\ttfamily numeric} Radius.
+\end{enumerate}
+\item draw {\bfseries tropicalglobe()} Globe with
+minor circles. Can cast a shadow.
+\begin{enumerate}
+\item {\ttfamily numeric} Number of marked latitudes.
+\item {\ttfamily color} Center position.
+\item {\ttfamily numeric} Radius
+\item {\ttfamily color} Axe orientation.
+\end{enumerate}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/tropicalglobe.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/tropicalglobe.1.png}}\fi
+\caption{Figure that uses {\ttfamily tropicalglobe}.
+ }
+\end{figure}
+\item draw {\bfseries whatisthis()} An elliptic
+frustum. Both edges are elliptic an have the same
+orientation but one may be greater than the other.
+Can cast a shadow.
+\begin{enumerate}
+\item {\ttfamily color} Reference edge center.
+\item {\ttfamily color} Major or minor axe.
+\item {\ttfamily color} The other axe.
+\item {\ttfamily numeric} Length of the original
+cylinder.
+\item {\ttfamily numeric} Edges axes length ratio.
+\end{enumerate}
+\item draw {\bfseries kindofcube()} Polyhedron with six
+orthogonal faces (cuboid).
+\begin{enumerate}
+\item {\ttfamily boolean} Also draw the invisible edges
+{\ttfamily dashed evenly} ({\ttfamily true}) or do not.
+\item {\ttfamily boolean} The reference point may be a
+vertex ({\ttfamily true}) or the center({\ttfamily false}).
+\item {\ttfamily color} Reference point.
+\item {\ttfamily numeric} Alpha1.
+\item {\ttfamily numeric} Alpha2.
+\item {\ttfamily numeric} Alpha3.
+\item {\ttfamily numeric} L1. Length of the first side.
+\item {\ttfamily numeric} L2. Length of the second side.
+\item {\ttfamily numeric} L3. Length of the third side.
+\end{enumerate}
+
+These arguments are represented in the next figure.
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/kindofcube.2,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../allpng/kindofcube.2.gs.png}}\fi
+\caption{Figure that uses and explains {\ttfamily kindofcube}. Note that the three indicated
+ angles may be used as arguments of {\ttfamily eulerrotation}.}
+\end{figure}
+\label{kindofcube2}
+\item draw {\bfseries setthestage()} Produces an horizontal
+square made of squares. Its {\ttfamily Z} coordinate is defined by
+{\ttfamily HoriZon}.
+\begin{enumerate}
+\item {\ttfamily numeric} Number of squares in each side.
+\item {\ttfamily numeric} Size of each side.
+\end{enumerate}
+\item draw {\bfseries setthearena()} Produces an horizontal
+circle made of circles. Its {\ttfamily Z} coordinate is defined by
+{\ttfamily HoriZon}. Due to the fact that the center of a
+circle is not on the center of its central perspective
+projection, this may look a bit strange.
+\begin{enumerate}
+\item {\ttfamily numeric} Number of circles on a
+diameter.
+\item {\ttfamily numeric} Diameter.
+\end{enumerate}
+\item draw {\bfseries smoothtorus()} Toxic donut (not to be
+eaten). Produces an error message when {\ttfamily f} is
+close to the table.
+\begin{enumerate}
+\item {\ttfamily color} Center.
+\item {\ttfamily color} Direction orthogonal to the
+torus plane.
+\item {\ttfamily numeric} Big ray.
+\item {\ttfamily numeric} Small ray.
+\end{enumerate}
+\end{itemize}
+
+
+
+\subsubsection{Composed Objects}
+
+\begin{itemize}
+\item draw {\bfseries positivecharge()} Draws a sphere with a
+plus or minus sign on the surface. The horizontal
+segment of the sign is drawn on the horizontal plane
+that contains the sphere center. The middle point of
+this segment is on a vertical plane containing the
+viewpoint.
+\begin{enumerate}
+\item {\ttfamily boolean} Selects the sign ({\ttfamily true}
+means positive).
+\item {\ttfamily color} Position of the center.
+\item {\ttfamily numeric} Sphere ray.
+\end{enumerate}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/positivecharge.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/positivecharge.1.png}}\fi
+\caption{Figure that uses {\ttfamily positivecharge},
+ {\ttfamily getready} and {\ttfamily doitnow}.
+ }
+\end{figure}
+\item draw {\bfseries simplecar()} Draws a cuboid and four
+discs in a configuration ressembling an automobile. The
+first three arguments of {\ttfamily simplecar} are the same
+as the the last seven arguments of {\ttfamily kindofcube}
+but grouped in colors.
+\begin{enumerate}
+\item {\ttfamily color} Center of the cuboid that
+constitutes the body of the car..
+\item {\ttfamily color} Angles defining the orientation
+of the car (see {\ttfamily kindofcube}).
+\item {\ttfamily color} Dimensions of the car.
+\item {\ttfamily color} Characteristics of the front
+wheels. {\ttfamily redpart}-distance from the
+front. {\ttfamily greenpart}-width of the front wheels (length
+of the cylinders). {\ttfamily bluepart}-wheel ray.
+\item {\ttfamily color} Same as above for the rear wheels
+\end{enumerate}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/simplecar.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/simplecar.1.png}}\fi
+\caption{Figure that uses {\ttfamily setthearena} and
+ {\ttfamily simplecar}. }
+\end{figure}
+\end{itemize}
+
+
+
+\subsubsection{Shadow Pathes}
+
+\begin{itemize}
+\item draw {\bfseries signalshadowvertex()} Draws the
+shadow of a {\ttfamily signalvertex} dot.
+\begin{enumerate}
+\item {\ttfamily color} Location of the light-blocking dot.
+\item {\ttfamily numeric} Factor of proportionality
+("size of the dot").
+\item {\ttfamily colour} Colour of the dot.
+\end{enumerate}
+\item path {\bfseries ellipticshadowpath()} Produces the
+shadow of an elliptic path.
+\begin{enumerate}
+\item {\ttfamily color} Position of the center.
+\item {\ttfamily color} Major or minor axe.
+\item {\ttfamily color} The other axe.
+\end{enumerate}
+\item path {\bfseries circleshadowpath()} Produces the
+shadow of a circle.
+\begin{enumerate}
+\item {\ttfamily color} Center of the circle.
+\item {\ttfamily color} Direction ortogonal to
+the circle.
+\item {\ttfamily numeric} Radius of the
+circle.
+\end{enumerate}
+\item path {\bfseries rigorousfearshadowpath()}
+3D sphere shadow.
+\begin{enumerate}
+\item {\ttfamily color} Center position.
+\item {\ttfamily numeric} Radius.
+\end{enumerate}
+\end{itemize}
+
+
+
+\subsubsection{Differential Equations}
+
+Before we proceed, be aware that solving differential
+equations (DE) is mainly an experimental activity. The most
+probable result of a procedure that atempts to solve a DE
+is garbage. The procedure may be unstable, the solution
+may be littered with singularities or something may go
+wrong. If you don't have a basic understanding of
+differential equations then skip this section, please.
+
+\begin{itemize}
+\item path {\bfseries fieldlinepath()} A vectorial field line is
+everywhere tangent to the field vectors.
+Two different parallel fields
+have the same field lines. So the field only
+constrains the direction of the field lines, not any kind
+of "speed" and, therefore, it is recommended to
+normalize the field before using this macro that
+contains a second-order Runge-Kutta method
+implementation.
+\begin{enumerate}
+\item {\ttfamily numeric} Total number of steps.
+\item {\ttfamily color} Initial position.
+\item {\ttfamily numeric} Step (arc)length.
+\item {\ttfamily text} Name of the function that
+returns a field vector for each 3D position.
+\end{enumerate}
+\item path {\bfseries trajectorypath()} The acceleration of a
+particle in a conservative force field is equal to the
+ratio (conservative force)/(particle mass). The
+acceleration is also equal to the second order time
+derivative of the particle position. This produces a
+second order differential equation that we solve using a
+second-order Runge-Kutta method implementation.
+\begin{enumerate}
+\item {\ttfamily numeric} Total number of steps.
+\item {\ttfamily color} Initial position.
+\item {\ttfamily color} Initial velocity.
+\item {\ttfamily numeric} Time step.
+\item {\ttfamily text} Name of the function that
+returns a (force/mass) vector for each 3D position.
+\end{enumerate}
+\item path {\bfseries magnetictrajectorypath()} The
+acceleration of a
+charged particle in a magnetic field is equal to the
+ratio (magnetic force)/(particle mass) but the magnetic
+force depends on both the velocity and the magnetic field. The
+acceleration is also equal to the second order time
+derivative of the particle position. This produces a
+second order differential equation that we solve using a
+fourth-order Runge-Kutta method implementation.
+\begin{enumerate}
+\item {\ttfamily numeric} Total number of steps.
+\item {\ttfamily color} Initial position.
+\item {\ttfamily color} Initial velocity.
+\item {\ttfamily numeric} Time step.
+\item {\ttfamily text} Name of the function that
+returns a (charge)*(magnetic field)/(partcle mass)
+vector for each 3D position.
+\end{enumerate}
+\end{itemize}
+
+
+
+\subsubsection{Renderers}
+
+\begin{itemize}
+\item draw {\bfseries sharpraytrace} Heavy procedure that
+draws only the visible part of all edges of all defined
+faces. There's no point in using this procedure when
+there are no intersections beetween faces. Any how
+this will not work for non-convex faces nor when
+{\ttfamily SphericalDistortion:=true}.
+\item draw {\bfseries lineraytrace()} Draws only the
+visible part of all defined lines using sequences of dots
+({\ttfamily signalvertex} and {\ttfamily PrintStep}).
+\begin{enumerate}
+\item {\ttfamily numeric} Dot size.
+\item {\ttfamily colour} Dot colour.
+\end{enumerate}
+\item draw {\bfseries faceraytrace()} Draws only the
+visible part of all edges of all defined faces
+using sequences of dots
+({\ttfamily signalvertex} and {\ttfamily PrintStep}).
+\begin{enumerate}
+\item {\ttfamily numeric} Dot size.
+\item {\ttfamily colour} Dot colour.
+\end{enumerate}
+\item draw {\bfseries draw\_all\_test()} Draws all defined
+edges (and lines) in a correct way independently of
+the kind of projection used. Can cast a shadow (but
+the shadow is not correct when
+{\ttfamily SphericalDistortion:=true}).
+\begin{enumerate}
+\item {\ttfamily colour} Colour of the segments.
+\item {\ttfamily boolean} If {\ttfamily true} the lines
+are also drawn.
+\end{enumerate}
+\item draw {\bfseries fill\_faces()} Unfills and draws all
+faces in the order they were defined (without
+sorting). Can cast a shadow.
+\begin{enumerate}
+\item {\ttfamily text} Like the argument of
+{\ttfamily drawoptions} but used only inside this
+macro and only for the edges.
+\end{enumerate}
+\item draw {\bfseries draw\_invisible()} This is a fast way
+of removing hidden lines that doesn't
+allow for intersecting polygons nor
+polygons of very different area. It works by
+sorting all polygons by
+distance to {\ttfamily f} and then by "filling" the
+polygons. This routine may be used to draw graphs
+of 3D surfaces.
+\begin{enumerate}
+\item {\ttfamily boolean} If {\ttfamily true} polygons are
+sorted relatively to
+nearest vertex and, if {\ttfamily false}, relatively to their
+mass center. Choose {\ttfamily false} for surface
+plots.
+\item {\ttfamily boolean} If {\ttfamily false} then the
+polygons are painted with their {\ttfamily FC} colour
+modified by {\ttfamily LightSource}. If {\ttfamily true}
+then the next two arguments are used and the
+polygons are darkened proportionaly to their
+distance from {\ttfamily f}.
+\item {\ttfamily colour} Colour of faces.
+\item {\ttfamily colour} Colour of the edges.
+\end{enumerate}
+\item global {\bfseries getready()} When you don't want to
+edit the source of the MetaPost program, to resort the
+objects so they'll be drawn correctly, use this macro
+and the next.
+\begin{enumerate}
+\item {\ttfamily string} Command line that would draw
+some object. For instance:
+{\ttfamily "rigorousfearpath(black,1);"}.
+\item {\ttfamily color} Reference position of that
+object.
+\end{enumerate}
+\item draw {\bfseries doitnow} The reference positions
+given as arguments of previous {\ttfamily getready} calls
+are used to sort and draw the objects also given as
+string arguments to previous {\ttfamily getready}
+calls. Remember to initialize {\ttfamily Nobjects:=0;}
+before a second figure.
+\end{itemize}
+
+
+
+\subsubsection{Nematics (Direction Fields)}
+
+Nematics are the least ordered liquid crystals. Their
+configurations can be described by direction fields
+(vector fields without arrows). The two following routines
+ease the task of representing their configurations.
+
+\begin{itemize}
+\item global {\bfseries generatedirline()} Defines a single
+straight line segment in a given position and with a
+given orientation.
+\begin{enumerate}
+\item {\ttfamily numeric} Line index number.
+\item {\ttfamily numeric} Angle beetween the {\ttfamily X}
+axe and the projection of the line on the
+{\ttfamily XY} plane.
+\item {\ttfamily numeric} Angle beetween the line
+and the {\ttfamily XY} plane.
+\item {\ttfamily numeric} Line (arc)length.
+\item {\ttfamily color} Position of the line middle
+point.
+\end{enumerate}
+\item draw {\bfseries director\_invisible()} This is a
+direction field renderer that can sort direction
+lines. This routine
+draws straight lines of given "thickness" beetween the
+first all the points
+of all the {\ttfamily L[]p[]} lines. It is supposed to
+help you draw vector fields
+without arrows but taking care of invisibility.
+The lines may be
+generated by {\ttfamily generatedirline} or by other macros.
+\begin{enumerate}
+\item {\ttfamily boolean} When there is no need to sort
+lines you may use {\ttfamily false} here.
+\item {\ttfamily numeric} "Thickness" of the
+direction lines
+\item {\ttfamily boolean} Use {\ttfamily true} for cyclic
+"direction" lines.
+\end{enumerate}
+\end{itemize}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/twistflat.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/twistflat.1.png}}\fi
+\caption{Figure that uses {\ttfamily director\_invisible} and {\ttfamily generatedirline}.}
+\end{figure}
+
+
+
+\subsubsection{Surface Plots}
+
+Many powerfull plotting packages like
+{\ttfamily
+{\em gnuplot} {\tt \aakurl}
+} and
+{\ttfamily
+{\em gri} {\tt \aalurl}
+}
+are freely available. Because of this, {\ttfamily FEATPOST}
+surface plots are geared towards unusual features like
+equilateral triangular grid, hexagonal domain and merging
+together functional and parametric surface descriptions.
+
+\begin{itemize}
+\item draw {\bfseries hexagonaltrimesh()} Plots a
+functional surface on a triangular or hexagonal
+domain. Uses the {\ttfamily LightSource}.
+\begin{enumerate}
+\item {\ttfamily boolean} Select the kind of
+domain. {\ttfamily true} for hexagonal and
+{\ttfamily false} for triangular. The domain is
+centered on the origin ({\ttfamily black}). When the
+domain is hexagonal two of its corners are on the
+{\ttfamily -YY} axe. When the
+domain is triangular one of its corners is on the
+{\ttfamily X} axe.
+\item {\ttfamily numeric} Number of small triangles on
+each side of the triangular domain or three times
+the number of small triangles on
+each side of the hexagonal domain.
+\item {\ttfamily numeric} Length of the triangular
+domain side or three times the hexagonal domain
+side.
+\item {\ttfamily text} Name of the function that
+returns the {\ttfamily Z} coordinate of a surface
+point of coordinates {\ttfamily X} and {\ttfamily Y}.
+\end{enumerate}
+
+\begin{figure}[tbp]
+\ifpdf
+
+\else
+\centerline{\epsfig{file=../allps/hexagonaltrimesh.1,height=5cm,angle=0}}\fi
+\ifpdf
+\centerline{\epsfig{file=../nontextualpng/hexagonaltrimesh.1.png}}\fi
+\caption{Figure that uses {\ttfamily hexagonaltrimesh}.
+ }
+\end{figure}
+\item global {\bfseries partrimesh()} Defines a parametric
+surface that can be drawn with
+{\ttfamily draw\_invisible}. In the following descriptions
+{\ttfamily S} and {\ttfamily T} are the parameters. Remember
+to initialize {\ttfamily NF}. The surface is defined so
+that quadrangles are used whenever possible. If
+impossible, two triangles are used but their
+orientation is selected to maximize the surface
+smoothness. Also note that, unlike
+{\ttfamily hexagonaltrimesh()}, the spatial range you
+require to be visible is always first reshaped into a
+cube and second compressed or extended vertically. How
+much the cube is compressed or extended depends on the
+last {\ttfamily numeric} argument, the compression factor
+for {\ttfamily Z}, meaning that the final height of the
+cube is 2/(compression factor). Thanks to Sebastian
+Sturm for pointing the need to explain this.
+\begin{enumerate}
+\item {\ttfamily numeric} Number of {\ttfamily T} steps.
+\item {\ttfamily numeric} Number of {\ttfamily S} steps.
+\item {\ttfamily numeric} Minimal {\ttfamily T} value.
+\item {\ttfamily numeric} Maximal {\ttfamily T} value.
+\item {\ttfamily numeric} Minimal {\ttfamily S} value.
+\item {\ttfamily numeric} Maximal {\ttfamily S} value.
+\item {\ttfamily numeric} Minimal {\ttfamily X} value.
+\item {\ttfamily numeric} Maximal {\ttfamily X} value.
+\item {\ttfamily numeric} Minimal {\ttfamily Y} value.
+\item {\ttfamily numeric} Maximal {\ttfamily Y} value.
+\item {\ttfamily numeric} Minimal {\ttfamily Z} value.
+\item {\ttfamily numeric} Maximal {\ttfamily Z} value.
+\item {\ttfamily numeric} Compression factor for {\ttfamily Z}
+values.
+\item {\ttfamily text} Name of the function that
+returns a surface point (of {\ttfamily color} type)
+for each pair ({\ttfamily S},{\ttfamily T}).
+\end{enumerate}
+\end{itemize}
+
+
+\end{document}
diff --git a/Master/texmf-dist/doc/metapost/featpost/latex/mflogohack.sty b/Master/texmf-dist/doc/metapost/featpost/latex/mflogohack.sty
new file mode 100644
index 00000000000..7bf5f31aac8
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/latex/mflogohack.sty
@@ -0,0 +1,31 @@
+%%
+%% This is file `mflogohack.sty',
+%%
+%% Copyright (C) 1994--1999 Ulrik Vieth
+%% Hacked without right 2004 L. Nobre G.
+%%
+%% This file is part of the `featpost' package.
+%%
+%% This program is free software; you can redistribute it and/or
+%% modify it under the terms of the LaTeX Project Public License
+%% as described in lppl.txt in the base LaTeX distribution; either
+%% version 1 of the License, or (at your option) any later version.
+%%
+%% This program 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.
+%%
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+\ProvidesPackage{mflogohack}
+[2004/01/29 LaTeX package for Metafont, MetaPost, FeatPost and ANEEMATE logos]
+\DeclareRobustCommand\logofamily{%
+ \not@math@alphabet\logofamily\relax
+ \fontencoding{U}\fontfamily{logo}\selectfont}
+\DeclareTextFontCommand{\textlogo}{\logofamily}
+\def\MF{\textlogo{META}\@dischyph\textlogo{FONT}\@}
+\def\MP{\textlogo{META}\@dischyph\textlogo{POST}\@}
+\def\FP{\textlogo{FEAT}\@dischyph\textlogo{POST}\@}
+\def\AM{\textlogo{ANEE}\@dischyph\textlogo{MATE}\@}
+\endinput
+%%
+%% End of file `mflogohack.sty'.
diff --git a/Master/texmf-dist/doc/metapost/featpost/latex/null.sty b/Master/texmf-dist/doc/metapost/featpost/latex/null.sty
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/latex/null.sty
diff --git a/Master/texmf-dist/doc/metapost/featpost/latex/qwertz.sty b/Master/texmf-dist/doc/metapost/featpost/latex/qwertz.sty
new file mode 100644
index 00000000000..aeade62b172
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/latex/qwertz.sty
@@ -0,0 +1,19 @@
+
+% qwertz TeX macros
+
+\catcode`\"=12
+\sloppy
+\newtheorem{definition}{Definition}
+\newtheorem{proposition}{Proposition}
+\newtheorem{lemma}{Lemma}
+\newtheorem{corollary}{Corollary}
+\newtheorem{theorem}{Theorem}
+\newcommand{\mch}[1]{{\ifmmode#1 \else\(#1\)\fi}}
+\newcommand{\lt}{{\ifmmode{<}\else{\verb+<+}\fi}}
+\newcommand{\gt}{{\ifmmode{>}\else{\verb+>+}\fi}}
+\newcommand{\verbar}{{\ifmmode{|}\else{\tt|}\fi}}
+\newcommand{\idx}[1]{#1\index{#1}}
+\newcommand{\cdx}[1]{#1\index{#1@{\tt #1}}}
+\newcommand{\nidx}[1]{\index{#1}}
+\newcommand{\ncdx}[1]{\index{#1@{\tt #1}}}
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/macro/README.macro b/Master/texmf-dist/doc/metapost/featpost/macro/README.macro
new file mode 100644
index 00000000000..e0ee0478491
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/macro/README.macro
@@ -0,0 +1,13 @@
+The first thing to do here is
+
+ inimpost featpost
+
+But it would be more standard
+putting "featpost3Dplus2D.mp"
+inside /usr/share/texmf/metapost/misc/,
+launching the command "texhash"
+and than uncommenting the line
+
+ %input featpost3Dplus2D;
+
+in the example files.
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/cylimple.1.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/cylimple.1.png
new file mode 100644
index 00000000000..812f8d4487b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/cylimple.1.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/globe.1.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/globe.1.png
new file mode 100644
index 00000000000..9b016f22a45
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/globe.1.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rigorouscone.1.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rigorouscone.1.png
new file mode 100644
index 00000000000..18081be89cd
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rigorouscone.1.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rigorousfearpath.1.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rigorousfearpath.1.png
new file mode 100644
index 00000000000..eab2f9397b6
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rigorousfearpath.1.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rotatnlc.1.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rotatnlc.1.png
new file mode 100644
index 00000000000..41dcb61fa9c
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/rotatnlc.1.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/stageforthree.2.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/stageforthree.2.png
new file mode 100644
index 00000000000..78536f22e49
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/stageforthree.2.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/torus.5.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/torus.5.png
new file mode 100644
index 00000000000..8b10502aef5
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/torus.5.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/torus.6.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/torus.6.png
new file mode 100644
index 00000000000..a306e87699f
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/torus.6.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/nontextualpng/triangulartrimesh.1.png b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/triangulartrimesh.1.png
new file mode 100644
index 00000000000..b60d9ddc666
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/nontextualpng/triangulartrimesh.1.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/border140.png b/Master/texmf-dist/doc/metapost/featpost/png/border140.png
new file mode 100644
index 00000000000..00fce80f1ce
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/border140.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/borderframetest.png b/Master/texmf-dist/doc/metapost/featpost/png/borderframetest.png
new file mode 100644
index 00000000000..c74f9aba96b
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/borderframetest.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/composite.png b/Master/texmf-dist/doc/metapost/featpost/png/composite.png
new file mode 100644
index 00000000000..ac67893127d
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/composite.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/downloadicon.png b/Master/texmf-dist/doc/metapost/featpost/png/downloadicon.png
new file mode 100644
index 00000000000..7ef2e9f90bf
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/downloadicon.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/experfilminifram.png b/Master/texmf-dist/doc/metapost/featpost/png/experfilminifram.png
new file mode 100644
index 00000000000..5578049414a
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/experfilminifram.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/featpost2.png b/Master/texmf-dist/doc/metapost/featpost/png/featpost2.png
new file mode 100644
index 00000000000..44b5f8ede98
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/featpost2.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/inifram.png b/Master/texmf-dist/doc/metapost/featpost/png/inifram.png
new file mode 100644
index 00000000000..b936a20286a
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/inifram.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/lcdistortsallinifram.png b/Master/texmf-dist/doc/metapost/featpost/png/lcdistortsallinifram.png
new file mode 100644
index 00000000000..319c96c7564
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/lcdistortsallinifram.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/metapostlace.png b/Master/texmf-dist/doc/metapost/featpost/png/metapostlace.png
new file mode 100644
index 00000000000..de39b3c09e5
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/metapostlace.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/png/myicon.png b/Master/texmf-dist/doc/metapost/featpost/png/myicon.png
new file mode 100644
index 00000000000..17a2a2376c2
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/png/myicon.png
Binary files differ
diff --git a/Master/texmf-dist/doc/metapost/featpost/typesetinspace/README.mpy b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/README.mpy
new file mode 100644
index 00000000000..a5903bcd0ec
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/README.mpy
@@ -0,0 +1,21 @@
+The files contained in this directory are, probably, obsolete copies
+of the files with the same name that you should retrieve from
+
+http://www.pragma-ade.com/context/current/cont-tmf.zip
+
+unless you already have CONTEXT installed. These files are provided
+here as an unwarranted short-cut to start experimenting typography
+in three-dimensional space with the aid of FeatPost macro
+"closedpathinspace". See featpost/example/standard/eemcsblabla.mp
+
+Run
+ mpost example.mp
+ perl makempy.pl example --noclean
+
+This will produce the MetaPost program
+ mpy-example.tmp
+that contains the text of example.mp as paths.
+
+These instructions may be found at the end of
+http://matagalatlante.org/nobre/hyt/technicaldrawfromphoto.html
+
diff --git a/Master/texmf-dist/doc/metapost/featpost/typesetinspace/example.mp b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/example.mp
new file mode 100644
index 00000000000..befdb336304
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/example.mp
@@ -0,0 +1,17 @@
+input mp-grph ;
+
+% graphictextformat := "context" ;
+% graphictextformat := "plain" ;
+graphictextformat := "latex" ;
+graphictextdirective "\documentclass[]{article}\usepackage{mathpazo}" ;
+
+beginfig(1);
+ graphictext
+ "\vbox{\hsize10cm $E=mc^2$, bl\'{a}-bl\'{a}.}"
+ scaled 8
+ withdrawcolor blue
+ withfillcolor red
+ withpen pencircle scaled 2pt ;
+endfig;
+
+end
diff --git a/Master/texmf-dist/doc/metapost/featpost/typesetinspace/exampleminimal.mp b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/exampleminimal.mp
new file mode 100644
index 00000000000..639ac3b5d20
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/exampleminimal.mp
@@ -0,0 +1,7 @@
+input mp-grph ;
+beginfig(1);
+ string it;
+ it = "N\~{a}o d\'{a}!";
+ graphictext it;
+endfig;
+end.
diff --git a/Master/texmf-dist/doc/metapost/featpost/typesetinspace/makempy.pl b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/makempy.pl
new file mode 100644
index 00000000000..5b52ee0bb11
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/makempy.pl
@@ -0,0 +1,365 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+#D \module
+#D [ file=makempy.pl,
+#D version=2000.12.14,
+#D title=\METAFUN,
+#D subtitle=\METAPOST\ Text Graphics,
+#D author=Hans Hagen,
+#D date=\currentdate,
+#D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+#C
+#C This module is part of the \CONTEXT\ macro||package and is
+#C therefore copyrighted by \PRAGMA. See licen-en.pdf for
+#C details.
+
+# Tobias Burnus provided the code needed to proper testing
+# of binaries on UNIX as well as did some usefull suggestions
+# to improve the functionality.
+
+# This script uses GhostScript and PStoEdit as well as
+# pdfTeX, and if requested TeXEdit and ConTeXt.
+
+# todo: we can nowadays do without the intermediate step, because GS
+# can now handle PDF quite good
+
+use Getopt::Long ;
+use Config ;
+use strict ;
+
+$Getopt::Long::passthrough = 1 ; # no error message
+$Getopt::Long::autoabbrev = 1 ; # partial switch accepted
+
+my $help = 0 ;
+my $silent = 0 ;
+my $force = 0 ;
+my $noclean = 0 ;
+
+my $amethod = my $pmethod = my $gmethod = 0 ;
+
+my $format = "plain" ; # can be "context" for plain users too
+
+&GetOptions
+ ( "help" => \$help ,
+ "silent" => \$silent ,
+ "force" => \$force ,
+ "pdftops" => \$pmethod ,
+ "xpdf" => \$pmethod ,
+ "acrobat" => \$amethod ,
+ "reader" => \$amethod ,
+ "gs" => \$gmethod ,
+ "ghostscript" => \$gmethod ,
+ "noclean" => \$noclean ) ;
+
+my $mpochecksum = 0 ;
+
+my %tex ; my %start ; my %stop ;
+
+$tex{plain} = "pdftex" ;
+$tex{latex} = "pdflatex" ;
+$tex{context} = "texexec --batch --once --interface=en --pdf" ;
+
+$start{plain} = '' ;
+$stop{plain} = '\end' ;
+
+$start{latex} = '\begin{document}' ;
+$stop{latex} = '\end{document}' ;
+
+$start{context} = '\starttext' ;
+$stop{context} = '\stoptext' ;
+
+my $ghostscript = "" ;
+my $pstoedit = "" ;
+my $pdftops = "" ;
+my $acroread = "" ;
+
+my $wereondos = ($Config{'osname'} =~ /dos|mswin/io) ;
+
+# Unix only: assume that "gs" in the path. We could also
+# use $ghostscipt = system "which gs" but this would require
+# that which is installedd on the system.
+
+sub checkenv
+ { my ($var, $env) = @_ ;
+ if ($var)
+ { return $var }
+ elsif ($ENV{$env})
+ { return $ENV{$env} }
+ else
+ { return $var } }
+
+$ghostscript = checkenv ($ghostscript, "GS_PROG" ) ;
+$ghostscript = checkenv ($ghostscript, "GS" ) ;
+$pstoedit = checkenv ($pstoedit , "PSTOEDIT") ;
+$pdftops = checkenv ($pdftops , "PDFTOPS" ) ;
+$acroread = checkenv ($acroread , "ACROREAD") ;
+
+sub setenv
+ { my ($var, $unix, $win) = @_ ;
+ if ($var)
+ { return $var }
+ elsif ($wereondos)
+ { return $win }
+ else
+ { return $unix } }
+
+$ghostscript = setenv($ghostscript, "gs" , "gswin32c") ;
+$pstoedit = setenv($pstoedit , "pstoedit", "pstoedit") ;
+$pdftops = setenv($pdftops , "pdftops" , "pdftops" ) ;
+$acroread = setenv($acroread , "acroread", "" ) ;
+
+# Force a method if unknown.
+
+unless ($pmethod||$amethod||$gmethod)
+ { if ($wereondos) { $pmethod = 1 } else { $amethod = 1 } }
+
+# Set the error redirection used under Unix:
+# stderr -> stdout
+
+my $logredirection = '>>' ;
+
+# This unfortunally doesn't work with the ksh and simple sh
+#
+# if (!$wereondos)
+# { $logredirection = '2>&1 >>' ; # Bash
+# $logredirection = '>>&' ; # tcsh, Bash
+# default $logredirection. }
+
+# Some TeX Code Snippets.
+
+my $macros = '
+
+% auxiliary macros
+
+\input supp-mis.tex
+
+\def\startTEXpage[scale=#1]%
+ {\output{}
+ \batchmode
+ \pdfoutput=1
+ \pdfcompresslevel=9
+ \hoffset=-1in
+ \voffset=\hoffset
+ \scratchcounter=#1
+ \divide\scratchcounter1000
+ \edef\TEXscale{\the\scratchcounter\space}
+ \forgetall
+ \setbox0=\vbox\bgroup}
+
+\def\stopTEXpage
+ {\egroup
+ \dimen0=\ht0 \advance\dimen0 \dp0
+ \setbox2=\vbox to 10\dimen0
+ {\pdfliteral{\TEXscale 0 0 \TEXscale 0 0 cm}
+ \copy0
+ \pdfliteral{1 0 0 1 0 0 cm}
+ \vfill}
+ \wd2=10\wd0
+ \pdfpageheight=\ht2
+ \pdfpagewidth=\wd2
+ \ScaledPointsToBigPoints{\number\pdfpageheight}\pdfcropheight
+ \ScaledPointsToBigPoints{\number\pdfpagewidth }\pdfcropwidth
+ \expanded{\pdfpageattr{/CropBox [0 0 \pdfcropwidth \space \pdfcropheight]}}
+ \shipout\hbox{\box2}}
+
+% end of auxiliary macros' ;
+
+sub report
+ { return if $silent ;
+ my $str = shift ;
+ if ($str =~ /(.*?)\s+([\:\/])\s+(.*)/o)
+ { if ($1 eq "") { $str = " " } else { $str = $2 }
+ print sprintf("%22s $str %s\n",$1,$3) } }
+
+sub error
+ { report("processing aborted : " . shift) ;
+ exit }
+
+sub process
+ { report("generating : " . shift) }
+
+sub banner
+ { return if $silent ;
+ print "\n" ;
+ report ("MakeMPY 1.1 - MetaFun / PRAGMA ADE 2000-2004") ;
+ print "\n" }
+
+my $metfile = "" ; # main metapost file
+my $mpofile = "" ; # metapost text specifiation file (provided)
+my $mpyfile = "" ; # metapost text picture file (generated)
+my $texfile = "" ; # temporary tex file
+my $pdffile = "" ; # temporary pdf file
+my $tmpfile = "" ; # temporary metapost file
+my $posfile = "" ; # temporary postscript file
+my $logfile = "" ; # temporary log file
+my $errfile = "" ; # final log file (with suffix log)
+
+sub show_help_info
+ { banner ;
+ report ("--help : this message" ) ;
+ report ("--noclean : don't remove temporary files" ) ;
+ report ("--force : force processing (ignore checksum)" ) ;
+ report ("--silent : don't show messages" ) ;
+ print "\n" ;
+ report ("--acrobat : use acrobat (reader) for pdf->ps (on unix)") ;
+ report ("--pdftops : use pdftops (xpdf) pdf->ps") ;
+ report ("--ghostscript : use ghostscript (gs) for pdf->ps") ;
+ print "\n" ;
+ report ("input file : metapost file with graphics") ;
+ report ("programs needed : texexec and english context") ;
+ report (" : pdftops from the xpdf suite, or") ; # page size buggy
+ report (" : pdf2ps and ghostscript, or") ;
+ report (" : acrobat reader for unix, and") ;
+ report (" : pstoedit and ghostscript") ;
+ report ("output file : metapost file with pictures") ;
+ exit }
+
+sub check_input_file
+ { my $file = $ARGV[0] ;
+ if ((!defined($file))||($file eq ""))
+ { banner ; error("no filename given") }
+ else
+ { $file =~ s/\.mp.*$//o ;
+ $metfile = "$file.mp" ;
+ $mpofile = "$file.mpo" ;
+ $mpyfile = "$file.mpy" ;
+ $logfile = "$file.log" ;
+ $texfile = "mpy-$file.tex" ;
+ $pdffile = "mpy-$file.pdf" ;
+ $posfile = "mpy-$file.pos" ;
+ $tmpfile = "mpy-$file.tmp" ;
+ $errfile = "mpy-$file.log" ;
+ if (! -f $metfile)
+ { banner ; error("$metfile is empty") }
+ elsif (-s $mpofile < 32)
+ { unlink $mpofile ; # may exist with zero length
+ unlink $mpyfile ; # get rid of left overs
+ exit }
+ else
+ { banner ; report("processing file : $mpofile") } } }
+
+sub verify_check_sum # checksum calculation from perl documentation
+ { return unless (open (MPO,"$mpofile")) ;
+ $mpochecksum = do { local $/ ; unpack("%32C*",<MPO>) % 65535 } ;
+ close (MPO) ;
+ return unless open (MPY,"$mpyfile") ;
+ my $str = <MPY> ; chomp $str ;
+ close (MPY) ;
+ if ($str =~ /^\%\s*mpochecksum\s*\:\s*(\d+)/o)
+ { if ($mpochecksum eq $1)
+ { report("mpo checksum : $mpochecksum / unchanged") ;
+ exit unless $force }
+ else
+ { report("mpo checksum : $mpochecksum / changed") } } }
+
+sub cleanup_files
+ { my @files = <mpy-*.*> ;
+ foreach (@files) { unless (/\.log/o) { unlink $_ } } }
+
+sub construct_tex_file
+ { my $n = 0 ;
+ unless (open (MPO, "<$mpofile"))
+ { error("unable to open $mpofile") }
+ unless (open (TEX, ">$texfile"))
+ { error("unable to open $texfile") }
+ my $textext = "" ;
+ while (<MPO>)
+ { s/\s*$//mois ;
+ if (/\%\s*format=(\w+)/)
+ { $format = $1 }
+ else # if (!/^\%/)
+ { if (/startTEXpage/o)
+ { ++$n ;
+ $textext .= "$start{$format}\n" ;
+ $start{$format} = "" }
+ $textext .= "$_\n" } }
+ unless (defined($tex{$format})) { $format = "plain" }
+ if ($format eq "context") { $macros = "" }
+ # print TEX "$start{$format}\n$macros\n$textext\n$stop{$format}\n" ;
+ print TEX "$start{$format}\n\n" if $start{$format} ;
+ print TEX "$macros\n" if $macros ;
+ print TEX "$textext\n" if $textext ;
+ print TEX "$stop{$format}\n" if $stop{$format} ;
+ close (MPO) ;
+ close (TEX) ;
+ report("tex format : $format") ;
+ report("requested texts : $n") }
+
+sub construct_mpy_file
+ { unless (open (TMP, "<$tmpfile"))
+ { error("unable to open $tmpfile file") }
+ unless (open (MPY, ">$mpyfile"))
+ { error("unable to open $mpyfile file") }
+ print MPY "% mpochecksum : $mpochecksum\n" ;
+ my $copying = my $n = 0 ;
+ while (<TMP>)
+ { if (s/beginfig/begingraphictextfig/o)
+ { print MPY $_ ; $copying = 1 ; ++$n }
+ elsif (s/endfig/endgraphictextfig/o)
+ { print MPY $_ ; $copying = 0 }
+ elsif ($copying)
+ { print MPY $_ } }
+ close (TMP) ;
+ close (MPY) ;
+ report("processed texts : $n") ;
+ report("produced file : $mpyfile") }
+
+sub run
+ { my ($resultfile, $program,$arguments) = @_ ;
+ my $result = system("$program $arguments $logredirection $logfile") ;
+ unless (-f $resultfile) { error("invalid `$program' run") } }
+
+sub make_pdf_pages
+ { process ("pdf file") ;
+ run ($pdffile, "$tex{$format}", "$texfile") }
+
+sub make_mp_figures
+ { process ("postscript file") ;
+ if ($pmethod) { run($posfile, "$pdftops",
+ "-paper match $pdffile $posfile") }
+ if ($gmethod) { run($posfile, "$ghostscript",
+ "-q -sOutputFile=$posfile -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite $pdffile") }
+ if ($amethod) { run($posfile, "$acroread",
+ "-toPostScript -pairs $pdffile $posfile") } }
+
+sub make_mp_pictures_ps
+ { process ("metapost file") ;
+ run ($tmpfile, "$pstoedit", "-ssp -dt -f mpost $posfile $tmpfile") }
+
+sub make_mp_pictures_pdf
+ { process ("metapost file") ;
+ run ($tmpfile, "$pstoedit", "-ssp -dt -f mpost $pdffile $tmpfile") }
+
+if ($help) { show_help_info }
+
+check_input_file ;
+verify_check_sum ;
+cleanup_files ;
+construct_tex_file ;
+make_pdf_pages ;
+if (1)
+ { make_mp_pictures_pdf ; }
+else
+ { make_mp_figures ;
+ make_mp_pictures_ps ; }
+construct_mpy_file ; # less save : rename $tmpfile, $mpyfile ;
+unless ($noclean) { cleanup_files }
+
+# a simple test file (needs context)
+#
+# % output=pdftex
+#
+# \starttext
+#
+# \startMPpage
+# graphictext
+# "\bf MAKE"
+# scaled 8
+# zscaled (1,2)
+# withdrawcolor \MPcolor{blue}
+# withfillcolor \MPcolor{gray}
+# withpen pencircle scaled 5pt ;
+# \stopMPpage
+#
+# \stoptext
diff --git a/Master/texmf-dist/doc/metapost/featpost/typesetinspace/mp-grph.mp b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/mp-grph.mp
new file mode 100644
index 00000000000..18c43c57b53
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/mp-grph.mp
@@ -0,0 +1,295 @@
+%D \module
+%D [ file=mp-grph.mp,
+%D version=2000.12.14,
+%D title=\CONTEXT\ \METAPOST\ graphics,
+%D subtitle=graphic text support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See licen-en.pdf for
+%C details.
+
+%D Under construction.
+
+if unknown context_tool : input mp-tool ; fi ;
+if known context_grph : endinput ; fi ;
+
+boolean context_grph ; context_grph := true ;
+
+string CRLF ; CRLF := char 10 & char 13 ;
+
+picture _currentpicture_ ;
+
+def beginfig (expr c) =
+ begingroup
+ charcode := c ;
+ resetfig ;
+ scantokens extra_beginfig ;
+enddef ;
+
+def resetfig =
+ clearxy ;
+ clearit ;
+ clearpen ;
+ pickup defaultpen ;
+ interim linecap := linecap ;
+ interim linejoin := linejoin ;
+ interim miterlimit := miterlimit ;
+ save _background_ ; color _background_ ; _background_ := background ;
+ save background ; color background ; background := _background_ ;
+ drawoptions () ;
+enddef ;
+
+def protectgraphicmacros =
+ save showtext ;
+ save beginfig ; let beginfig = begingraphictextfig ;
+ save endfig ; let endfig = endgraphictextfig ;
+ save end ; let end = relax ;
+ interim prologues := prologues ;
+ resetfig ; % resets currentpicture
+enddef ;
+
+numeric currentgraphictext ; currentgraphictext := 0 ;
+string graphictextformat ; graphictextformat := "plain" ;
+string graphictextstring ; graphictextstring := "" ;
+string graphictextfile ; graphictextfile := "dummy.mpo" ;
+
+def savegraphictext (expr str) =
+ graphictextfile := jobname & ".mpo" ;
+ if (graphictextstring<>"") :
+ write graphictextstring to graphictextfile ;
+ graphictextstring := "" ;
+ fi ;
+ write str to graphictextfile ;
+ let erasegraphictextfile = relax ;
+enddef ;
+
+def erasegraphictextfile =
+ graphictextfile := jobname & ".mpo" ;
+ write EOF to graphictextfile ;
+ let erasegraphictextfile = relax ;
+enddef ;
+
+extra_beginfig := extra_beginfig & " erasegraphictextfile ;" ;
+
+def begingraphictextfig (expr n) =
+ foundpicture := n ; scratchpicture := nullpicture ;
+enddef ;
+
+def endgraphictextfig =
+ if foundpicture = currentgraphictext :
+ expandafter endinput
+ else :
+ scratchpicture := nullpicture ;
+ fi ;
+enddef ;
+
+def loadfigure primary filename =
+ doloadfigure (filename)
+enddef ;
+
+def doloadfigure (expr filename) text figureattributes =
+ begingroup ;
+ save figurenumber, figurepicture, number, fixedplace ;
+ numeric figurenumber ; figurenumber := 0 ;
+ boolean figureshift ; figureshift := true ;
+ picture figurepicture ; figurepicture := currentpicture ;
+ def number primary n = hide(figurenumber := n) enddef ;
+ def fixedplace = hide(figureshift := false) enddef ;
+ protectgraphicmacros ;
+ % defaults
+ interim linecap := rounded ;
+ interim linejoin := rounded ;
+ interim miterlimit := 10 ;
+ %
+ currentpicture := nullpicture ;
+ draw fullcircle figureattributes ; % expand number
+ currentpicture := nullpicture ;
+ def beginfig (expr n) =
+ currentpicture := nullpicture ;
+ if (figurenumber=n) or (figurenumber=0) :
+ let endfig = endinput ;
+ fi ;
+ enddef ;
+ let endfig = relax ;
+ readfile(filename) ;
+ if figureshift :
+ currentpicture := currentpicture shifted -llcorner currentpicture ;
+ fi ;
+ addto figurepicture also currentpicture figureattributes ;
+ currentpicture := figurepicture ;
+ endgroup ;
+enddef ;
+
+def graphictext primary t =
+ dographictext(t)
+enddef ;
+
+def dographictext (expr t) =
+ begingroup ;
+ save figurepicture ; picture figurepicture ;
+ figurepicture := currentpicture ; currentpicture := nullpicture ;
+ if graphictextformat<>"" :
+ graphictextstring :=
+ "% format=" & graphictextformat & CRLF & graphictextstring ;
+ graphictextformat := "" ;
+ fi ;
+ currentgraphictext := currentgraphictext + 1 ;
+ savegraphictext ("\startTEXpage[scale=10000]" & t & "\stopTEXpage") ;
+ dofinishgraphictext
+enddef ;
+
+def redographictext primary t =
+ regraphictext(t)
+enddef ;
+
+def regraphictext (expr t) =
+ begingroup ;
+ save figurepicture ; picture figurepicture ;
+ figurepicture := currentpicture ; currentpicture := nullpicture ;
+ save currentgraphictext ; numeric currentgraphictext ;
+ currentgraphictext := t ;
+ dofinishgraphictext
+enddef ;
+
+%D Believe it or not, but it took me half a day to uncover
+%D the following neccessity:
+%D
+%D \starttypen
+%D save withfillcolor, withdrawcolor ;
+%D \stoptypen
+%D
+%D When we have more than one graphictext, these will be
+%D defined after the first graphic. For some obscure reason,
+%D this means that in the next graphic they will be called, but
+%D afterwards the data and boolean are not set. Don't ask me
+%D why.
+
+def dofinishgraphictext text x_op_x =
+ protectgraphicmacros ; % resets currentpicture
+ interim linecap := butt ; % normally rounded
+ interim linejoin := mitered ; % normally rounded
+ interim miterlimit := 10 ; % todo
+ let normalwithshade = withshade ;
+ save foundpicture, scratchpicture, str ;
+ save fill, draw, withshade, reversefill, outlinefill ;
+ save withfillcolor, withdrawcolor ; % quite important
+ numeric foundpicture ; picture scratchpicture ; string str ;
+ def draw expr p =
+ % the first, naive implementation was:
+ % addto scratchpicture doublepath p withpen currentpen ;
+ % but it is better to turn lines into fills
+ addto scratchpicture contour boundingbox
+ image (addto currentpicture doublepath p withpen currentpen) ;
+ enddef ;
+ def fill expr p =
+ addto scratchpicture contour p withpen currentpen ;
+ enddef ;
+ def f_op_f = enddef ; boolean f_color ; f_color := false ;
+ def d_op_d = enddef ; boolean d_color ; d_color := false ;
+ def s_op_s = enddef ; boolean s_color ; s_color := false ;
+ boolean reverse_fill ; reverse_fill := false ;
+ boolean outline_fill ; outline_fill := false ;
+ def reversefill =
+ hide(reverse_fill := true )
+ enddef ;
+ def outlinefill =
+ hide(outline_fill := true )
+ enddef ;
+ def withshade primary c =
+ hide(def s_op_s = normalwithshade c enddef ; s_color := true )
+ enddef ;
+ def withfillcolor primary c =
+ hide(def f_op_f = withcolor c enddef ; f_color := true )
+ enddef ;
+ def withdrawcolor primary c =
+ hide(def d_op_d = withcolor c enddef ; d_color := true )
+ enddef ;
+ scratchpicture := nullpicture ;
+ addto scratchpicture doublepath origin x_op_x ; % pre-roll
+ for i within scratchpicture : % Below here is a dirty tricky test!
+ if (urcorner dashpart i) = origin : outline_fill := false ; fi ;
+ endfor ;
+ scratchpicture := nullpicture ;
+ readfile(jobname & ".mpy") ;
+ scratchpicture := (scratchpicture shifted -llcorner scratchpicture) scaled (1/10) ;
+ if not d_color and not f_color : d_color := true ; fi
+ if s_color : d_color := false ; f_color := false ; fi ;
+ currentpicture := figurepicture ;
+ if d_color and not reverse_fill :
+ for i within scratchpicture :
+ if f_color and outline_fill :
+ addto currentpicture doublepath pathpart i _op_ x_op_x f_op_f
+ dashed nullpicture ;
+ fi ;
+ if filled i :
+ addto currentpicture doublepath pathpart i _op_ x_op_x d_op_d ;
+ fi ;
+ endfor ;
+ fi ;
+ if f_color :
+ for i within scratchpicture :
+ if filled i :
+ addto currentpicture contour pathpart i _op_ x_op_x f_op_f
+ withpen pencircle scaled 0 ;
+ fi ;
+ endfor ;
+ fi ;
+ if d_color and reverse_fill :
+ for i within scratchpicture :
+ if filled i :
+ addto currentpicture doublepath pathpart i _op_ x_op_x d_op_d ;
+ fi ;
+ endfor ;
+ fi ;
+ if s_color :
+ for i within scratchpicture :
+ if filled i :
+ addto currentpicture contour pathpart i _op_ x_op_x s_op_s ;
+ fi ;
+ endfor ;
+ else :
+ for i within scratchpicture :
+ if stroked i :
+ addto currentpicture doublepath pathpart i _op_ x_op_x d_op_d ;
+ fi ;
+ endfor ;
+ fi ;
+ endgroup ;
+enddef ;
+
+def resetgraphictextdirective =
+ graphictextstring := "" ;
+enddef ;
+
+def graphictextdirective text t =
+ graphictextstring := graphictextstring & t & CRLF ;
+enddef ;
+
+endinput
+
+% example
+
+input mp-grph ;
+
+ graphictextformat := "context" ;
+% graphictextformat := "plain" ;
+% graphictextformat := "latex" ; graphictextdirective "\documentclass[]{article}" ;
+
+beginfig (1) ;
+ graphictext
+ "\vbox{\hsize10cm \input tufte }"
+ scaled 8
+ withdrawcolor blue
+ withfillcolor red
+ withpen pencircle scaled 2pt ;
+endfig ;
+
+beginfig(1) ;
+ loadfigure "gracht.mp" rotated 20 ;
+ loadfigure "koe.mp" number 1 scaled 2 ;
+endfig ;
+
+end
diff --git a/Master/texmf-dist/doc/metapost/featpost/typesetinspace/mp-tool.mp b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/mp-tool.mp
new file mode 100644
index 00000000000..925b9ca4449
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/typesetinspace/mp-tool.mp
@@ -0,0 +1,2366 @@
+%D \module
+%D [ file=mp-tool.mp,
+%D version=1998.02.15,
+%D title=\CONTEXT\ \METAPOST\ graphics,
+%D subtitle=auxiliary macros,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% a cleanup is needed, like using image and alike
+% use a few more "newinternal"'s
+
+%D This module is rather preliminary and subjected to
+%D changes.
+
+if known context_tool : endinput ; fi ;
+
+boolean context_tool ; context_tool := true ;
+
+%D New, version number testing:
+%D
+%D \starttyping
+%D fill fullcircle scaled 2cm withcolor if mpversiongt("0.6") : red else : green fi ;
+%D fill fullcircle scaled 1cm withcolor if mpversionlt(0.6) : blue else : white fi ;
+%D \stoptyping
+
+if not known mpversion : string mpversion ; mpversion := "0.641" ; fi ;
+
+% vardef mpversiongt(expr s) =
+% scantokens (mpversion & " > " & if numeric s : decimal s else : s fi)
+% enddef ;
+% vardef mpversionlt(expr s) =
+% scantokens (mpversion & " < " & if numeric s : decimal s else : s fi)
+% enddef ;
+% vardef mpversioneq(expr s) =
+% scantokens (mpversion & " = " & if numeric s : decimal s else : s fi)
+% enddef ;
+
+%D More interesting:
+%D
+%D \starttyping
+%D fill fullcircle scaled 4cm withcolor if mpversiongt("0.6") : red else : green fi ;
+%D fill fullcircle scaled 2cm withcolor if mpversionlt(0.6) : blue else : white fi ;
+%D fill fullcircle scaled 1cm withcolor if mpversioncmp(0.6,">=") : yellow else : black fi ;
+%D \stoptyping
+
+vardef mpversioncmp(expr s, c) =
+ scantokens (mpversion & c & if numeric s : decimal s else : s fi)
+enddef ;
+
+vardef mpversionlt (expr s) = mpversioncmp(s, "<") enddef ;
+vardef mpversioneq (expr s) = mpversioncmp(s, "=") enddef ;
+vardef mpversiongt (expr s) = mpversioncmp(s, ">") enddef ;
+
+%D We always want \EPS\ conforming output, so we say:
+
+prologues := 2 ; % 1 = troff, 2 = tex
+warningcheck := 0 ;
+
+%D Namespace handling:
+
+% let exclamationmark = ! ;
+% let questionmark = ? ;
+%
+% def unprotect =
+% let ! = relax ;
+% let ? = relax ;
+% enddef ;
+%
+% def protect =
+% let ! = exclamationmark ;
+% let ? = questionmark ;
+% enddef ;
+%
+% unprotect ;
+%
+% mp!some!module = 10 ; show mp!some!module ; show somemodule ;
+%
+% protect ;
+
+%D A semicolor to be used in specials: ? ? ?
+
+string semicolor ; semicolor := char 59 ;
+
+%D By including this module, \METAPOST\ automatically writes a
+%D high resolution boundingbox to the \POSTSCRIPT\ file. This
+%D hack is due to John Hobby himself.
+
+% When somehow the first one gets no HiRes, then make sure
+% that the format matches the mem sizes in the config file.
+
+% eerste " " er uit
+
+string space ; space = char 32 ;
+
+vardef ddecimal primary p =
+ decimal xpart p & " " & decimal ypart p
+enddef ;
+
+extra_endfig := extra_endfig
+ & "special "
+ & "("
+ & ditto
+ & "%%HiResBoundingBox: "
+ & ditto
+ & "&ddecimal llcorner currentpicture"
+ & "&space"
+ & "&ddecimal urcorner currentpicture"
+ & ");";
+
+%D Also handy (when we flush colors):
+
+vardef dddecimal primary c =
+ decimal redpart c & " " & decimal greenpart c & " " & decimal bluepart c
+enddef ;
+
+%D We have standardized data file names:
+
+if not known _data_prefix_ :
+
+ string _data_prefix_ ; _data_prefix_ = "mpd-" ;
+ string _data_suffix_ ; _data_suffix_ = ".tmp" ;
+
+fi ;
+
+def data_file =
+ _data_prefix_ & decimal charcode & _data_suffix_
+enddef ;
+
+%D Because \METAPOST\ has a hard coded limit of 4~datafiles,
+%D we need some trickery when we have multiple files.
+
+if unknown collapse_data :
+ boolean collapse_data ; collapse_data := false ;
+fi ;
+
+boolean savingdata ; savingdata := false ;
+
+def savedata expr txt =
+ if collapse_data :
+ write if savingdata : txt else :
+ "\MPdata{" & decimal charcode & "}{" & txt & "}"
+ fi
+ & "%" to jobname & _data_suffix_ ;
+ else :
+ write txt to data_file ;
+ fi ;
+enddef ;
+
+def startsavingdata =
+ savingdata := true ;
+ if collapse_data :
+ write
+ "\MPdata{" & decimal charcode & "}{%"
+ to
+ jobname & _data_suffix_ ;
+ fi ;
+enddef ;
+
+def stopsavingdata =
+ savingdata := false ;
+ if collapse_data :
+ write "}%" to jobname & _data_suffix_ ;
+ fi ;
+enddef ;
+
+%D Instead of a keystroke eating save and allocation
+%D sequence, you can use the \citeer {new} alternatives to
+%D save and allocate in one command.
+
+def newcolor text v = forsuffixes i=v : save i ; color i ; endfor ; enddef ;
+def newnumeric text v = forsuffixes i=v : save i ; numeric i ; endfor ; enddef ;
+def newboolean text v = forsuffixes i=v : save i ; boolean i ; endfor ; enddef ;
+def newtransform text v = forsuffixes i=v : save i ; transform i ; endfor ; enddef ;
+def newpath text v = forsuffixes i=v : save i ; path i ; endfor ; enddef ;
+def newpicture text v = forsuffixes i=v : save i ; picture i ; endfor ; enddef ;
+def newstring text v = forsuffixes i=v : save i ; string i ; endfor ; enddef ;
+
+%D Sometimes we don't want parts of the graphics add to the
+%D bounding box. One way of doing this is to save the bounding
+%D box, draw the graphics that may not count, and restore the
+%D bounding box.
+%D
+%D \starttypen
+%D push_boundingbox currentpicture;
+%D pop_boundingbox currentpicture;
+%D \stoptypen
+%D
+%D The bounding box can be called with:
+%D
+%D \starttypen
+%D boundingbox currentpicture
+%D inner_boundingbox currentpicture
+%D outer_boundingbox currentpicture
+%D \stoptypen
+%D
+%D Especially the latter one can be of use when we include
+%D the graphic in a document that is clipped to the bounding
+%D box. In such occasions one can use:
+%D
+%D \starttypen
+%D set_outer_boundingbox currentpicture;
+%D \stoptypen
+%D
+%D Its counterpart is:
+%D
+%D \starttypen
+%D set_inner_boundingbox p
+%D \stoptypen
+
+path pushed_boundingbox;
+
+def push_boundingbox text p =
+ pushed_boundingbox := boundingbox p;
+enddef;
+
+def pop_boundingbox text p =
+ setbounds p to pushed_boundingbox;
+enddef;
+
+vardef boundingbox primary p =
+ if (path p) or (picture p) :
+ llcorner p -- lrcorner p -- urcorner p -- ulcorner p
+ else :
+ origin
+ fi -- cycle
+enddef;
+
+vardef inner_boundingbox primary p =
+ top rt llcorner p --
+ top lft lrcorner p --
+ bot lft urcorner p --
+ bot rt ulcorner p -- cycle
+enddef;
+
+vardef outer_boundingbox primary p =
+ bot lft llcorner p --
+ bot rt lrcorner p --
+ top rt urcorner p --
+ top lft ulcorner p -- cycle
+enddef;
+
+def innerboundingbox = inner_boundingbox enddef ;
+def outerboundingbox = outer_boundingbox enddef ;
+
+vardef set_inner_boundingbox text q =
+ setbounds q to inner_boundingbox q;
+enddef;
+
+vardef set_outer_boundingbox text q =
+ setbounds q to outer_boundingbox q;
+enddef;
+
+%D Some missing functions can be implemented rather
+%D straightforward:
+
+numeric Pi ; Pi := 3.1415926 ;
+
+vardef sqr primary x = (x*x) enddef ;
+vardef log primary x = (if x=0: 0 else: mlog(x)/mlog(10) fi) enddef ;
+vardef ln primary x = (if x=0: 0 else: mlog(x)/256 fi) enddef ;
+vardef exp primary x = ((mexp 256)**x) enddef ;
+vardef inv primary x = (if x=0: 0 else: x**-1 fi) enddef ;
+
+vardef pow (expr x,p) = (x**p) enddef ;
+
+vardef asin primary x = (x+(x**3)/6+3(x**5)/40) enddef ;
+vardef acos primary x = (asin(-x)) enddef ;
+vardef atan primary x = (x-(x**3)/3+(x**5)/5-(x**7)/7) enddef ;
+vardef tand primary x = (sind(x)/cosd(x)) enddef ;
+
+%D Here are Taco Hoekwater's alternatives (but
+%D vardef'd and primaried).
+
+pi := 3.1415926 ; radian := 180/pi ; % 2pi*radian = 360 ;
+
+vardef tand primary x = (sind(x)/cosd(x)) enddef ;
+vardef cotd primary x = (cosd(x)/sind(x)) enddef ;
+
+vardef sin primary x = (sind(x*radian)) enddef ;
+vardef cos primary x = (cosd(x*radian)) enddef ;
+vardef tan primary x = (sin(x)/cos(x)) enddef ;
+vardef cot primary x = (cos(x)/sin(x)) enddef ;
+
+vardef asin primary x = angle((1+-+x,x)) enddef ;
+vardef acos primary x = angle((x,1+-+x)) enddef ;
+
+vardef invsin primary x = ((asin(x))/radian) enddef ;
+vardef invcos primary x = ((acos(x))/radian) enddef ;
+
+vardef acosh primary x = ln(x+(x+-+1)) enddef ;
+vardef asinh primary x = ln(x+(x++1)) enddef ;
+
+vardef sinh primary x = save xx ; xx = exp x ; (xx-1/xx)/2 enddef ;
+vardef cosh primary x = save xx ; xx = exp x ; (xx+1/xx)/2 enddef ;
+
+%D We provide two macros for drawing stripes across a shape.
+%D The first method (with the n suffix) uses another method,
+%D slower in calculation, but more efficient when drawn. The
+%D first macro divides the sides into n equal parts. The
+%D first argument specifies the way the lines are drawn, while
+%D the second argument identifier the way the shape is to be
+%D drawn.
+%D
+%D \starttypen
+%D stripe_path_n
+%D (dashed evenly withcolor blue)
+%D (filldraw)
+%D fullcircle xscaled 100 yscaled 40 shifted (50,50) withpen pencircle scaled 4;
+%D \stoptypen
+%D
+%D The a (or angle) alternative supports arbitrary angles and
+%D is therefore more versatile.
+%D
+%D \starttypen
+%D stripe_path_a
+%D (withpen pencircle scaled 2 withcolor red)
+%D (draw)
+%D fullcircle xscaled 100 yscaled 40 withcolor blue;
+%D \stoptypen
+%D
+%D The first alternative obeys:
+
+stripe_n := 10;
+stripe_slot := 3;
+
+%D When no pen dimensions are passed, the slot determines
+%D the spacing.
+%D
+%D The angle alternative is influenced by:
+
+stripe_gap := 5;
+stripe_angle := 45;
+
+def stripe_path_n (text s_spec) (text s_draw) expr s_path =
+ do_stripe_path_n (s_spec) (s_draw) (s_path)
+enddef;
+
+def do_stripe_path_n (text s_spec) (text s_draw) (expr s_path) text s_text =
+ begingroup
+ save curpic, newpic, bb, pp, ww;
+ picture curpic, newpic;
+ path bb, pp;
+ pp := s_path;
+ curpic := currentpicture;
+ currentpicture := nullpicture;
+ s_draw pp s_text;
+ bb := boundingbox currentpicture;
+ newpic := currentpicture;
+ currentpicture := nullpicture;
+ ww := min(ypart urcorner newpic - ypart llcorner newpic,
+ xpart urcorner newpic - xpart llcorner newpic);
+ ww := ww/(stripe_slot*stripe_n);
+ for i=1/stripe_n step 1/stripe_n until 1:
+ draw point (1+i) of bb -- point (3-i) of bb
+ withpen pencircle scaled ww s_spec ;
+ endfor;
+ for i=0 step 1/stripe_n until 1:
+ draw point (3+i) of bb -- point (1-i) of bb
+ withpen pencircle scaled ww s_spec;
+ endfor;
+ clip currentpicture to pp;
+ addto newpic also currentpicture;
+ currentpicture := curpic;
+ addto currentpicture also newpic;
+ endgroup
+enddef;
+
+def stripe_path_a (text s_spec) (text s_draw) expr s_path =
+ do_stripe_path_a (s_spec) (s_draw) (s_path)
+enddef;
+
+def do_stripe_path_a (text s_spec) (text s_draw) (expr s_path) text s_text =
+ begingroup
+ save curpic, newpic, pp; picture curpic, newpic; path pp ;
+ pp := s_path ;
+ curpic := currentpicture;
+ currentpicture := nullpicture;
+ s_draw pp s_text ;
+ def do_stripe_rotation (expr p) =
+ (currentpicture rotatedaround(center p,stripe_angle))
+ enddef ;
+ s_max := max
+ (xpart llcorner do_stripe_rotation(currentpicture),
+ xpart urcorner do_stripe_rotation(currentpicture),
+ ypart llcorner do_stripe_rotation(currentpicture),
+ ypart urcorner do_stripe_rotation(currentpicture));
+ newpic := currentpicture;
+ currentpicture := nullpicture;
+ for i=-s_max-.5stripe_gap step stripe_gap until s_max:
+ draw (-s_max,i)--(s_max,i) s_spec;
+ endfor;
+ currentpicture := do_stripe_rotation(newpic);
+ clip currentpicture to pp ;
+ addto newpic also currentpicture;
+ currentpicture := curpic;
+ addto currentpicture also newpic;
+ endgroup
+enddef;
+
+%D A few normalizing macros:
+%D
+%D \starttypen
+%D xscale_currentpicture ( width )
+%D yscale_currentpicture ( height )
+%D xyscale_currentpicture ( width, height )
+%D scale_currentpicture ( width, height )
+%D \stoptypen
+
+% def xscale_currentpicture(expr the_width) =
+% natural_width := xpart urcorner currentpicture - xpart llcorner currentpicture;
+% currentpicture := currentpicture scaled (the_width/natural_width) ;
+% enddef;
+%
+% def yscale_currentpicture(expr the_height ) =
+% natural_height := ypart urcorner currentpicture - ypart llcorner currentpicture;
+% currentpicture := currentpicture scaled (the_height/natural_height) ;
+% enddef;
+%
+% def xyscale_currentpicture(expr the_width, the_height) =
+% natural_width := xpart urcorner currentpicture - xpart llcorner currentpicture;
+% natural_height := ypart urcorner currentpicture - ypart llcorner currentpicture;
+% currentpicture := currentpicture
+% xscaled (the_width/natural_width)
+% yscaled (the_height/natural_height) ;
+% enddef;
+%
+% def scale_currentpicture(expr the_width, the_height) =
+% xscale_currentpicture(the_width) ;
+% yscale_currentpicture(the_height) ;
+% enddef;
+
+% nog eens uitbreiden zodat path en pic worden afgehandeld.
+
+% natural_width := xpart urcorner currentpicture - xpart llcorner currentpicture;
+% currentpicture := currentpicture scaled (the_width/natural_width) ;
+
+% TODO TODO TODO TODO, not yet ok
+
+primarydef p xsized w =
+ (p if (bbwidth (p)>0) and (w>0) : scaled (w/bbwidth (p)) fi)
+enddef ;
+
+primarydef p ysized h =
+ (p if (bbheight(p)>0) and (h>0) : scaled (h/bbheight(p)) fi)
+enddef ;
+
+primarydef p xysized s =
+ begingroup ;
+ save wh, w, h ; pair wh ; numeric w, h ;
+ wh := paired (s) ; w := bbwidth(p) ; h := bbheight(p) ;
+ (p if (w>0) and (h>0) :
+ if xpart wh > 0 : xscaled (xpart wh/w) fi
+ if ypart wh > 0 : yscaled (ypart wh/h) fi
+ fi)
+ endgroup
+enddef ;
+
+primarydef p sized wh =
+ (p xysized wh)
+enddef ;
+
+def xscale_currentpicture(expr w) =
+ currentpicture := currentpicture xsized w ;
+enddef;
+
+def yscale_currentpicture(expr h) =
+ currentpicture := currentpicture ysized h ;
+enddef;
+
+def xyscale_currentpicture(expr w, h) =
+ currentpicture := currentpicture xysized (w,h) ;
+enddef;
+
+def scale_currentpicture(expr w, h) =
+ currentpicture := currentpicture xsized w ;
+ currentpicture := currentpicture ysized h ;
+enddef;
+
+%D A full circle is centered at the origin, while a unitsquare
+%D is located in the first quadrant. Now guess what kind of
+%D path fullsquare and unitcircle do return.
+
+path fullsquare, unitcircle ;
+
+fullsquare := unitsquare shifted - center unitsquare ;
+unitcircle := fullcircle shifted urcorner fullcircle ;
+
+%D Some more paths:
+
+path urcircle, ulcircle, llcircle, lrcircle ;
+
+urcircle := origin--(+.5,0)&(+.5,0){up} ..(0,+.5)&(0,+.5)--cycle ;
+ulcircle := origin--(0,+.5)&(0,+.5){left} ..(-.5,0)&(-.5,0)--cycle ;
+llcircle := origin--(-.5,0)&(-.5,0){down} ..(0,-.5)&(0,-.5)--cycle ;
+lrcircle := origin--(0,-.5)&(0,-.5){right}..(+.5,0)&(+.5,0)--cycle ;
+
+path tcircle, bcircle, lcircle, rcircle ;
+
+tcircle = origin--(+.5,0)&(+.5,0){up} ..(0,+.5)..{down} (-.5,0)--cycle ;
+bcircle = origin--(-.5,0)&(-.5,0){down} ..(0,-.5)..{up} (+.5,0)--cycle ;
+lcircle = origin--(0,+.5)&(0,+.5){left} ..(-.5,0)..{right}(0,-.5)--cycle ;
+rcircle = origin--(0,-.5)&(0,-.5){right}..(+.5,0)..{left} (0,+.5)--cycle ;
+
+path urtriangle, ultriangle, lltriangle, lrtriangle ;
+
+urtriangle := origin--(+.5,0)--(0,+.5)--cycle ;
+ultriangle := origin--(0,+.5)--(-.5,0)--cycle ;
+lltriangle := origin--(-.5,0)--(0,-.5)--cycle ;
+lrtriangle := origin--(0,-.5)--(+.5,0)--cycle ;
+
+path unitdiamond, fulldiamond ;
+
+unitdiamond := (.5,0)--(1,.5)--(.5,1)--(0,.5)--cycle ;
+fulldiamond := unitdiamond shifted - center unitdiamond ;
+
+%D More robust:
+
+% let normalscaled = scaled ;
+% let normalxscaled = xscaled ;
+% let normalyscaled = yscaled ;
+%
+% def scaled expr s = normalscaled (s) enddef ;
+% def xscaled expr s = normalxscaled (s) enddef ;
+% def yscaled expr s = normalyscaled (s) enddef ;
+
+%D Shorter
+
+primarydef p xyscaled q =
+ begingroup ; save qq ; pair qq ; qq = paired(q) ;
+ ( p
+ if xpart qq<>0 : xscaled (xpart qq) fi
+ if ypart qq<>0 : yscaled (ypart qq) fi )
+ endgroup
+enddef ;
+
+%D Experimenteel, zie folder-3.tex.
+
+def set_grid(expr w, h, nx, ny) =
+ boolean grid[][] ; boolean grid_full ;
+ grid_w := w ;
+ grid_h := h ;
+ grid_nx := nx ;
+ grid_ny := ny ;
+ grid_x := round(w/grid_nx) ; % +.5) ;
+ grid_y := round(h/grid_ny) ; % +.5) ;
+ grid_left := (1+grid_x)*(1+grid_y) ;
+ grid_full := false ;
+ for i=0 upto grid_x:
+ for j=0 upto grid_y:
+ grid[i][j] := false ;
+ endfor ;
+ endfor ;
+enddef ;
+
+vardef new_on_grid(expr _dx_, _dy_) =
+ dx := _dx_ ;
+ dy := _dy_ ;
+ ddx := min(round(dx/grid_nx),grid_x) ; % +.5),grid_x) ;
+ ddy := min(round(dy/grid_ny),grid_y) ; % +.5),grid_y) ;
+ if not grid_full and not grid[ddx][ddy]:
+ grid[ddx][ddy] := true ;
+ grid_left := grid_left-1 ;
+ grid_full := (grid_left=0) ;
+ true
+ else:
+ false
+ fi
+enddef ;
+
+%D usage: \type{innerpath peepholed outerpath}.
+%D
+%D beginfig(1);
+%D def fullsquare = (unitsquare shifted -center unitsquare) enddef ;
+%D fill (fullsquare scaled 200) withcolor red ;
+%D path p ; p := (fullcircle scaled 100) ; bboxmargin := 0 ;
+%D fill p peepholed bbox p ;
+%D endfig;
+
+secondarydef p peepholed q =
+ begingroup ;
+ save start ; pair start ; start := point 0 of p ;
+ if xpart start >= xpart center p :
+ if ypart start >= ypart center p :
+ urcorner q -- ulcorner q -- llcorner q -- lrcorner q --
+ reverse p -- lrcorner q -- cycle
+ else :
+ lrcorner q -- urcorner q -- ulcorner q -- llcorner q --
+ reverse p -- llcorner q -- cycle
+ fi
+ else :
+ if ypart start > ypart center p :
+ ulcorner q -- llcorner q -- lrcorner q -- urcorner q --
+ reverse p -- urcorner q -- cycle
+ else :
+ llcorner q -- lrcorner q -- urcorner q -- ulcorner q --
+ reverse p -- ulcorner q -- cycle
+ fi
+ fi
+ endgroup
+enddef ;
+
+boolean intersection_found ;
+
+secondarydef p intersection_point q =
+ begingroup
+ save x_, y_ ;
+ (x_,y_) = p intersectiontimes q ;
+ if x_<0 :
+ intersection_found := false ;
+ center p % origin
+ else :
+ intersection_found := true ;
+ .5[point x_ of p, point y_ of q]
+ fi
+ endgroup
+enddef ;
+
+%D New, undocumented, experimental:
+
+vardef tensecircle (expr width, height, offset) =
+ ((-width/2,-height/2) ... (0,-height/2-offset) ...
+ (+width/2,-height/2) ... (+width/2+offset,0) ...
+ (+width/2,+height/2) ... (0,+height/2+offset) ...
+ (-width/2,+height/2) ... (-width/2-offset,0) ... cycle)
+enddef ;
+
+%vardef tensecircle (expr width, height, offset) =
+% ((-width/2,-height/2)..(0,-height/2-offset)..(+width/2,-height/2) &
+% (+width/2,-height/2)..(+width/2+offset,0)..(+width/2,+height/2) &
+% (+width/2,+height/2)..(0,+height/2+offset)..(-width/2,+height/2) &
+% (-width/2,+height/2)..(-width/2-offset,0)..(-width/2,-height/2)..cycle)
+%enddef ;
+
+vardef roundedsquare (expr width, height, offset) =
+ ((offset,0)--(width-offset,0){right} ..
+ (width,offset)--(width,height-offset){up} ..
+ (width-offset,height)--(offset,height){left} ..
+ (0,height-offset)--(0,offset){down} .. cycle)
+enddef ;
+
+%D Some colors.
+
+color cyan ; cyan = (0,1,1) ;
+color magenta ; magenta = (1,0,1) ;
+color yellow ; yellow = (1,1,0) ;
+
+%D Well, this is the dangerous and naive version:
+
+def drawfill text t =
+ fill t ;
+ draw t ;
+enddef;
+
+%D This two step approach saves the path first, since it can
+%D be a function. Attributes must not be randomized.
+
+def drawfill expr c =
+ path _c_ ; _c_ := c ;
+ do_drawfill
+enddef ;
+
+def do_drawfill text t =
+ draw _c_ t ;
+ fill _c_ t ;
+enddef;
+
+def undrawfill expr c =
+ drawfill c withcolor background
+enddef ;
+
+%D Moved from mp-char.mp
+
+vardef paired (expr d) =
+ if pair d : d else : (d,d) fi
+enddef ;
+
+vardef tripled (expr d) =
+ if color d : d else : (d,d,d) fi
+enddef ;
+
+primarydef p enlarged d =
+ (p llmoved d -- p lrmoved d -- p urmoved d -- p ulmoved d -- cycle)
+enddef;
+
+primarydef p llenlarged d =
+ (p llmoved d -- lrcorner p -- urcorner p -- ulcorner p -- cycle)
+enddef ;
+
+primarydef p lrenlarged d =
+ (llcorner p -- p lrmoved d -- urcorner p -- ulcorner p -- cycle)
+enddef ;
+
+primarydef p urenlarged d =
+ (llcorner p -- lrcorner p -- p urmoved d -- ulcorner p -- cycle)
+enddef ;
+
+primarydef p ulenlarged d =
+ (llcorner p -- lrcorner p -- urcorner p -- p ulmoved d -- cycle)
+enddef ;
+
+primarydef p llmoved d =
+ ((llcorner p) shifted (-xpart paired(d),-ypart paired(d)))
+enddef ;
+
+primarydef p lrmoved d =
+ ((lrcorner p) shifted (+xpart paired(d),-ypart paired(d)))
+enddef ;
+
+primarydef p urmoved d =
+ ((urcorner p) shifted (+xpart paired(d),+ypart paired(d)))
+enddef ;
+
+primarydef p ulmoved d =
+ ((ulcorner p) shifted (-xpart paired(d),+ypart paired(d)))
+enddef ;
+
+primarydef p leftenlarged d =
+ ((llcorner p) shifted (-d,0) -- lrcorner p --
+ urcorner p -- (ulcorner p) shifted (-d,0) -- cycle)
+enddef ;
+
+primarydef p rightenlarged d =
+ (llcorner p -- (lrcorner p) shifted (d,0) --
+ (urcorner p) shifted (d,0) -- ulcorner p -- cycle)
+enddef ;
+
+primarydef p topenlarged d =
+ (llcorner p -- lrcorner p --
+ (urcorner p) shifted (0,d) -- (ulcorner p) shifted (0,d) -- cycle)
+enddef ;
+
+primarydef p bottomenlarged d =
+ (llcorner p shifted (0,-d) -- lrcorner p shifted (0,-d) --
+ urcorner p -- ulcorner p -- cycle)
+enddef ;
+
+%D Handy for testing/debugging:
+
+primarydef p crossed d =
+ (center p shifted (-d, 0) -- llcorner p --
+ center p shifted ( 0,-d) -- lrcorner p --
+ center p shifted (+d, 0) -- urcorner p --
+ center p shifted ( 0,+d) -- ulcorner p -- cycle)
+enddef ;
+
+%D Saves typing:
+
+% vardef bottomboundary primary p = (llcorner p -- lrcorner p) enddef ;
+% vardef rightboundary primary p = (lrcorner p -- urcorner p) enddef ;
+% vardef topboundary primary p = (urcorner p -- ulcorner p) enddef ;
+% vardef leftboundary primary p = (ulcorner p -- llcorner p) enddef ;
+
+vardef bottomboundary primary p =
+ if pair p : p else : (llcorner p -- lrcorner p) fi
+enddef ;
+
+vardef rightboundary primary p =
+ if pair p : p else : (lrcorner p -- urcorner p) fi
+enddef ;
+
+vardef topboundary primary p =
+ if pair p : p else : (urcorner p -- ulcorner p) fi
+enddef ;
+
+vardef leftboundary primary p =
+ if pair p : p else : (ulcorner p -- llcorner p) fi
+enddef ;
+
+%D Nice too:
+
+primarydef p superellipsed s =
+ superellipse
+ (.5[lrcorner p,urcorner p],
+ .5[urcorner p,ulcorner p],
+ .5[ulcorner p,llcorner p],
+ .5[llcorner p,lrcorner p],
+ s)
+enddef ;
+
+primarydef p squeezed s =
+ ((llcorner p .. .5[llcorner p,lrcorner p] shifted ( 0, ypart paired(s)) .. lrcorner p) &
+ (lrcorner p .. .5[lrcorner p,urcorner p] shifted (-xpart paired(s), 0) .. urcorner p) &
+ (urcorner p .. .5[urcorner p,ulcorner p] shifted ( 0,-ypart paired(s)) .. ulcorner p) &
+ (ulcorner p .. .5[ulcorner p,llcorner p] shifted ( xpart paired(s), 0) .. llcorner p) & cycle)
+enddef ;
+
+primarydef p randomshifted s =
+ begingroup ; save ss ; pair ss ; ss := paired(s) ;
+ p shifted (-.5xpart ss + uniformdeviate xpart ss,
+ -.5ypart ss + uniformdeviate ypart ss)
+ endgroup
+enddef ;
+
+%primarydef p randomized s =
+% for i=0 upto length(p)-1 :
+% ((point i of p) randomshifted s) .. controls
+% ((postcontrol i of p) randomshifted s) and
+% ((precontrol (i+1) of p) randomshifted s) ..
+% endfor cycle
+%enddef ;
+
+primarydef p randomized s =
+ (if path p :
+ for i=0 upto length(p)-1 :
+ ((point i of p) randomshifted s) .. controls
+ ((postcontrol i of p) randomshifted s) and
+ ((precontrol (i+1) of p) randomshifted s) ..
+ endfor
+ if cycle p :
+ cycle
+ else :
+ ((point length(p) of p) randomshifted s)
+ fi
+ elseif pair p :
+ p randomshifted s
+ elseif color p :
+ if color s :
+ (uniformdeviate redpart s * redpart p,
+ uniformdeviate greenpart s * greenpart p,
+ uniformdeviate bluepart s * bluepart p)
+ elseif pair s :
+ ((xpart s + uniformdeviate (ypart s - xpart s)) * p)
+ else :
+ (uniformdeviate s * p)
+ fi
+ else :
+ p + uniformdeviate s
+ fi)
+enddef ;
+
+%D Not perfect (alternative for interpath)
+
+vardef interpolated(expr s, p, q) =
+ save m ; m := max(length(p),length(q)) ;
+ (if path p :
+ for i=0 upto m-1 :
+ s[point (i /m) along p,
+ point (i /m) along q] .. controls
+ s[postcontrol (i /m) along p,
+ postcontrol (i /m) along q] and
+ s[precontrol ((i+1)/m) along p,
+ precontrol ((i+1)/m) along q] ..
+ endfor
+ if cycle p :
+ cycle
+ else :
+ s[point infinity of p,
+ point infinity of q]
+ fi
+ else :
+ a[p,q]
+ fi)
+enddef ;
+
+%D Interesting too:
+
+% primarydef p parallel s =
+% begingroup ; save q, b ; path q ; numeric b ;
+% b := xpart (lrcorner p - llcorner p) ;
+% q := p if b>0 : scaled ((b+2s)/b) fi ;
+% (q shifted (center p-center q))
+% endgroup
+% enddef ;
+
+%primarydef p parallel s =
+% begingroup ; save q, w,h ; path q ; numeric w, h ;
+% w := bbwidth(p) ; h := bbheight(p) ;
+% q := p if (w>0) and (h>0) :
+% xyscaled ((w+2*xpart paired(s))/w,(h+2*ypart paired(s))/h) fi ;
+% (q shifted (center p-center q))
+% endgroup
+%enddef ;
+
+vardef punked primary p =
+ (point 0 of p for i=1 upto length(p)-1 : -- point i of p endfor
+ if cycle p : -- cycle else : -- point length(p) of p fi)
+enddef ;
+
+vardef curved primary p =
+ (point 0 of p for i=1 upto length(p)-1 : .. point i of p endfor
+ if cycle p : .. cycle else : .. point length(p) of p fi)
+enddef ;
+
+primarydef p blownup s =
+ begingroup
+ save _p_ ; path _p_ ; _p_ := p xysized
+ (bbwidth (p)+2(xpart paired(s)),
+ bbheight(p)+2(ypart paired(s))) ;
+ (_p_ shifted (center p - center _p_))
+ endgroup
+enddef ;
+
+%D Rather fundamental.
+
+% vardef rightpath expr p =
+% save q, t, b ; path q ; pair t, b ;
+% t := (ulcorner p -- urcorner p) intersection_point p ;
+% b := (llcorner p -- lrcorner p) intersection_point p ;
+% if xpart directionpoint t of p < 0 : p := reverse p ; fi ;
+% q := p cutbefore b ;
+% q := q if xpart point 0 of p > 0 : & p fi cutafter t ;
+% q
+% enddef ;
+%
+% vardef leftpath expr p =
+% save q, t, b ; path q ; pair t, b ;
+% t := (ulcorner p -- urcorner p) intersection_point p ;
+% b := (llcorner p -- lrcorner p) intersection_point p ;
+% if xpart directionpoint t of p < 0 : p := reverse p ; fi ;
+% q := p cutbefore t ;
+% q := q if xpart point 0 of p > 0 : & p fi cutafter b ;
+% q
+% enddef ;
+
+def leftrightpath(expr p, l) =
+ save q, t, b ; path q ; pair t, b ;
+ t := (ulcorner p -- urcorner p) intersection_point p ;
+ b := (llcorner p -- lrcorner p) intersection_point p ;
+ if xpart directionpoint t of p < 0 : p := reverse p ; fi ;
+ q := p cutbefore if l: t else: b fi ;
+ q := q if xpart point 0 of p > 0 : &
+ p fi cutafter if l: b else: t fi ;
+ q
+enddef ;
+
+vardef leftpath expr p = leftrightpath(p,true ) enddef ;
+vardef rightpath expr p = leftrightpath(p,false) enddef ;
+
+%D Drawoptions
+
+def saveoptions =
+ save _op_ ; def _op_ = enddef ;
+enddef ;
+
+%D Tracing.
+
+let normaldraw = draw ;
+let normalfill = fill ;
+
+def drawlineoptions (text t) = def _lin_opt_ = t enddef ; enddef ;
+def drawpointoptions (text t) = def _pnt_opt_ = t enddef ; enddef ;
+def drawcontroloptions(text t) = def _ctr_opt_ = t enddef ; enddef ;
+def drawlabeloptions (text t) = def _lab_opt_ = t enddef ; enddef ;
+def draworiginoptions (text t) = def _ori_opt_ = t enddef ; enddef ;
+def drawboundoptions (text t) = def _bnd_opt_ = t enddef ; enddef ;
+def drawpathoptions (text t) = def _pth_opt_ = t enddef ; enddef ;
+
+def resetdrawoptions =
+ drawlineoptions (withpen pencircle scaled 1pt withcolor .5white) ;
+ drawpointoptions (withpen pencircle scaled 4pt withcolor black) ;
+ drawcontroloptions(withpen pencircle scaled 2.5pt withcolor black) ;
+ drawlabeloptions () ;
+ draworiginoptions (withpen pencircle scaled 1pt withcolor .5white) ;
+ drawboundoptions (dashed evenly _ori_opt_) ;
+ drawpathoptions (withpen pencircle scaled 5pt withcolor .8white) ;
+enddef ;
+
+resetdrawoptions ;
+
+%D Path.
+
+def drawpath expr p =
+ normaldraw p _pth_opt_
+enddef ;
+
+%D Arrow.
+
+vardef drawarrowpath expr p =
+ save autoarrows ; boolean autoarrows ; autoarrows := true ;
+ drawarrow p _pth_opt_
+enddef ;
+
+%def drawarrowpath expr p =
+% begingroup ;
+% save autoarrows ; boolean autoarrows ; autoarrows := true ;
+% save arrowpath ; path arrowpath ; arrowpath := p ;
+% _drawarrowpath_
+%enddef ;
+%
+%def _drawarrowpath_ text t =
+% drawarrow arrowpath _pth_opt_ t ;
+% endgroup ;
+%enddef ;
+
+def midarrowhead expr p =
+ arrowhead p cutafter
+ (point length(p cutafter point .5 along p)+ahlength on p)
+enddef ;
+
+vardef arrowheadonpath (expr p, s) =
+ save autoarrows ; boolean autoarrows ; autoarrows := true ;
+ arrowhead p if s<1 : cutafter (point (s*arclength(p)+.5ahlength) on p) fi
+enddef ;
+
+%D Points.
+
+def drawpoint expr c =
+ if string c :
+ string _c_ ; _c_ := "(" & c & ")" ;
+ dotlabel.urt(_c_, scantokens _c_) ;
+ drawdot scantokens _c_
+ else :
+ dotlabel.urt("(" & decimal xpart c & "," & decimal ypart c & ")", c) ;
+ drawdot c
+ fi _pnt_opt_
+enddef ;
+
+%D PathPoints.
+
+def drawpoints expr c = path _c_ ; _c_ := c ; do_drawpoints enddef ;
+def drawcontrolpoints expr c = path _c_ ; _c_ := c ; do_drawcontrolpoints enddef ;
+def drawcontrollines expr c = path _c_ ; _c_ := c ; do_drawcontrollines enddef ;
+def drawpointlabels expr c = path _c_ ; _c_ := c ; do_drawpointlabels enddef ;
+
+def do_drawpoints text t =
+ for _i_=0 upto length(_c_) :
+ normaldraw point _i_ of _c_ _pnt_opt_ t ;
+ endfor ;
+enddef;
+
+def do_drawcontrolpoints text t =
+ for _i_=0 upto length(_c_) :
+ normaldraw precontrol _i_ of _c_ _ctr_opt_ t ;
+ normaldraw postcontrol _i_ of _c_ _ctr_opt_ t ;
+ endfor ;
+enddef;
+
+def do_drawcontrollines text t =
+ for _i_=0 upto length(_c_) :
+ normaldraw point _i_ of _c_ -- precontrol _i_ of _c_ _lin_opt_ t ;
+ normaldraw point _i_ of _c_ -- postcontrol _i_ of _c_ _lin_opt_ t ;
+ endfor ;
+enddef;
+
+boolean swappointlabels ; swappointlabels := false ;
+
+def do_drawpointlabels text t =
+ for _i_=0 upto length(_c_) :
+ pair _u_ ; _u_ := unitvector(direction _i_ of _c_)
+ rotated if swappointlabels : - fi 90 ;
+ pair _p_ ; _p_ := (point _i_ of _c_) ;
+ _u_ := 12 * defaultscale * _u_ ;
+ normaldraw thelabel ( decimal _i_,
+ _p_ shifted if cycle _c_ and (_i_=0) : - fi _u_ ) _lab_opt_ t ;
+ endfor ;
+enddef;
+
+%D Bounding box.
+
+def drawboundingbox expr p =
+ normaldraw boundingbox p _bnd_opt_
+enddef ;
+
+%D Origin.
+
+numeric originlength ; originlength := .5cm ;
+
+def draworigin text t =
+ normaldraw (origin shifted (0, originlength) --
+ origin shifted (0,-originlength)) _ori_opt_ t ;
+ normaldraw (origin shifted ( originlength,0) --
+ origin shifted (-originlength,0)) _ori_opt_ t ;
+enddef;
+
+%D Axis.
+
+numeric tickstep ; tickstep := 5mm ;
+numeric ticklength ; ticklength := 2mm ;
+
+def drawxticks expr c = path _c_ ; _c_ := c ; do_drawxticks enddef ;
+def drawyticks expr c = path _c_ ; _c_ := c ; do_drawyticks enddef ;
+def drawticks expr c = path _c_ ; _c_ := c ; do_drawticks enddef ;
+
+% Adding eps prevents disappearance due to rounding errors.
+
+def do_drawxticks text t =
+ for i=0 step -tickstep until xpart llcorner _c_ - eps :
+ if (i<=xpart lrcorner _c_) :
+ normaldraw (i,-ticklength)--(i,ticklength) _ori_opt_ t ;
+ fi ;
+ endfor ;
+ for i=0 step tickstep until xpart lrcorner _c_ + eps :
+ if (i>=xpart llcorner _c_) :
+ normaldraw (i,-ticklength)--(i,ticklength) _ori_opt_ t ;
+ fi ;
+ endfor ;
+ normaldraw (llcorner _c_ -- ulcorner _c_)
+ shifted (-xpart llcorner _c_,0) _ori_opt_ t ;
+enddef ;
+
+def do_drawyticks text t =
+ for i=0 step -tickstep until ypart llcorner _c_ - eps :
+ if (i<=ypart ulcorner _c_) :
+ normaldraw (-ticklength,i)--(ticklength,i) _ori_opt_ t ;
+ fi ;
+ endfor ;
+ for i=0 step tickstep until ypart ulcorner _c_ + eps :
+ if (i>=ypart llcorner _c_) :
+ normaldraw (-ticklength,i)--(ticklength,i) _ori_opt_ t ;
+ fi ;
+ endfor ;
+ normaldraw (llcorner _c_ -- lrcorner _c_)
+ shifted (0,-ypart llcorner _c_) _ori_opt_ t ;
+enddef ;
+
+def do_drawticks text t =
+ drawxticks _c_ t ;
+ drawyticks _c_ t ;
+enddef ;
+
+%D All of it except axis.
+
+def drawwholepath expr p =
+ draworigin ;
+ drawpath p ;
+ drawcontrollines p ;
+ drawcontrolpoints p ;
+ drawpoints p ;
+ drawboundingbox p ;
+ drawpointlabels p ;
+enddef ;
+
+%D Tracing.
+
+def visualizeddraw expr c =
+ if picture c : normaldraw c else : path _c_ ; _c_ := c ; do_visualizeddraw fi
+enddef ;
+
+def visualizedfill expr c =
+ if picture c : normalfill c else : path _c_ ; _c_ := c ; do_visualizedfill fi
+enddef ;
+
+def do_visualizeddraw text t =
+ draworigin ;
+ drawpath _c_ t ;
+ drawcontrollines _c_ ;
+ drawcontrolpoints _c_ ;
+ drawpoints _c_ ;
+ drawboundingbox _c_ ;
+ drawpointlabels _c_ ;
+enddef ;
+
+def do_visualizedfill text t =
+ if cycle _c_ : normalfill _c_ t fi ;
+ draworigin ;
+ drawcontrollines _c_ ;
+ drawcontrolpoints _c_ ;
+ drawpoints _c_ ;
+ drawboundingbox _c_ ;
+ drawpointlabels _c_ ;
+enddef ;
+
+def visualizepaths =
+ let fill = visualizedfill ;
+ let draw = visualizeddraw ;
+enddef ;
+
+def naturalizepaths =
+ let fill = normalfill ;
+ let draw = normaldraw ;
+enddef ;
+
+extra_endfig := extra_endfig & " naturalizepaths ; " ;
+
+%D Normally, arrowheads don't scale well. So we provide a
+%D hack.
+
+boolean autoarrows ; autoarrows := false ;
+numeric ahfactor ; ahfactor := 2.5 ;
+
+def set_ahlength (text t) =
+ ahlength := (ahfactor*pen_size(_op_ t)) ; % _op_ added
+enddef ;
+
+vardef pen_size (text t) =
+ save p ; picture p ; p := nullpicture ;
+ addto p doublepath (top origin -- bot origin) t ;
+ (ypart urcorner p - ypart lrcorner p)
+enddef ;
+
+%D The next two macros are adapted versions of plain
+%D \METAPOST\ definitions.
+
+def _finarr text t =
+ if autoarrows : set_ahlength (t) fi ;
+ draw _apth t ;
+ filldraw arrowhead _apth t ;
+enddef;
+
+def _findarr text t =
+ if autoarrows : set_ahlength (t) fi ;
+ draw _apth t ;
+ fill arrowhead _apth withpen currentpen t ;
+ fill arrowhead reverse _apth withpen currentpen t ;
+enddef ;
+
+%D Handy too ......
+
+vardef pointarrow (expr pat, loc, len, off) =
+ save l, r, s, t ; path l, r ; numeric s ; pair t ;
+ t := if pair loc : loc else : point loc along pat fi ;
+% draw t withpen pencircle scaled 10 withcolor .5white ;
+ s := len/2 - off ; if s<=0 : s := 0 elseif s>len : s := len fi ;
+ r := pat cutbefore t ;
+ r := (r cutafter point (arctime s of r) of r) ;
+ s := len/2 + off ; if s<=0 : s := 0 elseif s>len : s := len fi ;
+ l := reverse (pat cutafter t) ;
+ l := (reverse (l cutafter point (arctime s of l) of l)) ;
+ (l..r)
+enddef ;
+
+def rightarrow (expr pat,tim,len) = pointarrow(pat,tim,len,-len) enddef ;
+def leftarrow (expr pat,tim,len) = pointarrow(pat,tim,len,+len) enddef ;
+def centerarrow (expr pat,tim,len) = pointarrow(pat,tim,len, 0) enddef ;
+
+%D The \type {along} and \type {on} operators can be used
+%D as follows:
+%D
+%D \starttypen
+%D drawdot point .5 along somepath ;
+%D drawdot point 3cm on somepath ;
+%D \stoptypen
+%D
+%D The number denotes a percentage (fraction).
+
+primarydef pct along pat = % also negative
+ (arctime (pct * (arclength pat)) of pat) of pat
+enddef ;
+
+% primarydef len on pat =
+% (arctime len of pat) of pat
+% enddef ;
+
+primarydef len on pat =
+ (arctime if len>0 : len else : (arclength(pat)+len) fi of pat) of pat
+enddef ;
+
+% this cuts of a piece from both ends
+
+% tertiarydef pat cutends len =
+% begingroup ; save tap ; path tap ;
+% tap := pat cutbefore (point len on pat) ;
+% (tap cutafter (point -len on tap))
+% endgroup
+% enddef ;
+
+tertiarydef pat cutends len =
+ begingroup ; save tap ; path tap ;
+ tap := pat cutbefore (point (xpart paired(len)) on pat) ;
+ (tap cutafter (point -(ypart paired(len)) on tap))
+ endgroup
+enddef ;
+
+%D To be documented.
+
+path freesquare ;
+
+freesquare := ((-1,0)--(-1,-1)--(0,-1)--(+1,-1)--
+ (+1,0)--(+1,+1)--(0,+1)--(-1,+1)--cycle) scaled .5 ;
+
+numeric freelabeloffset ; freelabeloffset := 3pt ;
+numeric freedotlabelsize ; freedotlabelsize := 3pt ;
+
+vardef thefreelabel (expr str, loc, ori) =
+ save s, p, q, l ; picture s ; path p, q ; pair l ;
+ interim labeloffset := freelabeloffset ;
+ s := if string str : thelabel(str,loc) else : str shifted -center str shifted loc fi ;
+ setbounds s to boundingbox s enlarged freelabeloffset ;
+ p := fullcircle scaled (2*length(loc-ori)) shifted ori ;
+ q := freesquare xyscaled (urcorner s - llcorner s) ;
+% l := point (xpart (p intersectiontimes (ori--loc))) of q ;
+ l := point xpart (p intersectiontimes
+ (ori--((1+eps)*arclength(ori--loc)*unitvector(loc-ori)))) of q ;
+ setbounds s to boundingbox s enlarged -freelabeloffset ; % new
+ %draw boundingbox s shifted -l withpen pencircle scaled .5pt withcolor red ;
+ (s shifted -l)
+enddef ;
+
+% better?
+
+vardef thefreelabel (expr str, loc, ori) =
+ save s, p, q, l ; picture s ; path p, q ; pair l ;
+ interim labeloffset := freelabeloffset ;
+ s := if string str : thelabel(str,loc) else : str shifted -center str shifted loc fi ;
+ setbounds s to boundingbox s enlarged freelabeloffset ;
+ p := fullcircle scaled (2*length(loc-ori)) shifted ori ;
+ q := freesquare xyscaled (urcorner s - llcorner s) ;
+ l := point xpart (p intersectiontimes (ori--loc shifted (loc-ori))) of q ;
+ setbounds s to boundingbox s enlarged -freelabeloffset ; % new
+ %draw boundingbox s shifted -l withpen pencircle scaled .5pt withcolor red ;
+ (s shifted -l)
+enddef ;
+
+vardef freelabel (expr str, loc, ori) =
+ draw thefreelabel(str,loc,ori) ;
+enddef ;
+
+vardef freedotlabel (expr str, loc, ori) =
+ interim linecap:=rounded ;
+ draw loc withpen pencircle scaled freedotlabelsize ;
+ draw thefreelabel(str,loc,ori) ;
+enddef ;
+
+%D \starttypen
+%D drawarrow anglebetween(line_a,line_b,somelabel) ;
+%D \stoptypen
+
+% angleoffset ; angleoffset := 0pt ;
+numeric anglelength ; anglelength := 20pt ;
+numeric anglemethod ; anglemethod := 1 ;
+
+% vardef anglebetween (expr a, b, str) = % path path string
+% save pointa, pointb, common, middle, offset ;
+% pair pointa, pointb, common, middle, offset ;
+% save curve ; path curve ;
+% save where ; numeric where ;
+% if round point 0 of a = round point 0 of b :
+% common := point 0 of a ;
+% else :
+% common := a intersectionpoint b ;
+% fi ;
+% pointa := point anglelength on a ;
+% pointb := point anglelength on b ;
+% where := turningnumber (common--pointa--pointb--cycle) ;
+% middle := ((common--pointa) rotatedaround (pointa,-where*90))
+% intersectionpoint
+% ((common--pointb) rotatedaround (pointb, where*90)) ;
+% if anglemethod = 0 :
+% curve := pointa{unitvector(middle-pointa)}.. pointb;
+% middle := point .5 along curve ;
+% curve := common ;
+% elseif anglemethod = 1 :
+% curve := pointa{unitvector(middle-pointa)}.. pointb;
+% middle := point .5 along curve ;
+% elseif anglemethod = 2 :
+% middle := common rotatedaround(.5[pointa,pointb],180) ;
+% curve := pointa--middle--pointb ;
+% elseif anglemethod = 3 :
+% curve := pointa--middle--pointb ;
+% elseif anglemethod = 4 :
+% curve := pointa..controls middle..pointb ;
+% middle := point .5 along curve ;
+% fi ;
+% draw thefreelabel(str, middle, common) withcolor black ;
+% curve
+% enddef ;
+
+vardef anglebetween (expr a, b, str) = % path path string
+ save pointa, pointb, common, middle, offset ;
+ pair pointa, pointb, common, middle, offset ;
+ save curve ; path curve ;
+ save where ; numeric where ;
+ if round point 0 of a = round point 0 of b :
+ common := point 0 of a ;
+ else :
+ common := a intersectionpoint b ;
+ fi ;
+ pointa := point anglelength on a ;
+ pointb := point anglelength on b ;
+ where := turningnumber (common--pointa--pointb--cycle) ;
+ middle := (reverse(common--pointa) rotatedaround (pointa,-where*90))
+ intersection_point
+ (reverse(common--pointb) rotatedaround (pointb, where*90)) ;
+ if not intersection_found :
+ middle := point .5 along
+ ((reverse(common--pointa) rotatedaround (pointa,-where*90)) --
+ ( (common--pointb) rotatedaround (pointb, where*90))) ;
+ fi ;
+ if anglemethod = 0 :
+ curve := pointa{unitvector(middle-pointa)}.. pointb;
+ middle := point .5 along curve ;
+ curve := common ;
+ elseif anglemethod = 1 :
+ curve := pointa{unitvector(middle-pointa)}.. pointb;
+ middle := point .5 along curve ;
+ elseif anglemethod = 2 :
+ middle := common rotatedaround(.5[pointa,pointb],180) ;
+ curve := pointa--middle--pointb ;
+ elseif anglemethod = 3 :
+ curve := pointa--middle--pointb ;
+ elseif anglemethod = 4 :
+ curve := pointa..controls middle..pointb ;
+ middle := point .5 along curve ;
+ fi ;
+ draw thefreelabel(str, middle, common) ; % withcolor black ;
+ curve
+enddef ;
+
+% Stack
+
+picture currentpicturestack[] ;
+numeric currentpicturedepth ; currentpicturedepth := 0 ;
+
+def pushcurrentpicture =
+ currentpicturedepth := currentpicturedepth + 1 ;
+ currentpicturestack[currentpicturedepth] := currentpicture ;
+ currentpicture := nullpicture ;
+enddef ;
+
+def popcurrentpicture text t = % optional text
+ if currentpicturedepth > 0 :
+ addto currentpicturestack[currentpicturedepth] also currentpicture t ;
+ currentpicture := currentpicturestack[currentpicturedepth] ;
+ currentpicturedepth := currentpicturedepth - 1 ;
+ fi ;
+enddef ;
+
+%D colorcircle(size, red, green, blue) ;
+
+% vardef colorcircle (expr size, red, green, blue) =
+% save r, g, b, rr, gg, bb, cc, mm, yy ; save radius ;
+% path r, g, b, rr, bb, gg, cc, mm, yy ; numeric radius ;
+%
+% radius := 5cm ; pickup pencircle scaled (radius/25) ;
+%
+% r := g := b := fullcircle scaled radius shifted (0,radius/4) ;
+%
+% r := r rotatedaround (origin, 15) ;
+% g := g rotatedaround (origin,135) ;
+% b := b rotatedaround (origin,255) ;
+%
+% r := r rotatedaround(center r,-90) ;
+% g := g rotatedaround(center g, 90) ;
+%
+% gg := buildcycle(buildcycle(reverse r,b),g) ;
+% cc := buildcycle(buildcycle(b,reverse g),r) ;
+%
+% rr := gg rotatedaround(origin,120) ;
+% bb := gg rotatedaround(origin,240) ;
+%
+% yy := cc rotatedaround(origin,120) ;
+% mm := cc rotatedaround(origin,240) ;
+%
+% pushcurrentpicture ;
+%
+% fill fullcircle scaled radius withcolor white ;
+%
+% fill rr withcolor red ; fill cc withcolor white-red ;
+% fill gg withcolor green ; fill mm withcolor white-green ;
+% fill bb withcolor blue ; fill yy withcolor white-blue ;
+%
+% for i = rr,gg,bb,cc,mm,yy : draw i withcolor .5white ; endfor ;
+%
+% currentpicture := currentpicture xsized size ;
+%
+% popcurrentpicture ;
+% enddef ;
+
+% vardef colorcircle (expr size, red, green, blue) =
+% save r, g, b, rr, gg, bb, cc, mm, yy ; save radius ;
+% path r, g, b, rr, bb, gg, cc, mm, yy ; numeric radius ;
+%
+% radius := 5cm ; pickup pencircle scaled (radius/25) ;
+%
+% transform t ; t := identity rotatedaround(origin,120) ;
+%
+% r := fullcircle scaled radius
+% shifted (0,radius/4) rotatedaround(origin,15) ;
+%
+% g := r transformed t ; b := g transformed t ;
+%
+% r := r rotatedaround(center r,-90) ;
+% g := g rotatedaround(center g, 90) ;
+%
+% gg := buildcycle(buildcycle(reverse r,b),g) ;
+% cc := buildcycle(buildcycle(b,reverse g),r) ;
+%
+% rr := gg transformed t ; bb := rr transformed t ;
+% yy := cc transformed t ; mm := yy transformed t ;
+%
+% pushcurrentpicture ;
+%
+% fill fullcircle scaled radius withcolor white ;
+%
+% fill rr withcolor red ; fill cc withcolor white-red ;
+% fill gg withcolor green ; fill mm withcolor white-green ;
+% fill bb withcolor blue ; fill yy withcolor white-blue ;
+%
+% for i = rr,gg,bb,cc,mm,yy : draw i withcolor .5white ; endfor ;
+%
+% currentpicture := currentpicture xsized size ;
+%
+% popcurrentpicture ;
+% enddef ;
+
+vardef colorcircle (expr size, red, green, blue) =
+ save r, g, b, c, m, y, w ; save radius ;
+ path r, g, b, c, m, y, w ; numeric radius ;
+
+ radius := 5cm ; pickup pencircle scaled (radius/25) ;
+
+ transform t ; t := identity rotatedaround(origin,120) ;
+
+ r := fullcircle rotated 90 scaled radius
+ shifted (0,radius/4) rotatedaround(origin,135) ;
+
+ b := r transformed t ; g := b transformed t ;
+
+ c := buildcycle(subpath(1,7) of g,subpath(1,7) of b) ;
+ y := c transformed t ; m := y transformed t ;
+
+ w := buildcycle(subpath(3,5) of r, subpath(3,5) of g,subpath(3,5) of b) ;
+
+ pushcurrentpicture ;
+
+ fill r withcolor red ;
+ fill g withcolor green ;
+ fill b withcolor blue ;
+ fill c withcolor white-red ;
+ fill m withcolor white-green ;
+ fill y withcolor white-blue ;
+ fill w withcolor white ;
+
+ for i = r,g,b,c,m,y : draw i withcolor .5white ; endfor ;
+
+ currentpicture := currentpicture xsized size ;
+
+ popcurrentpicture ;
+enddef ;
+
+% penpoint (i,2) of somepath -> inner / outer point
+
+vardef penpoint expr pnt of p =
+ save n, d ; numeric n, d ;
+ (n,d) = if pair pnt : pnt else : (pnt,1) fi ;
+ (point n of p shifted ((penoffset direction n of p of currentpen) scaled d))
+enddef ;
+
+% nice: currentpicture := inverted currentpicture ;
+
+primarydef p uncolored c =
+ if color p :
+ c - p
+ else :
+ image
+ (for i within p :
+ addto currentpicture
+ if stroked i or filled i :
+ if filled i : contour else : doublepath fi pathpart i
+ dashed dashpart i withpen penpart i
+ else :
+ also i
+ fi
+ withcolor c-(redpart i, greenpart i, bluepart i) ;
+ endfor ; )
+ fi
+enddef ;
+
+vardef inverted primary p =
+ (p uncolored white)
+enddef ;
+
+% primarydef p softened c =
+% if color p :
+% tripled(c) * p
+% else :
+% image
+% (save cc ; color cc ; cc := tripled(c) ;
+% for i within p :
+% addto currentpicture
+% if stroked i or filled i :
+% if filled i : contour else : doublepath fi pathpart i
+% dashed dashpart i withpen penpart i
+% else :
+% also i
+% fi
+% withcolor (redpart cc * redpart i,
+% greenpart cc * greenpart i,
+% bluepart cc * bluepart i) ;
+% endfor ;)
+% fi
+% enddef ;
+
+primarydef p softened c =
+ begingroup
+ save cc ; color cc ; cc := tripled(c) ;
+ if color p :
+ (redpart cc * redpart p,
+ greenpart cc * greenpart p,
+ bluepart cc * bluepart p)
+ else :
+ image
+ (for i within p :
+ addto currentpicture
+ if stroked i or filled i :
+ if filled i : contour else : doublepath fi pathpart i
+ dashed dashpart i withpen penpart i
+ else :
+ also i
+ fi
+ withcolor (redpart cc * redpart i,
+ greenpart cc * greenpart i,
+ bluepart cc * bluepart i) ;
+ endfor ;)
+ fi
+ endgroup
+enddef ;
+
+vardef grayed primary p =
+ if color p :
+ tripled(.30redpart p+.59greenpart p+.11bluepart p)
+ else :
+ image
+ (for i within p :
+ addto currentpicture
+ if stroked i or filled i :
+ if filled i : contour else : doublepath fi pathpart i
+ dashed dashpart i withpen penpart i
+ else :
+ also i
+ fi
+ withcolor tripled(.30redpart i+.59greenpart i+.11bluepart i) ;
+ endfor ; )
+ fi
+enddef ;
+
+% yes or no: "text" infont "cmr12" at 24pt ;
+
+% let normalinfont = infont ;
+%
+% numeric lastfontsize ; lastfontsize = fontsize defaultfont ;
+%
+% def infont primary name = % no vardef, no expr
+% hide(lastfontsize := fontsize name) % no ;
+% normalinfont name
+% enddef ;
+%
+% def scaledat expr size =
+% scaled (size/lastfontsize)
+% enddef ;
+%
+% let at = scaledat ;
+
+% like decimal
+
+def condition primary b = if b : "true" else : "false" fi enddef ;
+
+% undocumented
+
+primarydef p stretched s =
+ begingroup
+% save pp ; path pp ; pp := p scaled s ;
+ save pp ; path pp ; pp := p xyscaled s ;
+ (pp shifted ((point 0 of p) - (point 0 of pp)))
+ endgroup
+enddef ;
+
+% yes or no, untested -)
+
+def xshifted expr dx = shifted(dx,0) enddef ;
+def yshifted expr dy = shifted(0,dy) enddef ;
+
+% also handy
+
+% right: str = readfrom ("abc" & ".def" ) ;
+% wrong: str = readfrom "abc" & ".def" ;
+
+% Every 62th read fails so we need to try again!
+
+% def readfile (expr name) =
+% if (readfrom (name) <> EOF) :
+% scantokens("input " & name & ";") ;
+% elseif (readfrom (name) <> EOF) :
+% scantokens("input " & name & ";") ;
+% fi ;
+% closefrom (name) ;
+% enddef ;
+%
+% this sometimes fails on the elseif, so :
+%
+
+def readfile (expr name) =
+ begingroup ; save ok ; boolean ok ;
+ if (readfrom (name) <> EOF) :
+ ok := false ;
+ elseif (readfrom (name) <> EOF) :
+ ok := false ;
+ else :
+ ok := true ;
+ fi ;
+ if not ok :
+ scantokens("input " & name & " ") ;
+ fi ;
+ closefrom (name) ;
+ endgroup ;
+enddef ;
+
+% permits redefinition of end in macro
+
+inner end ;
+
+% real fun
+
+let normalwithcolor = withcolor ;
+
+def remapcolors =
+ def withcolor primary c = normalwithcolor remappedcolor(c) enddef ;
+enddef ;
+
+def normalcolors =
+ let withcolor = normalwithcolor ;
+enddef ;
+
+def resetcolormap =
+ color color_map[][][] ;
+ normalcolors ;
+enddef ;
+
+resetcolormap ;
+
+% color_map_resolution := 1000 ;
+%
+% def r_color primary c = round(color_map_resolution*redpart c) enddef ;
+% def g_color primary c = round(color_map_resolution*greenpart c) enddef ;
+% def b_color primary c = round(color_map_resolution*bluepart c) enddef ;
+
+def r_color primary c = redpart c enddef ;
+def g_color primary c = greenpart c enddef ;
+def b_color primary c = bluepart c enddef ;
+
+def remapcolor(expr old, new) =
+ color_map[r_color old][g_color old][b_color old] := new ;
+enddef ;
+
+def remappedcolor(expr c) =
+ if known color_map[r_color c][g_color c][b_color c] :
+ color_map[r_color c][g_color c][b_color c]
+ else :
+ c
+ fi
+enddef ;
+
+% def refill suffix c = do_repath (1) (c) enddef ;
+% def redraw suffix c = do_repath (2) (c) enddef ;
+% def recolor suffix c = do_repath (0) (c) enddef ;
+%
+% color refillbackground ; refillbackground := (1,1,1) ;
+%
+% def do_repath (expr mode) (suffix c) text t = % can it be stroked and filled at the same time ?
+% begingroup ;
+% if mode=0 : save withcolor ; remapcolors ; fi ;
+% save _c_, _cc_, _f_, _b_ ; picture _c_, _cc_ ; color _f_ ; path _b_ ;
+% _c_ := c ; _b_ := boundingbox c ; c := nullpicture ;
+% for i within _c_ :
+% _f_ := (redpart i, greenpart i, bluepart i) ;
+% if bounded i :
+% setbounds c to pathpart i ;
+% elseif clipped i :
+% clip c to pathpart i ;
+% elseif stroked i :
+% addto c doublepath pathpart i
+% dashed dashpart i withpen penpart i
+% withcolor _f_ % (redpart i, greenpart i, bluepart i)
+% if mode=2 : t fi ;
+% elseif filled i :
+% addto c contour pathpart i
+% withcolor _f_
+% if (mode=1) and (_f_<>refillbackground) : t fi ;
+% else :
+% addto c also i ;
+% fi ;
+% endfor ;
+% setbounds c to _b_ ;
+% endgroup ;
+% enddef ;
+
+% Thanks to Jens-Uwe Morawski for pointing out that we need
+% to treat bounded and clipped components as local pictures.
+
+def recolor suffix p = p := repathed (0,p) enddef ;
+def refill suffix p = p := repathed (1,p) enddef ;
+def redraw suffix p = p := repathed (2,p) enddef ;
+def retext suffix p = p := repathed (3,p) enddef ;
+def untext suffix p = p := repathed (4,p) enddef ;
+
+% primarydef p recolored t = repathed(0,p) t enddef ;
+% primarydef p refilled t = repathed(1,p) t enddef ;
+% primarydef p redrawn t = repathed(2,p) t enddef ;
+% primarydef p retexted t = repathed(3,p) t enddef ;
+% primarydef p untexted t = repathed(4,p) t enddef ;
+
+color refillbackground ; refillbackground := (1,1,1) ;
+
+% vardef repathed (expr mode, p) text t =
+% begingroup ;
+% if mode=0 : save withcolor ; remapcolors ; fi ;
+% save _p_, _pp_, _f_, _b_, _t_ ;
+% picture _p_, _pp_ ; color _f_ ; path _b_ ; transform _t_ ;
+% _b_ := boundingbox p ; _p_ := nullpicture ;
+% for i within p :
+% _f_ := (redpart i, greenpart i, bluepart i) ;
+% if bounded i :
+% _pp_ := repathed(mode,i) t ;
+% setbounds _pp_ to pathpart i ;
+% addto _p_ also _pp_ ;
+% elseif clipped i :
+% _pp_ := repathed(mode,i) t ;
+% clip _pp_ to pathpart i ;
+% addto _p_ also _pp_ ;
+% elseif stroked i :
+% addto _p_ doublepath pathpart i
+% dashed dashpart i withpen penpart i
+% withcolor _f_ % (redpart i, greenpart i, bluepart i)
+% if mode=2 : t fi ;
+% elseif filled i :
+% addto _p_ contour pathpart i
+% withcolor _f_
+% if (mode=1) and (_f_<>refillbackground) : t fi ;
+% elseif textual i : % textpart i <> "" :
+% if mode <> 4 :
+% % transform _t_ ;
+% % (xpart _t_, xxpart _t_, xypart _t_) = (xpart i, xxpart i, xypart i) ;
+% % (ypart _t_, yypart _t_, yxpart _t_) = (ypart i, yypart i, yxpart i) ;
+% % addto _p_ also
+% % textpart i infont fontpart i % todo : other font
+% % transformed _t_
+% % withpen penpart i
+% % withcolor _f_
+% % if mode=3 : t fi ;
+% addto _p_ also i if mode=3 : t fi ;
+% fi ;
+% else :
+% addto _p_ also i ;
+% fi ;
+% endfor ;
+% setbounds _p_ to _b_ ;
+% _p_
+% endgroup
+% enddef ;
+
+def restroke suffix p = p := repathed (21,p) enddef ; % keep attributes
+def reprocess suffix p = p := repathed (22,p) enddef ; % no attributes
+
+% also 11 and 12
+
+vardef repathed (expr mode, p) text t =
+ begingroup ;
+ if mode=0 : save withcolor ; remapcolors ; fi ;
+ save _p_, _pp_, _ppp_, _f_, _b_, _t_ ;
+ picture _p_, _pp_, _ppp_ ; color _f_ ; path _b_ ; transform _t_ ;
+ _b_ := boundingbox p ; _p_ := nullpicture ;
+ for i within p :
+ _f_ := (redpart i, greenpart i, bluepart i) ;
+ if bounded i :
+ _pp_ := repathed(mode,i) t ;
+ setbounds _pp_ to pathpart i ;
+ addto _p_ also _pp_ ;
+ elseif clipped i :
+ _pp_ := repathed(mode,i) t ;
+ clip _pp_ to pathpart i ;
+ addto _p_ also _pp_ ;
+ elseif stroked i :
+ if mode=21 :
+ _ppp_ := i ; % indirectness is needed
+ addto _p_ also image(scantokens(t & " pathpart _ppp_")
+ dashed dashpart i withpen penpart i
+ withcolor _f_ ; ) ;
+ elseif mode=22 :
+ _ppp_ := i ; % indirectness is needed
+ addto _p_ also image(scantokens(t & " pathpart _ppp_")) ;
+ else :
+ addto _p_ doublepath pathpart i
+ dashed dashpart i withpen penpart i
+ withcolor _f_ % (redpart i, greenpart i, bluepart i)
+ if mode=2 : t fi ;
+ fi ;
+ elseif filled i :
+ if mode=11 :
+ _ppp_ := i ; % indirectness is needed
+ addto _p_ also image(scantokens(t & " pathpart _ppp_")
+ withcolor _f_ ; ) ;
+ elseif mode=12 :
+ _ppp_ := i ; % indirectness is needed
+ addto _p_ also image(scantokens(t & " pathpart _ppp_")) ;
+ else :
+ addto _p_ contour pathpart i
+ withcolor _f_
+ if (mode=1) and (_f_<>refillbackground) : t fi ;
+ fi ;
+ elseif textual i : % textpart i <> "" :
+ if mode <> 4 :
+ % transform _t_ ;
+ % (xpart _t_, xxpart _t_, xypart _t_) = (xpart i, xxpart i, xypart i) ;
+ % (ypart _t_, yypart _t_, yxpart _t_) = (ypart i, yypart i, yxpart i) ;
+ % addto _p_ also
+ % textpart i infont fontpart i % todo : other font
+ % transformed _t_
+ % withpen penpart i
+ % withcolor _f_
+ % if mode=3 : t fi ;
+ addto _p_ also i if mode=3 : t fi ;
+ fi ;
+ else :
+ addto _p_ also i ;
+ fi ;
+ endfor ;
+ setbounds _p_ to _b_ ;
+ _p_
+ endgroup
+enddef ;
+
+% After a question of Denis on how to erase a z variable, Jacko
+% suggested to assign whatever to x and y. So a clearz
+% variable can be defined as:
+%
+% vardef clearz@# =
+% x@# := whatever ;
+% y@# := whatever ;
+% enddef ;
+%
+% but Jacko suggested a redefinition of clearxy:
+%
+% def clearxy text s =
+% clearxy_index_:=0;
+% for $:=s:
+% clearxy_index_:=clearxy_index_+1; endfor;
+% if clearxy_index_=0:
+% save x,y;
+% else:
+% forsuffixes $:=s: x$:=whatever; y$:=whatever; endfor;
+% fi
+% enddef;
+%
+% which i decided to simplify to:
+
+def clearxy text s =
+ if false for $ := s : or true endfor :
+ forsuffixes $ := s : x$ := whatever ; y$ := whatever ; endfor ;
+ else :
+ save x, y ;
+ fi
+enddef ;
+
+% so now we can say: clearxy ; as well as clearxy 1, 2, 3 ;
+
+% show x0 ; z0 = (10,10) ;
+% show x0 ; x0 := whatever ; y0 := whatever ;
+% show x0 ; z0 = (20,20) ;
+% show x0 ; clearxy 0 ;
+% show x0 ; z0 = (30,30) ;
+
+primarydef p smoothed d =
+ (p llmoved (-xpart paired(d),0) -- p lrmoved (-xpart paired(d),0) {right} ..
+ p lrmoved (0,-ypart paired(d)) -- p urmoved (0,-ypart paired(d)) {up} ..
+ p urmoved (-xpart paired(d),0) -- p ulmoved (-xpart paired(d),0) {left} ..
+ p ulmoved (0,-ypart paired(d)) -- p llmoved (0,-ypart paired(d)) {down} .. cycle)
+enddef ;
+
+primarydef p cornered c =
+ ((point 0 of p) shifted (c*(unitvector(point 1 of p - point 0 of p))) --
+ for i=1 upto length(p) :
+ (point i-1 of p) shifted (c*(unitvector(point i of p - point i-1 of p))) --
+ (point i of p) shifted (c*(unitvector(point i-1 of p - point i of p))) ..
+ controls point i of p ..
+ endfor cycle)
+enddef ;
+
+% cmyk color support
+
+vardef cmyk(expr c,m,y,k) =
+ (1-c-k,1-m-k,1-y-k)
+enddef ;
+
+% handy
+
+vardef bbwidth (expr p) =
+ (if known p :
+ if path p or picture p :
+ xpart (lrcorner p - llcorner p)
+ else : 0 fi else : 0
+ fi )
+enddef ;
+
+vardef bbheight (expr p) =
+ (if known p : if path p or picture p :
+ ypart (urcorner p - lrcorner p)
+ else : 0 fi else : 0
+ fi)
+enddef ;
+
+color nocolor ; numeric noline ; % both unknown signals
+
+def dowithpath (expr p, lw, lc, bc) =
+ if known p :
+ if known bc :
+ fill p withcolor bc ;
+ fi ;
+ if known lw and known lc :
+ draw p withpen pencircle scaled lw withcolor lc ;
+ elseif known lw :
+ draw p withpen pencircle scaled lw ;
+ elseif known lc :
+ draw p withcolor lc ;
+ fi ;
+ fi ;
+enddef ;
+
+% result from metafont discussion list (denisr/boguslawj)
+
+def ]] = ] ] enddef ; def ]]] = ] ] ] enddef ;
+def [[ = [ [ enddef ; def [[[ = [ [ [ enddef ;
+
+% not perfect, but useful since it removes redundant points.
+
+% vardef dostraightened(expr sign, p) =
+% if length(p)>2 : % was 1, but straight lines are ok
+% save pp ; path pp ;
+% pp := point 0 of p ;
+% for i=1 upto length(p)-1 :
+% if round(point i of p) <> round(point length(pp) of pp) :
+% pp := pp -- point i of p ;
+% fi ;
+% endfor ;
+% save n, ok ; numeric n ; boolean ok ;
+% n := length(pp) ; ok := false ;
+% if n>2 :
+% for i=0 upto n : % evt hier ook round
+% if unitvector(round(point i of pp -
+% point if i=0 : n else : i-1 fi of pp)) <>
+% sign * unitvector(round(point if i=n : 0 else : i+1 fi of pp -
+% point i of pp)) :
+% if ok : -- else : ok := true ; fi point i of pp
+% fi
+% endfor
+% if ok and (cycle p) : -- cycle fi
+% else :
+% pp
+% fi
+% else :
+% p
+% fi
+% enddef ;
+
+% vardef simplified expr p =
+% (reverse dostraightened(+1,dostraightened(+1,reverse p)))
+% enddef ;
+
+% vardef unspiked expr p =
+% (reverse dostraightened(-1,dostraightened(-1,reverse p)))
+% enddef ;
+
+% simplified : remove same points as well as redundant points
+% unspiked : remove same points as well as areas with zero distance
+
+vardef dostraightened(expr sign, p) =
+ save _p_, _q_ ; path _p_, _q_ ;
+ _p_ := p ;
+ forever :
+ _q_ := dodostraightened(sign, _p_) ;
+ exitif length(_p_) = length(_q_) ;
+ _p_ := _q_ ;
+ endfor ;
+ _q_
+enddef ;
+
+vardef dodostraightened(expr sign, p) =
+ if length(p)>2 : % was 1, but straight lines are ok
+ save pp ; path pp ;
+ pp := point 0 of p ;
+ for i=1 upto length(p)-1 :
+ if round(point i of p) <> round(point length(pp) of pp) :
+ pp := pp -- point i of p ;
+ fi ;
+ endfor ;
+ save n, ok ; numeric n ; boolean ok ;
+ n := length(pp) ; ok := false ;
+ if n>2 :
+ for i=0 upto n : % evt hier ook round
+ if unitvector(round(point i of pp -
+ point if i=0 : n else : i-1 fi of pp)) <>
+ sign * unitvector(round(point if i=n : 0 else : i+1 fi of pp -
+ point i of pp)) :
+ if ok : -- else : ok := true ; fi point i of pp
+ fi
+ endfor
+ if ok and (cycle p) : -- cycle fi
+ else :
+ pp
+ fi
+ else :
+ p
+ fi
+enddef ;
+
+% vardef simplified expr p =
+% dostraightened(+1,p)
+% enddef ;
+
+% vardef unspiked expr p =
+% dostraightened(-1,p)
+% enddef ;
+
+vardef simplified expr p =
+ (reverse dostraightened(+1,dostraightened(+1,reverse p)))
+enddef ;
+
+vardef unspiked expr p =
+ (reverse dostraightened(-1,dostraightened(-1,reverse p)))
+enddef ;
+
+% path p ;
+% p := (2cm,1cm) -- (2cm,1cm) -- (2cm,1cm) -- (3cm,1cm) --
+% (4cm,1cm) -- (4cm,2cm) -- (4cm,2.5cm) -- (4cm,3cm) --
+% (3cm,3cm) -- (2cm,3cm) -- (1cm,3cm) -- (-1cm,3cm) --
+% .5[(-1cm,3cm),(1cm,1cm)] -- (1cm,1cm) -- cycle ;
+%
+% p := unitcircle scaled 4cm ;
+%
+% drawpath p ; drawpoints p ; drawpointlabels p ;
+% p := p shifted (4cm,0) ; p := straightened p ;
+% drawpath p ; drawpoints p ; drawpointlabels p ;
+% p := p shifted (4cm,0) ; p := straightened p ;
+% drawpath p ; drawpoints p ; drawpointlabels p ;
+
+% new
+
+path originpath ; originpath := origin -- cycle ;
+
+vardef unitvector primary z =
+ if abs z = abs origin : z else : z/abs z fi
+enddef;
+
+% also new
+
+vardef anchored@#(expr p, z) =
+ p shifted (z + (labxf@#*lrcorner p + labyf@#*ulcorner p
+ + (1-labxf@#-labyf@#)*llcorner p))
+enddef ;
+
+% epsed(1.2345)
+
+vardef epsed (expr e) =
+ e if e>0 : + eps elseif e<0 : - eps fi
+enddef ;
+
+% handy
+
+def withgray primary g =
+ withcolor (g,g,g)
+enddef ;
+
+% for metafun
+
+if unknown darkred : color darkred ; darkred := .625(1,0,0) fi ;
+if unknown darkyellow : color darkyellow ; darkyellow := .625(1,1,0) fi ;
+if unknown darkgray : color darkgray ; darkgray := .625(1,1,1) fi ;
+if unknown lightgray : color lightgray ; lightgray := .875(1,1,1) fi ;
+
+% an improved plain mp macro
+
+vardef center primary p =
+ if pair p : p else : .5[llcorner p, urcorner p] fi
+enddef;
+
+% new, yet undocumented
+
+vardef rangepath (expr p, d, a) =
+ (if length p>0 :
+ (d*unitvector(direction 0 of p) rotated a)
+ shifted point 0 of p
+ -- p --
+ (d*unitvector(direction length(p) of p) rotated a)
+ shifted point length(p) of p
+ else :
+ p
+ fi)
+enddef ;
+
+% under construction
+
+vardef straightpath(expr a, b, method) =
+ if (method<1) or (method>6) :
+ (a--b)
+ elseif method = 1 :
+ (a --
+ if xpart a > xpart b :
+ if ypart a > ypart b :
+ (xpart b,ypart a) --
+ elseif ypart a < ypart b :
+ (xpart a,ypart b) --
+ fi
+ elseif xpart a < xpart b :
+ if ypart a > ypart b :
+ (xpart a,ypart b) --
+ elseif ypart a < ypart b :
+ (xpart b,ypart a) --
+ fi
+ fi
+ b)
+ elseif method = 3 :
+ (a --
+ if xpart a > xpart b :
+ (xpart b,ypart a) --
+ elseif xpart a < xpart b :
+ (xpart a,ypart b) --
+ fi
+ b)
+ elseif method = 5 :
+ (a --
+ if ypart a > ypart b :
+ (xpart b,ypart a) --
+ elseif ypart a < ypart b :
+ (xpart a,ypart b) --
+ fi
+ b)
+ else :
+ (reverse straightpath(b,a,method-1))
+ fi
+enddef ;
+
+% handy for myself
+
+def addbackground text t =
+ begingroup ; save p ; picture p ;
+ p := currentpicture ; currentpicture := nullpicture ;
+ fill boundingbox p t ; addto currentpicture also p ;
+ endgroup ;
+enddef ;
+
+% makes a (line) into an infinite one (handy for calculating
+% intersection points
+
+vardef infinite expr p =
+ (-infinity*unitvector(direction 0 of p)
+ shifted point 0 of p
+ -- p --
+ +infinity*unitvector(direction length(p) of p)
+ shifted point length(p) of p)
+enddef ;
+
+% obscure macros: create var from string and replace - and :
+% (needed for process color id's)
+
+string _clean_ascii_[] ;
+
+def register_dirty_chars(expr str) =
+ for i = 0 upto length(str)-1 :
+ _clean_ascii_[ASCII substring(i,i+1) of str] := "_" ;
+ endfor ;
+enddef ;
+
+register_dirty_chars("+-*/:;., ") ;
+
+vardef cleanstring (expr s) =
+ save ss ; string ss, si ; ss = "" ; save i ;
+ for i=0 upto length(s) :
+ si := substring(i,i+1) of s ;
+ ss := ss & if known _clean_ascii_[ASCII si] : _clean_ascii_[ASCII si] else : si fi ;
+ endfor ;
+ ss
+enddef ;
+
+vardef asciistring (expr s) =
+ save ss ; string ss, si ; ss = "" ; save i ;
+ for i=0 upto length(s) :
+ si := substring(i,i+1) of s ;
+ if (ASCII si >= ASCII "0") and (ASCII si <= ASCII "9") :
+ ss := ss & char(scantokens(si) + ASCII "A") ;
+ else :
+ ss := ss & si ;
+ fi ;
+ endfor ;
+ ss
+enddef ;
+
+vardef setunstringed (expr s, v) =
+ scantokens(cleanstring(s)) := v ;
+enddef ;
+
+vardef setunstringed (expr s, v) =
+ scantokens(cleanstring(s)) := v ;
+enddef ;
+
+vardef getunstringed (expr s) =
+ scantokens(cleanstring(s))
+enddef ;
+
+vardef unstringed (expr s) =
+ expandafter known scantokens(cleanstring(s))
+enddef ;
+
+% new
+
+vardef colorpart(expr i) =
+ (redpart i, greenpart i,bluepart i)
+enddef ;
+
+% for david arnold:
+
+% showgrid(-5,10,1cm,-10,10,1cm);
+
+def showgrid (expr MinX, MaxX, DeltaX, MinY, MaxY, DeltaY)=
+ begingroup
+ save defaultfont, defaultscale, size ;
+ string defaultfont ; defaultfont := "cmtt10"; % i.e. infofont
+ numeric defaultscale ; defaultscale := 8pt / fontsize defaultfont;
+ numeric size ; size := 2pt ;
+ for x=MinX upto MaxX :
+ for y=MinY upto MaxY :
+ draw (x*DeltaX, y*DeltaY)
+ withpen pencircle scaled
+ if (x mod 5 = 0) and (y mod 5 = 0) :
+ 1.5size withcolor .50white
+ else :
+ size withcolor .75white
+ fi ;
+ endfor ;
+ endfor ;
+ for x=MinX upto MaxX:
+ label.bot(decimal x, (x*DeltaX,-size));
+ endfor ;
+ for y=MinY upto MaxY:
+ label.lft(decimal y, (-size,y*DeltaY)) ;
+ endfor ;
+ endgroup
+enddef;
+
+% new, handy for:
+%
+% \startuseMPgraphic{map}{n}
+% \includeMPgraphic{map:germany} ;
+% c_phantom (\MPvar{n}<1) (
+% fill map_germany withcolor \MPcolor{lightgray} ;
+% draw map_germany withpen pencircle scaled 1pt withcolor \MPcolor{darkgray} ;
+% ) ;
+% \includeMPgraphic{map:austria} ;
+% c_phantom (\MPvar{n}<2) (
+% fill map_austria withcolor \MPcolor{lightgray} ;
+% draw map_austria withpen pencircle scaled 1pt withcolor \MPcolor{darkgray} ;
+% ) ;
+% c_phantom (\MPvar{n}<3) (
+% \includeMPgraphic{map:swiss} ;
+% fill map_swiss withcolor \MPcolor{lightgray} ;
+% draw map_swiss withpen pencircle scaled 1pt withcolor \MPcolor{darkgray} ;
+% ) ;
+% c_phantom (\MPvar{n}<4) (
+% \includeMPgraphic{map:luxembourg} ;
+% fill map_luxembourg withcolor \MPcolor{lightgray} ;
+% draw map_luxembourg withpen pencircle scaled 1pt withcolor \MPcolor{darkgray} ;
+% ) ;
+% \stopuseMPgraphic
+%
+% \useMPgraphic{map}{n=3}
+
+vardef phantom (text t) =
+ picture _p_ ; _p_ := image(t) ; addto _p_ also currentpicture ;
+ setbounds currentpicture to boundingbox _p_ ;
+enddef ;
+
+vardef c_phantom (expr b) (text t) =
+ if b :
+ picture _p_ ; _p_ := image(t) ; addto _p_ also currentpicture ;
+ setbounds currentpicture to boundingbox _p_ ;
+ else :
+ t ;
+ fi ;
+enddef ;
+
+% done
+
+endinput ;
diff --git a/Master/texmf-dist/doc/metapost/featpost/xcmd/README.xcmd b/Master/texmf-dist/doc/metapost/featpost/xcmd/README.xcmd
new file mode 100644
index 00000000000..24400889ab5
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/xcmd/README.xcmd
@@ -0,0 +1,10 @@
+It is possible to interactively experiment the effect
+of figure parameters. This requires:
+1) MetaPost code written as "anglinerigorouscircle.mp".
+2) xcmd package (kindly provided by Pedro Sebastião);
+ it may be downloaded from http://lince.cii.fc.ul.pt/
+ in Debian, Red Hat or tar.gz package formats.
+3) Perl.
+4) gv.
+5) run command "xcmd/xmpost anglinerigorouscircle" or
+ "xcmd/xmpost anymetapostwoextension".
diff --git a/Master/texmf-dist/doc/metapost/featpost/xcmd/xmpost b/Master/texmf-dist/doc/metapost/featpost/xcmd/xmpost
new file mode 100755
index 00000000000..3a45f6a9859
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/xcmd/xmpost
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+
+#$Id: xmpost,v 1.1 1999/05/10 17:14:27 pedros Exp $
+
+open OFILE, ">$ARGV[0]" or die " can't open $ARGV[0].pl:$!\n";
+open IFILE, "<$ARGV[0].mp" or die " can't open $ARGV[0].mp:$!\n";
+open XCMDFILE, ">$ENV{\"HOME\"}/.xcmd/$ARGV[0]" or die " can't open ~/.xcmd/$ARGV[0]:$!\n";
+
+my $tmp_mp_file = "$ARGV[0].$$";
+
+my $i=$j=0;
+
+while(<IFILE>){
+# s/\s*(\w+)\s*\t*\s*:*=\s*([\(0-9,-.\)]*);/\t$1\t:=\$opt_$1;/;
+ $lines[$j++]=$_;
+ if($_ =~ /\s*(\w+)\s*\t*\s*:=\s*([\(0-9,-.\)]*);/){
+ print XCMDFILE "OPTION_WITH_ARG --$1 DEFAULT \"$2\"\n";
+# print OFILE "\t$1\t\t:=\$opt_$1;\n";
+ $arr[$i++]="\$opt_$1";
+ }
+}
+close IFILE;
+
+print OFILE "#!/usr/bin/perl\n\n";
+print OFILE " use vars qw(";
+
+foreach $i (0..$#arr-1){
+ print OFILE "$arr[$i] ";
+}
+print OFILE "$arr[$#arr]);\n\n";
+
+print OFILE "\n\nuse Getopt::Long;\n\n";
+
+
+foreach $i (0..$#arr){
+ print OFILE "$arr[$i]=\"\";\n";
+}
+print OFILE "\n\nGetOptions(";
+foreach $i (0..$#arr-1){
+ $arr[$i] =~ s/\$opt_//;
+ print OFILE "\"$arr[$i]=s\",";
+}
+$arr[$#arr] =~ s/\$opt_//;
+
+print OFILE "\"$arr[$#arr]=s\") || die \"Aborted\";\n";
+print OFILE "\$file = \"$tmp_mp_file\";\n";
+print OFILE "\nopen TMP, \">/tmp/\$file.mp\" || die \"can't open /tmp/\$file.mp \$!\\n\";\n";
+
+foreach $j (0..$#lines){
+ $_ = $lines[$j];
+ chop;
+ s/\%/\\\%/g;
+ s/\\/\\\\/g;
+ s/\$/\\\$/g;
+ s/\s*(\w+)\s*\t*\s*:=\s*([\(0-9,-.\)]*);/\t$1\t\t:= \$opt_$1;/;
+ print OFILE "print TMP \"$_\\n\";\n";
+}
+print OFILE "close TMP;\n";
+
+print OFILE "\$tmp = `inimpost featpost.mp`;\n";
+print OFILE "\$tmp = `mpost -mem featpost /tmp/\$file.mp`;\n";
+print OFILE "\$tmp = `laproof /tmp/\$file 1`;\n";
+
+my $tmp = `chmod +x $ARGV[0]`;
+$tmp = `cp $ARGV[0].mp /tmp/$tmp_mp_file.mp`;
+$tmp= `inimpost featpost.mp`;
+$tmp = `mpost -mem featpost /tmp/$tmp_mp_file.mp`;
+$tmp = `laproof /tmp/$tmp_mp_file 1`;
+system("gv -watch $tmp_mp_file.1.eps &");
+system("xcmd $ARGV[0] &");