diff options
author | Karl Berry <karl@freefriends.org> | 2012-04-02 23:52:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-04-02 23:52:46 +0000 |
commit | ae69c9efb78c7ca0e48d4c63b6209883d10ab378 (patch) | |
tree | e17ecc5601439d7f35948683b230f7747a94757b /Master | |
parent | 3c5dc267d6509125015de5f39c1b889e2d548ca0 (diff) |
featpost (2apr12)
git-svn-id: svn://tug.org/texlive/trunk@25828 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
13 files changed, 204 insertions, 68 deletions
diff --git a/Master/texmf-dist/doc/metapost/featpost/README b/Master/texmf-dist/doc/metapost/featpost/README index 1ee1a53bab2..e2a0550c6c5 100644 --- a/Master/texmf-dist/doc/metapost/featpost/README +++ b/Master/texmf-dist/doc/metapost/featpost/README @@ -1,4 +1,4 @@ -Learn FeatPost-0.8.4 from the following three files in the "doc" directory: +Learn FeatPost-0.8.5 from the following three files in the "doc" directory: "featpostmanual.pdf" gathers all that I ever wrote about FeatPost; "featpostbeamer.pdf" is a presentation version of the above manual; "FeatPostExemplifier.ps.bz2" gathers all the example figures. diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/FeatPostExemplifier.ps.bz2 b/Master/texmf-dist/doc/metapost/featpost/doc/FeatPostExemplifier.ps.bz2 Binary files differindex 706306e3177..493d37ab4a0 100644 --- a/Master/texmf-dist/doc/metapost/featpost/doc/FeatPostExemplifier.ps.bz2 +++ b/Master/texmf-dist/doc/metapost/featpost/doc/FeatPostExemplifier.ps.bz2 diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/featpostbeamer.pdf b/Master/texmf-dist/doc/metapost/featpost/doc/featpostbeamer.pdf Binary files differindex a27815c13c5..652be0af42f 100644 --- a/Master/texmf-dist/doc/metapost/featpost/doc/featpostbeamer.pdf +++ b/Master/texmf-dist/doc/metapost/featpost/doc/featpostbeamer.pdf diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/featpostdocsource.tex b/Master/texmf-dist/doc/metapost/featpost/doc/featpostdocsource.tex index 9fd4cea8b1a..9201592e6ba 100644 --- a/Master/texmf-dist/doc/metapost/featpost/doc/featpostdocsource.tex +++ b/Master/texmf-dist/doc/metapost/featpost/doc/featpostdocsource.tex @@ -9,7 +9,7 @@ \newcommand{\myem}[1]{\texttt{#1}} \title{\FP\ manual} \author{\href{mailto:lnobreg@gmail.com}{L. Nobre G.}} -\date{0.8.4} +\date{0.8.5} \begin{document} \mode<article>{\maketitle} \frame{\titlepage} @@ -652,7 +652,11 @@ draw 3D matching schematic diagrams on the image. Using the same algorithm of \myem{photoreverse}, the macro \myem{improvertex} allows one to approximate a point in 3D-space with given distances from three other -points (an initial guess is required). +points (an initial guess $\vec{i}$ is required). +\begin{center} + \myem{point := improvertex}( $\vec{a}$, $d_a$, $\vec{b}$, $d_b$, + $\vec{c}$, $d_c$, $\vec{i}$ ); +\end{center} } \section{Reference Manual} @@ -1567,6 +1571,22 @@ of the cylinders). \myem{bluepart}-wheel ray. \end{figure}} +\item draw {\bfseries quartertorus()} Draws a part of a torus. + \begin{enumerate} + \item \myem{color} Center of the base torus. + \item \myem{color} Vector indicating the position, relative to the + center of the base torus, of the center of the circle obtained by + cutting the base torus through a plane containing its axle. + \item \myem{color} Vector indicating the orientation of another + similar cutting plane (the norm of vector has no meaning). + \item \myem{numeric} Radius of cross-section circles. + \end{enumerate} +\frame{\begin{figure}[bpt] +\begin{center} + \includegraphics[width=0.65\columnwidth]{quartertorus.2} +\end{center} + \caption{Figure that uses \myem{quartertorus}.} +\end{figure}} \end{itemize} @@ -2090,6 +2110,17 @@ for each pair (\myem{S},\myem{T}). \end{center} } +\subsection{Torus' slice} + +\frame{ + \frametitle{\myem{quartertorus}( $\vec{c}$, $\vec{A}$, $\vec{B}$, $R$ )} + \begin{center} + \includegraphics[width=70mm]{revolvers.7} \\ + + \myem{quartertorus( black, -red, red-green, 0.25 );} + \end{center} +} + \section{References} \begin{description} diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/featpostmanual.pdf b/Master/texmf-dist/doc/metapost/featpost/doc/featpostmanual.pdf Binary files differindex 8a1456b3ea4..eaa4c8a6a7f 100644 --- a/Master/texmf-dist/doc/metapost/featpost/doc/featpostmanual.pdf +++ b/Master/texmf-dist/doc/metapost/featpost/doc/featpostmanual.pdf diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/lastfiguretest.pdf b/Master/texmf-dist/doc/metapost/featpost/doc/lastfiguretest.pdf Binary files differnew file mode 100644 index 00000000000..dae613018b0 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/featpost/doc/lastfiguretest.pdf diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/lastfiguretest.tex b/Master/texmf-dist/doc/metapost/featpost/doc/lastfiguretest.tex new file mode 100644 index 00000000000..c6dcad8b613 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/featpost/doc/lastfiguretest.tex @@ -0,0 +1,24 @@ +\documentclass[ignorenonframetext]{beamer} +\usetheme{Pittsburgh} +\setbeamercolor{normal text}{bg=red!7} +\usepackage{amsmath,amssymb,graphicx} +\DeclareGraphicsRule{*}{mps}{*}{} +\graphicspath{{../}} +\newfont{\normald}{logod10 scaled 1024} +\newcommand{\MF}{{\normald METAFONT}} +\newcommand{\MP}{{\normald METAPOST}} +\newcommand{\FP}{{\normald FEATPOST}} +\newcommand{\myem}[1]{\texttt{#1}} +\begin{document} + +\frame{ + \frametitle{\myem{quartertorus}( $\vec{c}$, $\vec{A}$, $\vec{B}$, $R$ )} + \begin{center} + \includegraphics[width=70mm]{revolvers.7} \\ + + \myem{quartertorus( black, -red, red-green, 0.25 );} + \end{center} +} + +\end{document} + diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/metapostpropaganda.pdf b/Master/texmf-dist/doc/metapost/featpost/doc/metapostpropaganda.pdf Binary files differindex ca273c77203..ad37ec1d884 100644 --- a/Master/texmf-dist/doc/metapost/featpost/doc/metapostpropaganda.pdf +++ b/Master/texmf-dist/doc/metapost/featpost/doc/metapostpropaganda.pdf diff --git a/Master/texmf-dist/doc/metapost/featpost/doc/metapostpropagandafiles.zip b/Master/texmf-dist/doc/metapost/featpost/doc/metapostpropagandafiles.zip Binary files differnew file mode 100644 index 00000000000..fc1559a5e99 --- /dev/null +++ b/Master/texmf-dist/doc/metapost/featpost/doc/metapostpropagandafiles.zip diff --git a/Master/texmf-dist/doc/metapost/featpost/example/bananadimmer.log b/Master/texmf-dist/doc/metapost/featpost/example/bananadimmer.log new file mode 100644 index 00000000000..5fe5102d83b --- /dev/null +++ b/Master/texmf-dist/doc/metapost/featpost/example/bananadimmer.log @@ -0,0 +1,14 @@ +This is MetaPost, version 1.504 (kpathsea version 6.0.0) 24 NOV 2011 13:14 +**bananadimmer.mp +(mpost.mp (/usr/share/texmf-texlive/metapost/base/plain.mp +Preloading the plain mem file, version 1.004)) (./bananadimmer.mp +(/usr/share/texmf-texlive/metapost/featpost/featpost3Dplus2D.mp +Preloading FeatPost macros, version 0.6.7) +>> banana +! Isolated expression. +<to be read again> + ( +l.62 banana( + +? x + diff --git a/Master/texmf-dist/doc/metapost/featpost/example/quartertorus.mp b/Master/texmf-dist/doc/metapost/featpost/example/quartertorus.mp index b979b7f26f1..0d2ca4da098 100644 --- a/Master/texmf-dist/doc/metapost/featpost/example/quartertorus.mp +++ b/Master/texmf-dist/doc/metapost/featpost/example/quartertorus.mp @@ -1,9 +1,11 @@ % quartertorus.mp % L. Nobre G. -% 2006 +% 2012 input featpost3Dplus2D; +prologues := 3; + verbatimtex \documentclass{article} \usepackage{mathpazo} @@ -13,20 +15,59 @@ etex f := (3,5,2.5); beginfig(1); - color a, b, c, g; - numeric fac, siz; + color a, b, c, g, h, i, j, l, m, n; + numeric fac, siz, s; fac = 0.05; siz = 0.3; - g = -green; + s = 2; a = blue-red; b = g-fac*a; c = -a-fac*g; + g = -green; + h = 2*g; + i = red+g; + j= -red; + l = blue; + m = 0.6red-g; + n = -0.7*blue; drawoptions( withpen pencircle scaled 2.5pt ); + quartertorus( black, h, i, siz ); quartertorus( black, g, a, siz ); quartertorus( black, b, c, siz ); - quartertorus( black, green, -red, siz ); - quartertorus( -0.7*blue, blue, 0.6red+green, siz ); - label( btex $\vec{\Upsilon}$ etex, rp( c ) ); + quartertorus( black, -g, j, siz ); + quartertorus( n, l, m, siz ); + label( btex $a$ etex scaled s, rp( a ) ); + label.llft( btex $b$ etex scaled s, rp( b ) ); + label( btex $c$ etex scaled s, rp( c ) ); + label.urt( btex $g$ etex scaled s, rp( g ) ); + label( btex $-g$ etex scaled s, rp( -g ) ); + label( btex $h$ etex scaled s, rp( h ) ); + %label( btex $i$ etex scaled s, rp( i ) ); + label( btex $j$ etex scaled s, rp( j ) ); + label( btex $l$ etex scaled s, rp( l+n ) ); + label( btex $m$ etex scaled s, rp( m+n ) ); +endfig; + +beginfig(2); + color col[]; + numeric ray, ang, len, bigray; + ray = 0.15; + bigray = 0.4; + ang = 60; + len = 0.7; + col1 = (-(ray+bigray)/cosd(ang),0,0); + col2 = (bigray*cosd(ang),0,bigray*sind(ang)); + col3 = (bigray*cosd(ang),0,-bigray*sind(ang)); + col4 = ((ray+bigray)*cosd(ang),0,(ray+bigray)*sind(ang)); + col5 = ((ray+bigray)*cosd(ang),0,-(ray+bigray)*sind(ang)); + col6 = (-len*sind(ang),0,len*cosd(ang)); + col7 = (-len*sind(ang),0,-len*cosd(ang)); + col8 = col1+col4+col6; + col9 = col1+col5+col7; + rigorousdisc( 0, true, col1+col3, ray, col7 ); + rigorousdisc( 0, true, col1+col2, ray, col6 ); + quartertorus( col1, col3, col2, ray ); + draw rp(col9)--rp(black)--rp(col8); endfig; verbatimtex diff --git a/Master/texmf-dist/doc/metapost/featpost/example/revolvers.mp b/Master/texmf-dist/doc/metapost/featpost/example/revolvers.mp index acd71d2ead5..e83d1fb971d 100644 --- a/Master/texmf-dist/doc/metapost/featpost/example/revolvers.mp +++ b/Master/texmf-dist/doc/metapost/featpost/example/revolvers.mp @@ -1,6 +1,6 @@ % revolvers.mp % L. Nobre G. -% 2004 +% 2012 input featpost3Dplus2D; @@ -155,6 +155,30 @@ beginfig(6); dotlabel.bot( labc, rp(black) ); endfig; +beginfig(7); + numeric labscal, ray; + picture laba, labb, labr, labc; + labscal = 2; + ray = 0.25; + ahlength := 10pt; + ahangle := 30; + labc = btex $\vec{c}$ etex scaled labscal; + laba = btex $\vec{A}$ etex scaled labscal; + labb = btex $\vec{B}$ etex scaled labscal; + labr = btex $R$ etex scaled labscal; + drawoptions( withpen pencircle scaled 1.7pt withcolor 0.65blue ); + quartertorus( black, -red, red-green, ray ); + drawoptions( withpen pencircle scaled 1.3pt ); + drawarrow rp(black)--rp(red-green) withpen pencircle scaled 1.3pt; + label.bot( labb, rp((red-green)/sqrt(2)) ); + drawarrow rp(black)--rp(-red) withpen pencircle scaled 1.3pt; + label.bot( laba, rp(-0.5*red) ); + drawdblarrow rp(-red)--rp(ray*blue-red); + label.rt( labr, rp(0.5*ray*blue-red) ); + dotlabel.bot( labc, rp(black) ); + +endfig; + verbatimtex }\end{document} etex end; diff --git a/Master/texmf-dist/metapost/featpost/featpost3Dplus2D.mp b/Master/texmf-dist/metapost/featpost/featpost3Dplus2D.mp index 8ed0ab46a18..85417a17271 100644 --- a/Master/texmf-dist/metapost/featpost/featpost3Dplus2D.mp +++ b/Master/texmf-dist/metapost/featpost/featpost3Dplus2D.mp @@ -23,7 +23,7 @@ % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. - message "Preloading FeatPost macros, version 0.8.4"; + message "Preloading FeatPost macros, version 0.8.5"; warningcheck := 0; background := 0.987white; @@ -1872,47 +1872,36 @@ endgroup enddef; -% Take a "quarter" of a "stretched" donut (under construction) +% Take a "quarter" of a donut +% (no longer under construction but contains a bug). def quartertorus( expr Tcenter, Tstart, Tfinis, Sray ) = begingroup - save sideaxe, viewline, circlecenter, circlemoment; - save i, angstep, cuspcond, coofrac, tmoment, tstart, tfinis; - save cpath, opath, ipath, wp, ep, refpair, fpath; - save vstart, vfinis, ostart, ofinis, cstart, cfinis; + save sideaxe, viewline, circlecenter, circlemoment, amax; + save i, angstep, tmoment, cpath, opath, ipath, fpath, finc; + save vstart, vfinis, ostart, ofinis, cstart, cfinis, finis; color sideaxe, viewline, circlecenter, circlemoment; - color tmoment, vstart, vfinis, tstart, tfinis; - numeric i, angstep, coofrac; - path cpath, opath, ipath, wp, ep, cstart, cfinis, fpath; - pair outerp[], innerp[], refpair; - boolean cuspcond, ostart, ofinis; - angstep = 6; + color tmoment, vstart, vfinis, finis, finc; + numeric i, angstep, amax; + path cpath, opath, ipath, cstart, cfinis, fpath; + pair outerp[], innerp[]; + boolean ostart, ofinis; + angstep = 4; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DANGER! viewline = f-Tcenter; -% if cdotprod( viewline, Tstart ) < cdotprod( viewline, Tfinis ): -% tstart = Tfinis; -% tfinis = Tstart; -% else: - tstart = Tstart; - tfinis = Tfinis; -% fi; - tmoment = ncrossprod( tstart, tfinis ); - vstart = ncrossprod( tstart, tmoment ); - vfinis = ncrossprod( tmoment, tfinis ); - ostart = cdotprod( viewline-tstart, vstart ) > 0; - ofinis = cdotprod( viewline-tfinis, vfinis ) > 0; - cstart = spatialhalfcircle(tstart+Tcenter,vstart,Sray,true); - cfinis = spatialhalfcircle(tfinis+Tcenter,vfinis,Sray,true); + tmoment = ncrossprod( Tstart, Tfinis ); + vstart = ncrossprod( Tstart, tmoment ); + vfinis = ncrossprod( tmoment, Tfinis ); + finis = -vstart*conorm( Tstart ); + amax = getangle( Tstart, Tfinis ); + finc = N( Tfinis )*conorm( Tstart ); if cdotprod( viewline, tmoment ) < 0: tmoment := -tmoment; fi; - refpair = unitvector( rp(Tcenter+tmoment)-rp(Tcenter) ); sideaxe = ncrossprod( tmoment, viewline ); - coofrac = cdotprod( viewline, tmoment )/Sray; - - for i=0 step angstep until 90: - circlecenter:= tstart*cosd(i)+tfinis*sind(i); + for i=0 step angstep until amax: + circlecenter:= Tstart*cosd(i)+finis*sind(i); circlemoment:= ccrossprod(circlecenter,tmoment); - cpath:=spatialhalfcircle(circlecenter+Tcenter,circlemoment,Sray,true); + cpath:=spatialhalfcircle(circlecenter+Tcenter,circlemoment,Sray,true); if cdotprod( sideaxe, circlecenter ) < 0: outerp[i/angstep]=point 0 of cpath; innerp[i/angstep]=point (length cpath) of cpath; @@ -1921,36 +1910,35 @@ outerp[i/angstep]=point (length cpath) of cpath; fi; endfor; - opath = outerp0 for i=angstep step angstep until 90: + cstart = spatialhalfcircle(Tstart+Tcenter,vstart,Sray,true); + if cdotprod( sideaxe, Tstart ) > 0: + cstart := reverse cstart; + fi; + cfinis = spatialhalfcircle(finc+Tcenter,vfinis,Sray,true); + if cdotprod( sideaxe, finc ) < 0: + cfinis := reverse cfinis; + fi; + opath = outerp0 for i=angstep step angstep until amax: ..outerp[i/angstep] endfor; - ipath = innerp0 for i=angstep step angstep until 90: + ipath = innerp0 for i=angstep step angstep until amax: ..innerp[i/angstep] endfor; fpath = ipath---cfinis---reverse opath---cstart---cycle; unfill fpath; draw fpath; -% draw cstart---ipath---cfinis; + ostart = cdotprod( viewline-Tstart, vstart ) > 0; if ostart: - cpath := rigorouscircle( Tcenter+tstart, vstart, Sray ); + cpath := rigorouscircle( Tcenter+Tstart, vstart, Sray ); unfill cpath; draw cpath; fi; + ofinis = cdotprod( viewline-finc, vfinis ) > 0; if ofinis: - cpath := rigorouscircle( Tcenter+tfinis, vfinis, Sray ); + cpath := rigorouscircle( Tcenter+finc, vfinis, Sray ); unfill cpath; draw cpath; fi; - -% i := 0; -% cuspcond = false; -% forever: -% exitif i > (90/angstep)-2; -% i := incr( i ); -% cuspcond := -% refpair dotprod outerp[i+1] < -% refpair dotprod outerp[i]; -% exitif cuspcond; -% endfor; -% undraw subpath (i,90/angstep) of opath; + %draw opath withcolor blue; + %draw ipath withcolor red; endgroup enddef; @@ -3582,17 +3570,30 @@ def improvertex( expr VerA, DisA, VerB, DisB, VerC, DisC, IniV ) = begingroup - save j, iternum, prevcost, factry, actpoi, actfact; - save jumplim, trypoi, halfpo, expfact, randcost, avercost; + save j, iternum, prevcost, factry, actpoi, actfact, auxa, auxb; + save jumplim, trypoi, halfpo, expfact, randcost, avercost, auxc; numeric j, iternum, prevcost, factry, randcost, avercost, actfact; numeric jumplim, expfact; - color actpoi, trypoi, halfpo; - iternum = 100; % DANGER! + color actpoi, trypoi, halfpo, auxa, auxb, auxc; + trypoi = IniV; + iternum = 28; % DANGER! factry = 0.25; % DANGER! jumplim = 2.5; % DANGER! - prevcost = calculatecostver(VerA,DisA,VerB,DisB,VerC,DisC,IniV); - trypoi = IniV; - show prevcost; + prevcost = calculatecostver(VerA,DisA,VerB,DisB,VerC,DisC,trypoi); + message "improvertex initial cost: " & decimal(prevcost) + & " at point " & cstr(trypoi); + for j=1 upto 5: + auxa := VerA-trypoi; + auxa := N(auxa)*(conorm(auxa)-DisA); + auxb := VerB-trypoi; + auxb := N(auxb)*(conorm(auxb)-DisB); + auxc := VerC-trypoi; + auxc := N(auxc)*(conorm(auxc)-DisC); + trypoi := trypoi+factry*(auxa+auxb+auxc); + endfor; + prevcost := calculatecostver(VerA,DisA,VerB,DisB,VerC,DisC,trypoi); + message "phase one cost: " & decimal(prevcost) + & " at point " & cstr(trypoi); for j=0 upto iternum: expfact := mexp(-j*200/iternum); % DANGER! actpoi := trypoi+factry*expfact*randomfear; @@ -3607,7 +3608,8 @@ calculatecostver(VerA,DisA,VerB,DisB,VerC,DisC,trypoi); % show prevcost; endfor; - show prevcost; + message "final cost: " & decimal(prevcost) + & " at point " & cstr(trypoi); ( trypoi ) endgroup; enddef; |