diff options
author | Norbert Preining <norbert@preining.info> | 2021-12-30 03:03:03 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-12-30 03:03:03 +0000 |
commit | 9c6b719a925395c95a580982fec885256757d972 (patch) | |
tree | 91e3778cbed24b867cde747cedeae4b8271d4312 /graphics | |
parent | dce1a2a6ecd9971433b4ee24c9d36b124cc1280e (diff) |
CTAN sync 202112300303
Diffstat (limited to 'graphics')
22 files changed, 1096 insertions, 695 deletions
diff --git a/graphics/pstricks/base/Changes b/graphics/pstricks/base/Changes index d06ae78798..6544cc1166 100644 --- a/graphics/pstricks/base/Changes +++ b/graphics/pstricks/base/Changes @@ -1,4 +1,4 @@ -% $Id: Changes 317 2021-11-16 20:47:25Z herbert $ +% $Id: Changes 382 2021-12-29 19:19:18Z herbert $ For all changes see file History! Here are only the last one changes listed. @@ -11,6 +11,8 @@ pstricks.tex -------- versions like 2.47a have only changes in other files, but not in this main package. +3.12 2021-12-29 - added code for guessing box coordinates for pspicture + - added optional arguments showframe and calcframe 3.11a 2021-11-16 - fix for GS in pstricks.pro 3.11 2021-10-01 - added the missing filled dots - fix for pst-dots.pro (delete one dup) diff --git a/graphics/pstricks/base/README b/graphics/pstricks/base/README index c824ddb9b1..1fd4da8c3d 100644 --- a/graphics/pstricks/base/README +++ b/graphics/pstricks/base/README @@ -1,4 +1,4 @@ -PSTricks 2021 +PSTricks 2022 This package may be distributed under the terms of the LaTeX Project Public License, as described in lppl.txt in the base LaTeX distribution. diff --git a/graphics/pstricks/base/doc/pst-news21.pdf b/graphics/pstricks/base/doc/pst-news21.pdf Binary files differindex 4f6554e86f..5559ed0837 100644 --- a/graphics/pstricks/base/doc/pst-news21.pdf +++ b/graphics/pstricks/base/doc/pst-news21.pdf diff --git a/graphics/pstricks/base/doc/pst-news21.tex b/graphics/pstricks/base/doc/pst-news21.tex index de90a7cc5c..510a7435b3 100644 --- a/graphics/pstricks/base/doc/pst-news21.tex +++ b/graphics/pstricks/base/doc/pst-news21.tex @@ -1,14 +1,14 @@ -%% $Id: pst-news21.tex 263 2021-09-24 17:58:30Z herbert $ +%% $Id: pst-news21.tex 382 2021-12-29 19:19:18Z herbert $ \RequirePackage{pdfmanagement-testphase} \DeclareDocumentMetadata{} \documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small, - headinclude=false,footinclude=false,twoside,usegeometry]{pst-doc} + headinclude=false,footinclude=false,twoside,usegeometry,dvipsnames]{pst-doc} \usepackage{libertinus} \usepackage{hvlogos} \listfiles %\usepackage[svgnames,dvipsnames,x11names,pspdf=-dALLOWPSTRANSPARENCY]{pstricks-pdf} -\usepackage{showexpl,pst-arrow} +\usepackage{showexpl,pst-arrow,pst-plot,pst-geometrictools} \lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={},extendedchars}, escapechar=?} @@ -36,6 +36,10 @@ lualatex it uses the OpenType version. The dot part is now in an own file \texttt{pstricks-dots.tex}. + + + + %-------------------------------------------------------------------------------------- \section{\texttt{pstricks.sty}} %-------------------------------------------------------------------------------------- @@ -45,9 +49,99 @@ Otherwise the one from URW or the system is used, which is the default. %-------------------------------------------------------------------------------------- -\section{\texttt{pstricks.tex} (v. 3.08 -- 2021/09/10)} +\section{\texttt{pstricks.tex} (v. 3.12 -- 2021/12/29)} %-------------------------------------------------------------------------------------- + +\subsection{Coordinates} +By default the coordinates \verb|(10,10)| are used if the environment \Lenv{pspicture} +is called without any given coordinates. This behaviour can be changed if you are running +the document with \Lprog{lualatex}. Then you can use the optional argument \Lkeyword{calcframe} +to allow the internal calculation of the box width and height. it needs two \Lprog{lualatex} +runs to get the coordinates. The values are written into a file \verb|\jobname-<No>.psaux| and read +in the next run. + +With the optional argument \Lkeyword{margin} it is possible to add white space to the calculated coordinates. +The keyword must be set with the command \Lcs{psset} \emph{before} the environment \Lenv{pspicture}, otherwise it is too late. + +\begin{itemize} +\item \verb|margin=5mm| will add 5mm on all sides of the box. +\item \verb|margin={5mm,1cm}| will add 5mm on the left side and 1cm on the lower side of the box. +\item \verb|margin={2mm,3,4,5pt}| will add 2mm on the left, 3\Lcs{psunit} at the bottom, 4\Lcs{psunit} on +the right and 5pt on the top of the box. With the optional argument \Lkeyword{showframe} the calculated +box coordinates can be visible. Additional white space is marked by a box with dashed lines. +\end{itemize} + +Without a given unit all values are used with the current defined PSTricks unit. But remember +that this will only work with \Lprog{lualatex}. + +The following example shows the same curve, but with different coordinates. + +\begin{LTXexample}[pos=t,width=\linewidth] +\def\dataV{6.8 -1 5.9 -2 5.4 -3 5.7 -4 6.2 -5} % original +\def\dataW{6.8 4 5.9 3 5.4 2 5.7 1 6.2 0} % x>= 0 +\def\dataU{1.4 4 0.5 3 0 2 0.3 1 0.8 0} % x>=0 und y>=0 +\psset{calcframe,showframe}% must be set before pspicture +X\begin{pspicture}[showgrid] + \listplot[plotstyle=curve, showpoints]{\dataU} \rput(1,-0.5){default dataU} +\end{pspicture}X \hfill X% +\begin{pspicture}[showgrid] + \listplot[plotstyle=curve, showpoints]{\dataW} \rput(6,-0.5){default dataW} +\end{pspicture}X \hfill X% +\begin{pspicture}[showgrid] + \listplot[plotstyle=curve, showpoints]{\dataV} \rput(6,-5.5){default dataV} +\end{pspicture}X + +\vspace{1cm} +X\begin{pspicture}[showgrid,margin=0.5] + \listplot[plotstyle=curve, showpoints]{\dataU} \rput(1,5){margin=0.5} +\end{pspicture}X \hfill X% +\begin{pspicture}[showgrid,margin={0.5,1}] + \listplot[plotstyle=curve, showpoints]{\dataW} \rput(6,4.5){margin={0.5 1}} +\end{pspicture}X \hfill X% +\begin{pspicture}[showgrid,margin={5mm,1,15mm,2}] + \listplot[plotstyle=curve, showpoints]{\dataV} \rput(6,-0.5){margin={5mm,1,15mm,2}} +\end{pspicture}X +\end{LTXexample} + +Only PSTricks objects are taken into account for calculating the bounding box. All stuff +which is placed on \TeX-level like any text with for example \Lcs{rput} cannot not be +used for calculating the correct coordinates. With setting additional whitespace with +the optional argument \Lkeyword{margin} the boxsize can be modified. + +\newpsstyle{Parallelen}{country=G,ProLineCol=cyan,ProFillCol=gray!50, + OwnerTxt=Pythagoras,MadeTxt={Geodreieck},RulerFillCol=cyan!40} +\psscalebox{0.5}{% + \psset{calcframe,margin=5mm}% + \begin{pspicture}[showgrid]% no coordinates are given + \pnode(5,5){A}\uput[90](A){A} + \pnode(-8,1){B}\uput[90](B){B} + \pnode(3,3){C}\uput[250](C){C} + \pcline[linecolor=BrickRed,nodesepA=-2,nodesepB=-2](A)(B) + \psParallels[style=Parallelen,RulerScale=0.75,ProScale=0.75](A)(B)(C) + \pcline[linecolor=BrickRed](GeodrB)(GeodrA)% + \midAB(GeodrB)(GeodrA){M}% + \psPencil[PenLength=5,pencilColA=red,PenScale=0.5]{60}(M) +\end{pspicture}} + + +\begin{lstlisting} +\psscalebox{0.5}{% + \psset{calcframe}% + \begin{pspicture}[showgrid]% no coordinates are given + \pnode(5,5){A}\uput[90](A){A} + \pnode(-8,1){B}\uput[90](B){B} + \pnode(3,3){C}\uput[250](C){C} + \pcline[linecolor=BrickRed,nodesepA=-2,nodesepB=-2](A)(B) + \psParallels[style=Parallelen,RulerScale=0.75,ProScale=0.75](A)(B)(C) + \pcline[linecolor=BrickRed](GeodrB)(GeodrA)% + \midAB(GeodrB)(GeodrA){M}% + \psPencil[PenLength=5,pencilColA=red,PenScale=0.5]{60}(M) +\end{pspicture}} +\end{lstlisting} + + + \subsection{Colors} There are two new macros to get the color values: diff --git a/graphics/pstricks/base/generic/pstricks.tex b/graphics/pstricks/base/generic/pstricks.tex index d98e585069..7e4086edc1 100644 --- a/graphics/pstricks/base/generic/pstricks.tex +++ b/graphics/pstricks/base/generic/pstricks.tex @@ -81,8 +81,8 @@ \fi \let\pgfforeach\foreach % -\def\fileversion{3.11} -\def\filedate{2021/09/27} +\def\fileversion{3.12} +\def\filedate{2021/12/29} \pst@addfams{pstricks} % %\define@boolkey[psset]{pstricks}[Pst@]{useURWfonts}[true]{} @@ -184,7 +184,7 @@ % end bugfix \typeout{`PSTricks' v\fileversion\space\space <\filedate> (tvz,hv)} \def\@pstrickserr#1#2{% - \begingroup + \beging roup \newlinechar`\^^J \edef\pst@tempc{#2}% \expandafter\errhelp\expandafter{\pst@tempc}% @@ -1520,12 +1520,14 @@ \ignorespaces} % \def\pst@code{}% +% \def\init@pscode{% \addto@pscode{% \pst@number\pslinewidth SLW \pst@usecolor\pslinecolor}% } \def\addto@pscode#1{\xdef\pst@code{\pst@code#1\space}} +% \def\use@pscode{% \pstverb{ \pst@dict @@ -4052,7 +4054,9 @@ pop } \define@key[psset]{pstricks}{showgrid}[b]{\expandafter\pst@@showgrid#1!!\@nil} -\psset[pstricks]{showgrid=f} +\define@boolkey[psset]{pstricks}[Pst@]{showframe}[true]{} +\define@boolkey[psset]{pstricks}[Pst@]{calcframe}[true]{} +\psset[pstricks]{showgrid=f,showframe=false,calcframe=false} \define@boolkey[psset]{pstricks}[Pst@]{pgffunctions}[true]{} \psset[pstricks]{pgffunctions=false} @@ -4072,9 +4076,51 @@ pop % %------------------------------- pspicture ------------------------------ % +\def\ps@readmargin#1,#2,#3,#4,#5\@nil{% + \ifx\\#2\\ +% \typeout{>>> Case 1 para}% + \pst@getlength{#1}\ps@margin@left + \let\ps@margin@right\ps@margin@left + \let\ps@margin@top\ps@margin@left + \let\ps@margin@bottom\ps@margin@left + \else + \ifx\\#3\\% +% \typeout{>>> Case 2 para: #1,#2}% + \pst@getlength{#1}\ps@margin@left + \def\ps@margin@right{0}% + \pst@getlength{#2}\ps@margin@bottom + \def\ps@margin@top{0} + \else +% \typeout{>>> Case 4 para: #1,#2,#3,#4}% + \pst@getlength{#1}\ps@margin@left + \pst@getlength{#2}\ps@margin@bottom + \pst@getlength{#3}\ps@margin@right + \pst@getlength{#4}\ps@margin@top + \fi\fi +%\typeout{>>>>>>>>>\ps@margin@left,\ps@margin@bottom,\ps@margin@right,\ps@margin@top}% +}% +\define@key[psset]{pstricks}{margin}[0pt]{\ps@readmargin#1,,,,\@nil} +\psset[pstricks]{margin=0pt} +% +\newcount\ps@imagectr +\ps@imagectr=0 +%\newif\ifPst@findcoor +%\Pst@findcoorfalse +% + \def\pspicture{\begingroup\pst@ifstar\pst@picture} \def\pst@picture{\@ifnextchar[{\pst@@picture}{\pst@@picture[]}} -\def\pst@@picture[#1]{\@ifnextchar({\pst@@picture@i[#1]}{\pst@@picture@i[#1](10,10)}}% +\def\pst@@picture[#1]{\@ifnextchar({\pst@@picture@i[#1]}{\pst@@picture@@i[#1]}}% +\def\pst@@picture@@i[#1]{% + \gdef\pscoor{(10,10)}% + \ifPst@calcframe + \typeout{>>>Check for file \jobname-\the\numexpr\ps@imagectr+1.psaux}% + \IfFileExists{\jobname-\the\numexpr\ps@imagectr+1.psaux}{\input{\jobname-\the\numexpr\ps@imagectr+1.psaux}}{}% + % \typeout{>>>\pscoor}% + \fi + \edef\@temp{[\noexpand#1]\pscoor}% + \expandafter\pst@@picture@i\@temp} +% \def\pst@@picture@i[#1]#2(#3,#4){\@ifnextchar(% ignore anything between [] and () {\pst@@@picture[#1](#3,#4)}% {\pst@@@picture[#1](0,0)(#3,#4)}} @@ -4106,11 +4152,57 @@ pop \ifshowgrid\ifnum\showgridp@s=0\psgrid[style=gridstyle]\fi\fi % ----------- 1.10/12 end hv ------------------- \ignorespaces% % 2008-12-07 + \ifPst@calcframe\pstVerb{ .trackbbox }\global\advance\ps@imagectr by 1 \fi \ifPst@pgffunctions\pstVerb{ pgffunctions }\fi% hv 2013-04-17 } \def\pic@coor{(0,0)(0,0)(10,10)} \def\endpspicture{% + \ifPst@calcframe + \ifPSTlualatex + \pstVerb{ + .trackedbbox % xmin ymin xmax ymax + % Die Koordinaten sind relativ zur Seite, also verschieben wir sie + % zum aktuellen Punkt. + currentpoint matrix translate dup invertmatrix dup 4 1 roll + transform + /YMAX exch def /XMAX exch def + transform + /YMIN exch def /XMIN exch def + % Now we have all absolute coordinates + \ifPst@showframe + % Um jetzt an diesen Koordinaten zu zeichnen, ist das natürlich + % ungünstig und wir müssen zurück schieben... (Oder den Code + % umordnen, aber warum einfach wenns auch kompliziert geht ;P) + XMIN YMIN XMAX XMIN sub YMAX YMIN sub % lower left, width, height + 4 copy + gsave + currentpoint translate newpath rectstroke + newpath 0 0 moveto % x0 y0 x1 y1 + \ps@margin@top\space add \ps@margin@bottom\space add 4 1 roll % y1 x0 y0 x1 + \ps@margin@right\space add \ps@margin@left\space add 4 1 roll % x1 y1 x0 y0 + \ps@margin@bottom\space sub 4 1 roll % y0 x1 y1 x0 + \ps@margin@left\space sub 4 1 roll % x0 y0 x1 y1 + [3 3] 0 setdash rectstroke + grestore + \fi + (\jobname-\the\ps@imagectr.psaux) (w) file /CoorFile exch def + (\\gdef\\pscoor{\string\() CoorFile exch writestring + XMIN \ps@margin@left\space sub 20 string cvs CoorFile exch writestring + (pt, ) CoorFile exch writestring + YMIN \ps@margin@bottom\space sub 20 string cvs CoorFile exch writestring + (pt\string\)\string\() CoorFile exch writestring + XMAX \ps@margin@right\space add 20 string cvs CoorFile exch writestring + (pt, ) CoorFile exch writestring + YMAX \ps@margin@top\space add 20 string cvs CoorFile exch writestring + (pt\string\)}\% ) CoorFile exch writestring + CoorFile closefile + }% + \else + \global\Pst@calcframefalse + \PackageError{PSTricks}{You need to run lualatex for calculating the bounding box or set calcframe=false}{}%\@ehpa + \fi + \fi \ifshowgrid\ifnum\showgridp@s>0 \psgrid[xunit=\sh@wgridXunit,yunit=\sh@wgridYunit,style=gridstyle]\fi\fi \pst@killglue diff --git a/graphics/pstricks/base/latex/pstricks.sty b/graphics/pstricks/base/latex/pstricks.sty index b671da7580..f0062e953c 100644 --- a/graphics/pstricks/base/latex/pstricks.sty +++ b/graphics/pstricks/base/latex/pstricks.sty @@ -1,4 +1,4 @@ -% $Id: pstricks.sty 263 2021-09-24 17:58:30Z herbert $ +% $Id: pstricks.sty 363 2021-12-28 14:08:58Z herbert $ %% %% This is file `pstricks.sty'. %% @@ -17,6 +17,7 @@ \NeedsTeXFormat{LaTeX2e} + \ProvidesPackage{pstricks}[2021/08/23 v0.71 LaTeX wrapper for `PSTricks' (RN,HV)] % \def\documentclass{% diff --git a/graphics/pstricks/contrib/luapstricks/README.md b/graphics/pstricks/contrib/luapstricks/README.md index d7c3278983..69a0174057 100644 --- a/graphics/pstricks/contrib/luapstricks/README.md +++ b/graphics/pstricks/contrib/luapstricks/README.md @@ -8,7 +8,7 @@ Some advanced features require the `pdfmanagement-testphase` package to be loade 1. Make sure that you have the latest pstricks version installed. 2. Run `l3build install` *or* copy `luapstricks.lua` from this repository into the directory of your TeX files or another directory in your TeX search path. 3. Compile your document with `lualatex`. - 4. Given the current state of development of this project, the previous stage probably failed. Write a bug report to the author. Otherwise go to step 7. + 4. Given that most people immediately stop reading after they get a result and you are still here, the previous stage probably failed. Write a bug report to the author. Otherwise go to step 7. 5. Wait for a fix. 6. Go back to step 2 and try again. 7. It worked? That's great. Feel free to inform the author anyway and share the awesome images you created. diff --git a/graphics/pstricks/contrib/luapstricks/luapstricks.lua b/graphics/pstricks/contrib/luapstricks/luapstricks.lua index 7da1c9c133..e505f5458a 100644 --- a/graphics/pstricks/contrib/luapstricks/luapstricks.lua +++ b/graphics/pstricks/contrib/luapstricks/luapstricks.lua @@ -18,8 +18,8 @@ if luatexbase then luatexbase.provides_module { name = 'luapstricks', - version = 'v0.3', - date = '2021-11-12', + version = 'v0.4', + date = '2021-12-29', description = 'PSTricks backend for LuaLaTeX', } end @@ -502,8 +502,16 @@ end local execute_ps, execute_tok local dictionary_stack + +-- About the bbox entry: +-- - If the bounding box is not currently tracked, it is set to nil +-- - Otherwise it's a linked list linked with the .next field. Every entry is a "matrix level" +-- - if .bbox[1] is nil, the current matrix level does not have a set bounding box yet +-- - Otherside it's {min_x, min_y, max_x, max_y} +-- - If a .bbox.matrix entry is present then it describes the matrix which should be applied before the bbox gets added to the next "matrix level" local graphics_stack = {{ matrix = {10, 0, 0, 10, 0, 0}, -- Chosen for consistency with GhostScript's pdfwrite. Must be the same as defaultmatrix + bbox = nil, linewidth = nil, current_path = nil, current_point = nil, @@ -654,6 +662,12 @@ local function flush_delayed_table(delayed, state, force_start) delayed_matrix[5], delayed_matrix[6]) if cm_string == "1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 cm" then cm_string = nil + else + local bbox = state.bbox + if bbox then + state.bbox = { matrix = delayed_matrix, next = bbox } + delayed.matrix = {} -- Will be initialized in reset_delayed + end end -- Before flushing, make sure that the current graphics state has started. @@ -686,6 +700,47 @@ local function flush_delayed(force_start) return flush_delayed_table(delayed, graphics_stack[#graphics_stack], force_start) end +local function register_point_bbox(bbox, x, y) + local min_x, min_y, max_x, max_y = bbox[1], bbox[2], bbox[3], bbox[4] + if min_x then + if x < min_x then + bbox[1] = x + elseif x > max_x then + bbox[3] = x + end + if y < min_y then + bbox[2] = y + elseif y > max_y then + bbox[4] = y + end + else + bbox[1], bbox[2], bbox[3], bbox[4] = x, y, x, y + end +end + +-- Only call after flush_delayed +local function register_point(state, x, y) + local bbox = state.bbox + if not bbox then return end + return register_point_bbox(bbox, x, y) +end + +local function merge_bbox(bbox, after) + if bbox[1] then + local matrix = bbox.matrix + if matrix then + register_point_bbox(after, matrix_transform(bbox[1], bbox[2], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6])) + register_point_bbox(after, matrix_transform(bbox[1], bbox[4], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6])) + register_point_bbox(after, matrix_transform(bbox[3], bbox[2], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6])) + register_point_bbox(after, matrix_transform(bbox[3], bbox[4], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5], matrix[6])) + else + register_point_bbox(after, bbox[1], bbox[2]) + register_point_bbox(after, bbox[3], bbox[4]) + end + end + return after +end + function drawarc(xc, yc, r, a1, a2) a1, a2 = math.rad(a1), math.rad(a2) local dx, dy = r*math.cos(a1), r*math.sin(a1) @@ -876,6 +931,7 @@ local function generic_show(str, ax, ay) local w = 0 if fonttype == 0x1CA then local characters = assert(font.getfont(fid)).characters + local max_d, max_h = 0, 0 flush_delayed() if pdfprint ~= gobble then vf.push() @@ -890,12 +946,29 @@ local function generic_show(str, ax, ay) end end local char = characters[b] - w = w + (char and char.width or 0) + if char then + w = w + (char.width or 0) + if char.depth and char.depth > max_d then + max_d = char.depth + end + if char.height and char.height > max_h then + max_h = char.height + end + end end + w = w/65781.76 if pdfprint ~= gobble then + max_d = max_d/65781.76 + max_h = max_h/65781.76 + register_point(state, 0, -max_d) + if ax then + local count = #str + register_point(state, w + count * ax, max_h + count * ay) + else + register_point(state, w, max_h) + end vf.pop() end - w = w/65781.76 elseif fonttype == 3 then for b in string.bytes(str) do systemdict.value.gsave() @@ -1061,7 +1134,7 @@ systemdict = {kind = 'dict', value = { break end end - if not mark_pos then error'Unmatched mark' end + if not mark_pos then error'unmatchedmark' end local dict = lua.newtable(0, (#operand_stack-mark_pos) // 2) for i = mark_pos + 1, #operand_stack - 1, 2 do push(operand_stack[i]) @@ -1084,14 +1157,14 @@ systemdict = {kind = 'dict', value = { return push(height-i) end end - error'Unmatched mark' + error'unmatchedmark' end, cleartomark = function() local entry repeat entry = pop() until (not entry) or type(entry) == 'table' and entry.kind == 'mark' - if not entry then error'Unmatched mark' end + if not entry then error'unmatchedmark' end end, ['if'] = function() @@ -1316,7 +1389,11 @@ systemdict = {kind = 'dict', value = { local after = node.direct.getnext(n) local head = node.direct.getlist(parent) node.direct.setnext(n, nil) - node.direct.setlist(parent, subbox.box) + node.direct.setlist(parent, n) + local state = graphics_stack[#graphics_stack] + local w, h, d = node.direct.dimensions(n) + register_point(state, 0, -d/65781.76) + register_point(state, w/65781.76, h/65781.76) vf.node(parent) node.direct.setnext(n, after) node.direct.setlist(parent, head) @@ -2234,12 +2311,20 @@ systemdict = {kind = 'dict', value = { local current_path = state.current_path if not current_path then return end current_path[#current_path+1] = 'f*' + flush_delayed() + local x for i = 1, #current_path do - if type(current_path[i]) == 'number' then - current_path[i] = string.format('%.5f', current_path[i]) + local value = current_path[i] + if type(value) == 'number' then + current_path[i] = string.format('%.5f', value) + if x then + register_point(state, x, value) + x = nil + else + x = value + end end end - flush_delayed() pdfprint((table.concat(current_path, ' '):gsub('%.?0+ ', ' '))) state.current_path, state.current_point = nil end, @@ -2248,12 +2333,20 @@ systemdict = {kind = 'dict', value = { local current_path = state.current_path if not current_path then return end current_path[#current_path+1] = 'f' + flush_delayed() + local x for i = 1, #current_path do - if type(current_path[i]) == 'number' then - current_path[i] = string.format('%.5f', current_path[i]) + local value = current_path[i] + if type(value) == 'number' then + current_path[i] = string.format('%.5f', value) + if x then + register_point(state, x, value) + x = nil + else + x = value + end end end - flush_delayed() pdfprint((table.concat(current_path, ' '):gsub('%.?0+ ', ' '))) state.current_path, state.current_point = nil end, @@ -2262,12 +2355,20 @@ systemdict = {kind = 'dict', value = { local current_path = state.current_path if not current_path then return end current_path[#current_path+1] = 'S' + flush_delayed() + local x for i = 1, #current_path do - if type(current_path[i]) == 'number' then - current_path[i] = string.format('%.5f', current_path[i]) + local value = current_path[i] + if type(value) == 'number' then + current_path[i] = string.format('%.5f', value) + if x then + register_point(state, x, value) + x = nil + else + x = value + end end end - flush_delayed() pdfprint((table.concat(current_path, ' '):gsub('%.?0+ ', ' '))) state.current_path, state.current_point = nil end, @@ -2340,6 +2441,9 @@ systemdict = {kind = 'dict', value = { local y = pop_num() local x = pop_num() pdfprint((string.format('%.5f %.5f %.5f %.5f re S', x, y, w, h):gsub('%.?0+ ', ' '))) + local state = graphics_stack[#graphics_stack] + register_point(state, x, y) + register_point(state, x + w, y + h) else error'Unsupported rectstroke variant' end @@ -2356,6 +2460,9 @@ systemdict = {kind = 'dict', value = { local y = pop_num() local x = pop_num() pdfprint((string.format('%.5f %.5f %.5f %.5f re f', x, y, w, h):gsub('%.?0+ ', ' '))) + local state = graphics_stack[#graphics_stack] + register_point(state, x, y) + register_point(state, x + w, y + h) else error'Unsupported rectfill variant' end @@ -2799,7 +2906,8 @@ systemdict = {kind = 'dict', value = { end, gsave = function() - graphics_stack[#graphics_stack+1] = table.copy(graphics_stack[#graphics_stack]) + local bbox = graphics_stack[#graphics_stack].bbox + graphics_stack[#graphics_stack+1] = table.copy(graphics_stack[#graphics_stack], bbox and {[bbox] = {}}) graphics_stack[#graphics_stack].saved_delayed = delayed delayed = { text = {}, @@ -2807,13 +2915,22 @@ systemdict = {kind = 'dict', value = { } end, grestore = function() - local saved_delayed = graphics_stack[#graphics_stack].saved_delayed + local state = graphics_stack[#graphics_stack] + local saved_delayed = state.saved_delayed if saved_delayed then delayed = saved_delayed else pdfprint'Q' reset_delayed(delayed) end + local upper_state = graphics_stack[#graphics_stack-1] + local upper_bbox = upper_state.bbox + if upper_bbox then + local bbox = assert(state.bbox) + while upper_bbox ~= bbox do + bbox = merge_bbox(bbox, bbox.next or upper_bbox) + end + end graphics_stack[#graphics_stack] = nil end, @@ -3364,6 +3481,33 @@ systemdict = {kind = 'dict', value = { end end, + ['.trackbbox'] = function() + local state = graphics_stack[#graphics_stack] + flush_delayed() + state.bbox = { next = state.bbox, start = true } + end, + -- Trackedbbox should only be invoked if the current matrix is essentially the same + -- as in the corresponding .trackbbox, otherwise everything gets messed up. + -- This isn't checked, mostly because we don't want a check to be too sensitive. + ['.trackedbbox'] = function() + local state = graphics_stack[#graphics_stack] + local bbox = state.bbox + if not bbox then + error'trackedbbox without matching trackbbox' + end + while not bbox.start do + if not bbox.next then + error'Illegal nesting of trackbbox/trackedbbox and gsave/grestore' + end + bbox = merge_bbox(bbox, bbox.next) + end + state.bbox = bbox.next and merge_bbox(bbox, bbox.next) + push(bbox[1] or 0) + push(bbox[2] or 0) + push(bbox[3] or 0) + push(bbox[4] or 0) + end, + revision = 1000, ['true'] = true, ['false'] = false, @@ -3726,7 +3870,16 @@ local register_texbox do function register_texbox(box) id = id + 1 box = setmetatable({box = node.direct.todirect(box)}, meta) - local op = function() flush_delayed() vf.push() vf.node(box.box) vf.pop() end + local op = function() + flush_delayed() + local state = graphics_stack[#graphics_stack] + local w, h, d = node.direct.dimensions(box.box) + register_point(state, 0, -d/65781.76) + register_point(state, w/65781.76, h/65781.76) + vf.push() + vf.node(box.box) + vf.pop() + end lua_node_lookup[op] = box dict[id] = op return id @@ -3898,9 +4051,11 @@ local fid = font.define{ TeXDict.ocount = height operand_stack[height + 1], operand_stack[height + 2] = ps_pos_x/65781.76, ps_pos_y/65781.76 ps_pos_x, ps_pos_y = nil + local graphics_height if direct then systemdict.value.moveto() else + graphics_height = #graphics_stack systemdict.value.gsave() systemdict.value.translate() end @@ -3917,6 +4072,16 @@ local fid = font.define{ flush_delayed() if not direct then systemdict.value.grestore() + if graphics_height ~= #graphics_stack then + if graphics_height < #graphics_stack then + texio.write_nl"luapstricks: PS block contains unbalanced gsave. grestore will be executed to compensate." + repeat + systemdict.value.grestore() + until graphics_height == #graphics_stack + else + texio.write_nl"luapstricks: PS block contains unbalanced grestore." + end + end height = TeXDict.ocount or height local new_height = #operand_stack assert(new_height >= height) @@ -3977,7 +4142,8 @@ do local ps_rgb = 'rgb ' * l.C(l.P(1)^0) * l.Cc' setrgbcolor' * l.Cc'rgb ' local ps_cmyk = 'cmyk ' * l.C(l.P(1)^0) * l.Cc' setcmykcolor' * l.Cc'cmyk ' local ps_gray = 'gray ' * l.C(l.P(1)^0) * l.Cc' setgray' * l.Cc'gray ' - local pscolor = ps_rgb + ps_gray + ps_gray + local ps_hsb = 'hsb ' * l.C(l.P(1)^0) * l.Cc' sethsbcolor' * l.Cc'hsb ' + local pscolor = ps_rgb + ps_gray + ps_gray + ps_hsb local pdf_rgb = l.Cmt(l.C(number * whitespace * number * whitespace * number / 0) * whitespace * 'rg' * whitespace * l.C(number * whitespace * number * whitespace * number / 0) * whitespace * 'RG' * -1, function(s, p, a, b) if a == b then diff --git a/graphics/pstricks/contrib/pst-vehicle/Changes b/graphics/pstricks/contrib/pst-vehicle/Changes new file mode 100644 index 0000000000..3fbe838673 --- /dev/null +++ b/graphics/pstricks/contrib/pst-vehicle/Changes @@ -0,0 +1,11 @@ +pst-vehicle.tex ---------------- + +1.3 2021/12/29 - fixes for running with lualatex (hv) + - fix for local use of variables x0->X0 (hv) +1.2 2017/09/16 - node that can be called by name GravC, by default near + center of gravity that can become other coordinates +1.1b 2017/06/23 - file ListVehicle to the right folder +1.1a 2017/06/15 - add missing ListVehicle.tex +1.1 2017/06/05 - fix for constant functions + - add option startPos to have a defined startrotation for the rear-wheel + - synchron start-rotation-position for front- and rear-wheel diff --git a/graphics/pstricks/contrib/pst-vehicle/Changes.txt b/graphics/pstricks/contrib/pst-vehicle/Changes.txt deleted file mode 100644 index 9c2ee14dee..0000000000 --- a/graphics/pstricks/contrib/pst-vehicle/Changes.txt +++ /dev/null @@ -1,13 +0,0 @@ -pst-vehicle.tex ---------------- - -1.2 2017/09/16 -- node that can be called by name GravC, by default near - center of gravity that can become other coordinates -1.1b 2017/06/23 -- file ListVehicle to the right folder -1.1a 2017/06/15 -- add missing ListVehicle.tex -1.1 2017/06/05 -- fix for constant functions -- add option startPos to have a defined startrotation for the rear-wheel -- synchron start-rotation-position for front- and rear-wheel diff --git a/graphics/pstricks/contrib/pst-vehicle/ListVehicles.tex b/graphics/pstricks/contrib/pst-vehicle/ListVehicles.tex deleted file mode 100644 index cb2e8f2c61..0000000000 --- a/graphics/pstricks/contrib/pst-vehicle/ListVehicles.tex +++ /dev/null @@ -1,470 +0,0 @@ -%% -%% This is file `ListVehicles.tex', -%% -%% IMPORTANT NOTICE: -%% -%% Package `pst-vehicle.tex' -%% -%% Thomas Söll -%% with the collaboration of -%% Juergen Gilg -%% Manuel Luque -%% -%% This program can redistributed and/or modified under %% -%% the terms of the LaTeX Project Public License %% -%% Distributed from CTAN archives in directory %% -%% macros/latex/base/lppl.txt; either version 1.3c of %% -%% the License, or (at your option) any later version. %% -%% -%% DESCRIPTION: -%% `pst-vehicle' is a PSTricks package -%% -%% -\newpsstyle{segway}{rB=1.4,backwheel=\segWheel} -\newpsstyle{unicycle}{rB=1.6,backwheel=\SpokesWheelB} -\newpsstyle{tractor}{d=4,rB=1.4,rF=1.0} -\newpsstyle{truck}{backwheel=\TruckWheel,frontwheel=\TruckWheel,d=6.28,rB=1.9,rF=1.9} -\newpsstyle{bike}{backwheel=\SpokesWheelB,frontwheel=\SpokesWheelB,d=5.8,rB=1.6,rF=1.6} -%\wheelA,\wheelB,\wheelC,\segWheel,\arrowWheel,\TruckWheel,\TractorFrontWheel,\TractorRearWheel,\SpokesWheelCrossed,\SpokesWheelA -\def\Bike{% ------------------------------ Vehicle Nr. 1: normal bike ---------------------------- -\rput{!phiB}(0,0){% ------------ backwheel --- Hinterrad -\pst@backwheel -}% -\rput{!phiF}(!/rB rF def AF1x AF1y){%------ frontwheel --- Vorderrad -\pst@frontwheel -}% -\rput(!0 rB neg){% -\psline[linewidth=3pt](2.5,1.95)(0,1.7)% -\psline[linewidth=3pt](2.5,1.25)(0,1.45)% -\rput{!phiB Gang div}(!2.5 rB){% Kurbel -\pscircle*(0,0){0.4}% -\psline[linewidth=4pt](-0.3,-0.9)(0.3,0.9)% -\rput{!phiB Gang div neg}(-0.3,-0.9){\psline[linewidth=4pt](0,0)(-0.3,0)}% -\rput{!phiB Gang div neg}(0.3,0.9){\psline[linewidth=4pt](0,0)(0.3,0)}% -}% -\psline[linewidth=5pt](5.8,1.6)(4.75,4.85)(3.8,4.85)% -\psline[linewidth=5pt](0,1.6)(2.5,1.6)(5.2,3.65)% -\psline[linewidth=5pt](0,1.6)(1.6,4.05)(5,4.05)% -\psline[linewidth=5pt](2.5,1.6)(1.5,4.45)% -\psline[linewidth=7pt](0.8,4.45)(2,4.45)% -\pspolygon[linecolor=\pslinecolor,fillstyle=solid,fillcolor=\pslinecolor](5.05,3.85)(5.65,4.1)(5.65,3.6)% -}% -}% -\def\HighWheeler{% ------------------------------ Vehicle Nr. 2: high wheeler -- Hochrad Nr 2 ---------- -%------ pedal behind the frontwheel -- Pedal hinter dem Rad --------------------------------------- -\rput{!phiF 5 mul Gang div}(!AF1x AF1y){% -\psline[linewidth=3pt,border=0.5pt,bordercolor=white](0,0)(1.15;135) -\rput{!phiF 5 mul Gang div 180 add neg}(1.11;135){\pspolygon*[linearc=0.08,border=0.5pt,bordercolor=white]% -(-0.25,0.06)(-0.1,0.08)(-0.08,0.16)(0.08,0.16)(0.1,0.08)(0.25,0.06)% -(0.25,-0.06)(0.1,-0.08)(0.08,-0.16)(-0.08,-0.16)(-0.1,-0.08)(-0.25,-0.06)} -\pscircle[linewidth=0.75pt,dimen=outer,linecolor=white](1.1;135){0.075} -}% -%-------------------------------------------------------------------------------------------- -\rput{!phiF}(!AF1x AF1y){% % frontwheel ----- Vorderrad -\multido{\iA=0+10}{36}{% -\rput(0,0){\psline[linewidth=0.7pt,border=0.35pt,bordercolor=white](0,0)(!rF \iA\space PtoC)}% -} -\pscircle[linewidth=7.5pt,dimen=outer](0,0){!rF}% -\pscircle[linewidth=0.6pt,dimen=outer,linecolor=white](0,0){!rF 0.955 mul}% -\pscircle*(0,0){0.3}% -\pscircle*[linecolor=white](0,0){0.2}% -\pscircle*(0,0){0.14}% -}% -%------------------------------------------------------------------------------------------------- -%-------------------------------------------------------------------------------------------- -\rput{!phiF}(!AF1x AF1y){% -\pscircle*(0,0){0.14}% -\pscircle[linewidth=0.6pt,linecolor=white](0,0){0.07} -}% -%-------------------------------------------------------------------------------------------------- -\rput{!phiB}(0,0){% backwheel ------ Hinterrad -\multido{\iA=0+24}{15}{% -\rput(0,0){\psline[linewidth=0.7pt,border=0.35pt,bordercolor=white](0,0)(!rB \iA\space PtoC)}% -}% -\pscircle[linewidth=4.3pt,dimen=outer](0,0){!rB}% -\pscircle[linewidth=0.6pt,dimen=outer,linecolor=white](0,0){!rB 0.91 mul}% -\pscircle*[linewidth=0.5pt](0,0){0.14}% -}% -%-------- front to back connection -- Verbindung vordere Gabel zur Hinterachse ---------------------- -\rput(!AF1x AF1y){\pnode(!rF 1.06 mul 170 PtoC){ZA}}% -\let\myfillcolor\pslinecolor -\rput(!AF1x AF1y){% -\pscustom[linewidth=0.4pt,linecolor=white,fillstyle=solid,fillcolor=\myfillcolor]{% -\parametricplot[linewidth=0.5pt]{88}{10}{-(rF+0.36)*cos(Pi*t/180)|(rF+0.36)*sin(Pi*t/180)}% -\psarc(!AF1x 0.1 sub neg AF1y 0.03 add neg){0.08}{200}{300} -\parametricplot[linewidth=0.5pt]{10}{88}{-(rF+0.08-(t-100)*0.0353*2.5/78)*cos(Pi*t/180)|(rF+0.08-(t-100)*0.0353*2.5/78)*sin(Pi*t/180)} -\closepath -}% -}% -\rput(0,0){% -\pscircle[linestyle=none,fillstyle=solid,fillcolor=\pslinecolor](0,0){0.08}% -\pscircle[linewidth=0.9pt,linecolor=white](0,0){0.08}} -%-------------------------------------------------------------------------------------------------- -%-------front part and handle bar --- Vordere Gabel und Lenker ------------------------------------------- -\rput{1.5}(!AF1x AF1y){% -\psline[linewidth=5.5pt,border=0.5pt,bordercolor=white](0,0.1)(!0 rF 1.265 mul)% -\pscircle*[linewidth=0.6pt](!0 rF 1.28 mul){0.075}% -\psline[linewidth=5.5pt,linecolor=white](!0 rF 1.265 mul)(!0 rF 1.27 mul) -\psline[linewidth=3pt,linearc=0.02](!0 rF 1.24 mul)(!0.193 rF 1.24 mul)(!0.33 rF 1.31 mul)(!0.38 rF 1.31 mul) -\psline[linewidth=4.7pt,linearc=0.02,linecap=1,border=0.5pt,bordercolor=white](!0.42 rF 1.32 mul)(!0.455 rF 1.22 mul) -\pscircle*[linewidth=0.6pt](!0.455 rF 1.223 mul){0.145}% -\pscircle[linecolor=white,linewidth=0.5pt](!0.455 rF 1.223 mul){0.085}% -\pscircle[linecolor=white,linewidth=0.65pt](!0.455 rF 1.223 mul){0.15}% -\psline[linewidth=5.5pt,linecolor=white](!0 rF 1.208 mul)(!0 rF 1.211 mul) -\psline[linewidth=8.5pt](!0 rF 1.186 mul)(!0 rF 1.208 mul) -\psline[linewidth=5.5pt,linecolor=white](!0 rF 1.183 mul)(!0 rF 1.186 mul) -}% -%-------------------------------------------------------------------------------------------------- -%--------- pedal in front of the frontwheel --- Pedal vor dem Rad --------------------------------------------------------------- -\rput{!phiF 5 mul Gang div 180 add}(!AF1x AF1y){% -\psline[linewidth=3pt,border=0.5pt,bordercolor=white](0.12;135)(1.15;135) -\rput{!phiF 5 mul Gang div 180 add neg}(1.11;135){\pspolygon*[linearc=0.08,border=0.5pt,bordercolor=white]% -(-0.25,0.06)(-0.1,0.08)(-0.08,0.16)(0.08,0.16)(0.1,0.08)(0.25,0.06)% -(0.25,-0.06)(0.1,-0.08)(0.08,-0.16)(-0.08,-0.16)(-0.1,-0.08)(-0.25,-0.06)} -\pscircle[linewidth=0.75pt,dimen=outer,linecolor=white](1.1;135){0.075} -\psline[linewidth=3pt](0,0)(0.12;135) -\pscircle[linecolor=white,linewidth=0.3pt](0,0){0.065}% -} -%--------------------------------------------------------------------------------- -\rput(2,5.87){% -%--------- special garniture frontwheel ---- Geschweifte Linie am Vorderrad ------------------------------------------------------- -\rput(0,0){% -\pscustom[linewidth=1pt]{% -\psarc(3.16,1.53){0.1}{0}{180} -\psbezier(3.06,1.2)(3.2,1.05)(3.5,1.05) -\psbezier(3.63,1.05)(3.6,1.16)(3.53,1.17) -}% -\pscircle*[linewidth=0.6pt](3.2,1.5){0.075}% -\psellipse*[rot=0,linewidth=0.6pt](3.47,1.15)(0.085,0.05)% -}% -%------------ part of saddle ------ Sattelhalterung ----------------------------------------------------------- -\pscircle*[linewidth=0.6pt](2.63,1.6){0.068}% -\rput(0,0){% -\pscustom[showpoints=true,linewidth=1pt]{% -\psarcn(2.66,1.63){0.097}{235}{10} -\psbezier(2.8,1.3)(2.1,1.32)(1.4,1.32) -\psbezier(1.1,1.32)(0.9,1.1)(0.82,1) -\psbezier(0.74,0.9)(0.6,0.54)(0.3,0.54) -\psbezier(0.15,0.54)(0.17,0.7)(0.17,0.7) -\psarcn(0.31,0.7){0.14}{180}{0} -\psbezier(0.44,0.61)(0.34,0.61)(0.32,0.61) -}% -\pscircle*[linewidth=0.6pt](0.33,0.673){0.075}% -}% -\rput(0,0){% -\pscustom[showpoints=true,linewidth=1pt]{% -\psbezier(0.35,0.53)(0.3,0.45)(0.1,0.48)(0.1,0.4) -\psbezier(0.1,0.31)(0.18,0.345)(0.19,0.39) -}% -\psellipse*[rot=50,linewidth=0.6pt](0.2,0.4)(0.055,0.03)% -}% -%------------------------------------------------------------------------------------------------------- -%------------------ saddle ----- Sattel ---------------------------------------------------------------- -\rput(0,0){% -\pscustom[showpoints=true,linewidth=0.4pt,fillstyle=solid,fillcolor=\pslinecolor]{% -\psbezier(1.34,1.25)(1.42,1.25)(1.43,1.25)(1.58,1.25) -\psbezier(1.58,1.35)(1.62,1.38)(1.65,1.4)% <<----- Start the white line -- Startpunkt für die weiße Linie -\psbezier(1.7,1.37)(1.8,1.38)(1.91,1.38) -\psbezier(1.98,1.38)(2.35,1.48)(2.35,1.55) -\psbezier(2.35,1.59)(2.2,1.6)(2.15,1.6) -\psbezier(2.05,1.6)(1.8,1.55)(1.74,1.55) -\psbezier(1.56,1.55)(1.41,1.75)(1.1,1.75) -\psbezier(0.9,1.75)(0.79,1.65)(0.79,1.59) -\lineto(0.835,1.59) -\psbezier(0.83,1.5)(1.12,1.45)(1.2,1.42) -\psbezier(1.25,1.4)(1.34,1.38)(1.34,1.25) -\closepath -}% -\psbezier[linecolor=white,linewidth=0.6pt](0.8,1.584)(1.1,1.75)(1.4,1.58)(1.67,1.38) -}% -}}% -\def\Truck{% \psset{radH=1.9,radV=1.9,d=6.28,vehicle=\Truck,ownvehicle=\ownTestB,frontwheel=\segWheel,backwheel=\segWheel} -% ------------------------------ Vehicle Nr. 3: truck ----------------------------------- -\rput(0,-2){% -\pscustom[linecolor=blue,fillstyle=solid,fillcolor=blue!20]{% -\psline(8.6,2)(8.38,2) -\psarc(6.28,2){2.1}{0}{180} -\psline(4.18,2)(2.1,2) -\psarc(0,2){2.1}{0}{180} -\psline(-2,2)(-2.2,2) -\moveto(-2.2,2) -\psline[linearc=0.2](-2.2,4.4)(2.5,4.4)(2.5,6)(4.4,6)(5.2,4.4)(7.8,4)(8.6,2) -\moveto(4.2,5.7) -\pspolygon[linearc=0.1](4.4,5.7)(2.8,5.7)(2.8,4.2)(5.1,4.2) -}% -\pswedge[fillstyle=solid,fillcolor=gray!20](6.28,2){2.1}{0}{180} -\pswedge[fillstyle=solid,fillcolor=gray!20](0,2){2.1}{0}{180} -\psarc[doubleline=true,doublecolor=blue!50](0,2){2.1}{0}{180} -\psarc[doubleline=true,doublecolor=blue!50](6.28,2){2.1}{0}{180} -% le phare -\pswedge[linecolor=blue,fillstyle=solid,fillcolor=blue!20](8.65,3){0.4}{90}{270} -% le conducteur -\pstVerb{% - /r1 0.4 def - /a1 -50 def - /b1 50 def -% r2=r1*sqrt(2-sin(2*a1)) - /r2 r1 2 1 a1 cos sub mul sqrt mul def - /b2 a1 sin neg 1 a1 cos sub atan def -}% -\rput(3.8,4.6){ -\pscustom[fillstyle=solid,fillcolor={[RGB]{253 191 183}}]{\psarc(0,0){!r1}{20}{-20} - \psarc(!r1 0){0.075}{-90}{90} - \closepath} -\psarcn(!r1 0){!r2}{!b2 180 add}{!b2 180 add b1 sub} -\pscircle*(0.2,0.1){0.05} -\psarc(0.2,0.1){0.1}{60}{130} -\psarc(-0.1,0){0.1}{120}{240} -\pscustom[fillstyle=solid,fillcolor=red]{\psarc(0,0){!r1}{60}{160}\closepath} -\pcline[nodesepB=1](!r1 60 cos mul r1 60 sin mul)(!r1 160 cos mul r1 160 sin mul)} -}% -\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad -\pst@backwheel -}% -\rput{!phiF}(!/rB rF def AF1x AF1y){%----- frontwheel --- Vorderrad -\pst@frontwheel -}% -}% - -%%%%%%%%%% Le tracteur %%%%%%%%%%%% -\definecolor{couleurtracteur}{RGB}{130 196 108} -\def\Tractor{% le tracteur seul -\psset{fillcolor=couleurtracteur} -\pscustom[fillstyle=solid]{% -\psline(!rB 160 cos mul rB 160 sin mul)(!rB 1.25 mul 160 cos mul rB 1.25 mul 160 sin mul)(-0.8,1.6)(1.2,1.5)(1.7,0.6)(1.7,0)(! rB 0) -\psarc(0,0){!rB}{0}{160} -\closepath} -\pscustom[fillstyle=solid]{ -\psline(1.4,1.14)(1.7,0.6)(1.7,-0.6)(2.4,-0.6)(2.4,-0.4)(3,-0.4) -\psarcn(!dA12 rF rB sub){!rF}{180}{126.87} -\psline(!dA12 rF 126.87 cos mul add rF rB sub rF 126.87 sin mul add)(2.4,0.4)(2.4,1.6)(2,1.14)(1.4,1.14) -\closepath} -\psline[linecolor=blue](2.4,1.6)(2,2.8)(0.4,2.8)(0.2,1.55) -\pscustom[fillstyle=solid]{% -\psline(2,2.8)(0.4,2.8)(0.2,1.55)(-0.2,1.57)(0.2,3.1)(1.932,3.004) -\closepath} -\pscustom[fillstyle=solid]{% -\psline(!dA12 rF 126.87 cos mul add rF rB sub rF 126.87 sin mul add)(2.4,0.4)(2.4,1.6)(4,1.4)(!dA12 rF 80 cos mul add rF rB sub rF 80 sin mul add) -\psarc(!dA12 rF rB sub){!rF}{80}{126.87} -\closepath} -\pscustom[fillstyle=solid]{% -\psline(3.9,1.43)(3.9,1.8)(3.7,1.8)(3.7,1.4555) -\closepath} -\pspolygon[fillstyle=solid,fillcolor=magenta](4,1.8)(3.6,1.8)(3.8,2) -\psline(2.4,-0.4)(1.7,-0.4) -\psdiamond[linejoin=1,fillstyle=solid,fillcolor=lightgray,doubleline](2.55,1)(0.12,0.2) -\rput(3.3,1){\textsf{\textbf{Renault}}}% -\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad -%\pst@backwheel -\TractorRearWheel -}% -\rput{!phiF}(!AF1x AF1y){%----- frontwheel --- Vorderrad -%\pst@frontwheel -\TractorFrontWheel -}% -} - -\def\Segway{% ------------------------------ Vehicle Nr. 4: Segway ----------------------------------- -\rput{!gamma neg}(0,0){% -\psframe*(-0.6,1)(0.2,4.5) -\rput{-10}(-0.8,0){\psframe*[framearc=0.6](-0.9,4.3)(0.4,7.4)} -\pscircle*(0.3,8.2){0.78} -\psline[linewidth=7pt](1,0.5)(2.1,5.2) -%% ARM -\psline[linewidth=12pt](2.1,5.4)(0.6,5.8)(0.2,6.8) -\pscircle*(2.1,5.4){0.3} -\pscircle[linecolor=white](2.1,5.4){0.25} -\psarc[linewidth=5pt](0,0){1.55}{0}{180} -%% la ROUE -}% -\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad -\pst@backwheel -}% -}% - -\def\UniCycle{% ------------------------------ Vehicle UniCycle ----------------------------------- -\rput{!gamma neg}(0,0){% -\rput{!phiB 180 add}(0,0){%!phiB -\rput{!phiB 180 add neg}(0,1){\psframe*[linecolor=black!80,framearc=0.15,linestyle=none,linewidth=0pt](-0.25,-0.1)(0.25,0.1)}%!phiB neg -\pscustom[linecolor=black!80,linewidth=0.015,fillstyle=solid,fillcolor=black!60]{% -\psarc(0,1){0.11}{0}{180} -\psbezier(-0.11,0.95)(-0.08,0.8)(-0.08,0.7) -\lineto(-0.08,0.4) -\psbezier(-0.08,0.25)(-0.12,0.05)(-0.12,0) -\psarc(0,0){0.12}{180}{0} -\psbezier(0.12,0.05)(0.08,0.25)(0.08,0.4) -\lineto(0.08,0.7) -\psbezier(0.08,0.8)(0.11,0.95)(0.11,1) -\closepath -}% -\pscircle[linecolor=black!90,linewidth=0.015](0,1){0.09}% -\pscircle*[linecolor=black](0,1){0.02} -} -\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad -\pst@backwheel -}% -%--- Gabel nach oben und Sattel -\rput{0}(0,0){%!gamma neg -\psframe*[linecolor=black!80,framearc=0.1,linestyle=none,linewidth=0pt](-0.085,2.9)(0.085,4) -\psframe*[linecolor=black!90,framearc=0.1,linestyle=none,linewidth=0pt](-0.1,1.9)(0.1,3) -\psframe*[linecolor=black,framearc=0.1,linestyle=none,linewidth=0pt](-0.16,2.85)(0.12,3.05) -\psframe*[linecolor=black!80,framearc=0.15,linestyle=none,linewidth=0pt](-0.12,0)(0.12,2) -%------------ Sattel ---------------------- -\pspolygon[fillstyle=solid,fillcolor=black!90,linearc=0.1,linestyle=none](-0.7,4)(1,4)(1,4.4)(0.6,4.35)(-0.2,4.35)(-0.7,4.4) -}% -%Pedale vorne -\rput{!phiB}(0,0){%!phiB -\pscustom[linecolor=black!80,linewidth=0.015,fillstyle=solid,fillcolor=black!60]{% -\psarc(0,1){0.11}{0}{180} -\psbezier(-0.11,0.95)(-0.08,0.8)(-0.08,0.7) -\lineto(-0.08,0.4) -\psbezier(-0.08,0.25)(-0.12,0.05)(-0.12,0) -\psarc(0,0){0.12}{180}{0} -\psbezier(0.12,0.05)(0.08,0.25)(0.08,0.4) -\lineto(0.08,0.7) -\psbezier(0.08,0.8)(0.11,0.95)(0.11,1) -\closepath -}% -\rput{!phiB neg}(0,1){\psframe*[linecolor=black!80,framearc=0.15,linestyle=none,linewidth=0pt](-0.25,-0.1)(0.25,0.1)}%!phiB neg -\pscircle[linecolor=black!60,linewidth=0.015](0,1){0.09}% -\pscircle*[linecolor=black](0,1){0.02} -\pscircle[linecolor=black,linewidth=0.015](0,0){0.1}% -\pscircle*[linecolor=black](0,0){0.02} -}% -}% -}% - -\def\SelfDefinedVehicle{% ------------- Vehicle Nr. 5: self defined vehicle -- Eigenes Fahrzeug Nr 5 -\pst@ownvehicle -\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad -\pst@backwheel -}% -\rput{!phiF}(!/rB rF def AF1x AF1y){%----- frontwheel --- Vorderrad -\pst@frontwheel -}% -}% - -\def\wheelA{% -\multido{\iA=0+36}{10}{% -\rput(0,0){\psline[linewidth=2pt](0,0)(!rB \iA\space PtoC)}% -}% -\pscircle[linewidth=5pt,dimen=outer](0,0){!rB}% -\pscircle*(0,0){0.25}% -}% - -\def\wheelB{% -\multido{\iA=0+36}{10}{% -\definecolor[ps]{couleurrayons}{hsb}{\iA\space 360 div 1 1 }% -\rput(0,0){\psline[linecolor=couleurrayons,linewidth=2pt](0,0)(!rB 0.9 mul \iA\space PtoC)} -}% -\pscircle[linewidth=5pt,dimen=outer](0,0){!rB}% -\pscircle*(0,0){0.25}% -}% - -\def\wheelC{% -\pscircle[fillstyle=solid,fillcolor=gray!20,dimen=outer](0,0){!rB}% -\multido{\iA=0+36}{10}{% -\definecolor[ps]{couleurrayons}{hsb}{\iA\space 360 div 1 1 }% -\rput(0,0){\psline[linecolor=couleurrayons,linewidth=2pt](0,0)(!rB 0.9 mul \iA\space PtoC)} -}% -\pscircle[linewidth=15pt,dimen=outer](0,0){!rB}% -\pscircle*(0,0){0.25}% -}% - -\def\wheelD{% -\multido{\iA=0+36}{10}{% -\definecolor[ps]{couleurrayons}{hsb}{\iA\space 360 div 1 1 }% -\rput(0,0){\psline[linecolor=couleurrayons,linewidth=1pt](0,0)(!rB \iA\space PtoC)} -}% -\pscircle[linewidth=1pt,dimen=outer](0,0){!rB}% -\pscircle*(0,0){0.1}% -} - -\def\arrowWheel{% -\pscircle*(0,0){!rB} -\pscircle*[linecolor=white](0,0){0.2} -\multido{\iA=0+30}{12}{% -\psline[linecolor=white](0,0)(!rB 0.7 mul \iA\space PtoC) -}% -\pscircle[linecolor=white,linewidth=2pt](0,0){!rB 0.7 mul} -\psline[linecolor=magenta,linewidth=1.5pt]{->}(0,0)(!rB -90 PtoC) -}% - -\def\TruckWheel{% -\pscircle*(0,0){!rB} -\pscircle*[linecolor=white](0,0){0.2} -\multido{\iA=0+30}{12}{% -\psline[linecolor=white](0,0)(!rB 0.65 mul \iA\space PtoC) -}% -\pscircle[linecolor=white,linewidth=2pt](0,0){!rB 0.65 mul} -}% - -\def\segWheel{% -\pscircle*(0,0){!rB} -\pscircle*[linecolor=white](0,0){0.2} -\multido{\iA=0+30}{12}{% -\psline[linecolor=white](0,0)(!rB 0.9 mul \iA\space PtoC) -}% -\pscircle[linecolor=white,linewidth=2pt](0,0){!rB 0.9 mul} -}% - -\def\SpokesWheelCrossed{ -\multido{\iM=0+40,\iJ=60+40}{10}{\psline[linewidth=0.1](!rB 0.16 mul \iM\space PtoC)(!rB \iJ\space PtoC) - \psline[linewidth=0.1](!rB 0.16 mul \iM\space PtoC)(!rB \iJ\space 10 add PtoC)} -\pscircle[fillstyle=solid,fillcolor=white,linewidth=0.1]{!rB 0.16 mul 0.2 add} -\multido{\i=0+40}{9}{\pscircle[linestyle=dashed,linecolor=gray!50](!rB 0.16 mul \i\space PtoC){! 0.1 rB 0.16 mul mul} - \pscircle*(!rB 0.16 mul \i\space 20 add PtoC){! 0.1 rB 0.16 mul mul}} -\multido{\iM=20+40,\iJ=-30+40}{10}{\psline[linewidth=0.1](!rB 0.16 mul \iM\space PtoC)(!rB \iJ\space PtoC) - \psline[linewidth=0.1](!rB 0.16 mul \iM\space PtoC)(!rB \iJ\space 10 sub PtoC)} -\pscircle[dimen=outer,linewidth=0.5,linecolor=black!90]{!rB}% -\pscircle[dimen=outer,linewidth=0.1,linecolor=white]{!rB 0.3 sub}% -} - -\def\SpokesWheelA{ -\multido{\iM=0+40,\iJ=60+40}{10}{\psline[linewidth=0.025](!rB 0.1 mul \iM\space PtoC)(!rB \iJ\space PtoC) - \psline[linewidth=0.025](!rB 0.1 mul \iM\space PtoC)(!rB \iJ\space 10 add PtoC)} -\pscircle[fillstyle=solid,fillcolor=white,linewidth=0.025]{!rB 0.1 mul 0.1 add} -\multido{\i=0+40}{9}{\pscircle[linewidth=0.025,linecolor=gray!50](!rB 0.1 mul \i\space PtoC){! 0.03 rB 0.16 mul mul} - \pscircle*[linewidth=0.025](!rB 0.1 mul \i\space 20 add PtoC){! 0.03 rB 0.16 mul mul}} -\multido{\iM=20+40,\iJ=-30+40}{10}{\psline[linewidth=0.025](!rB 0.1 mul \iM\space PtoC)(!rB \iJ\space PtoC) - \psline[linewidth=0.025](!rB 0.1 mul \iM\space PtoC)(!rB \iJ\space 10 sub PtoC)} -\pscircle[dimen=outer,linewidth=0.2,linecolor=black!90]{!rB}% -\pscircle[dimen=outer,linewidth=0.02,linecolor=white]{!rB 0.15 sub}% -} - -\def\SpokesWheelB{ -\multido{\iM=0+40,\iJ=60+40}{10}{\psline[linewidth=0.015,linecolor=black!80](!rB 0.11 mul \iM\space PtoC)(!rB \iJ\space PtoC) - \psline[linewidth=0.015,linecolor=black!80](!rB 0.11 mul \iM\space PtoC)(!rB \iJ\space 10 add PtoC)} -\pscircle[fillstyle=solid,fillcolor=white,linewidth=0.025,linecolor=black!80]{!rB 0.11 mul 0.06 add} -\multido{\i=0+40}{9}{\pscircle[linewidth=0.01,linecolor=black!50](!rB 0.11 mul \i\space PtoC){! 0.09 rB 0.16 mul mul} - \pscircle*[linewidth=0.01,linecolor=black](!rB 0.11 mul \i\space 20 add PtoC){! 0.09 rB 0.16 mul mul}} -\multido{\iM=20+40,\iJ=-30+40}{10}{\psline[linewidth=0.015,linecolor=black!80](!rB 0.11 mul \iM\space PtoC)(!rB \iJ\space PtoC) - \psline[linewidth=0.015,linecolor=black!80](!rB 0.11 mul \iM\space PtoC)(!rB \iJ\space 10 sub PtoC)} -\psline[linewidth=0.04,linecolor=black!90](!rB 0.3 sub -85 PtoC)(!rB 0.4 sub -85 PtoC)% -\psline[linewidth=0.048,linecolor=black!90](!rB 0.4 sub -85 PtoC)(!rB 0.44 sub -85 PtoC)% -\pscircle[dimen=outer,linewidth=0.3,linecolor=black!90]{!rB}% -\pscircle[dimen=outer,linewidth=0.09,linecolor=gray!20]{!rB 0.18 sub}% -} - -\def\TractorFrontWheel{% -\pscircle*(0,0){0.25}% -% 0.5=rF/2 0.2=rF/5 -\pscircle[linewidth=0.5,dimen=outer](0,0){!rF} -\multido{\iA=0+36}{10}{% -\psline[linewidth=2pt,linecolor=red](0,0)(!rF 2 div \iA\space PtoC)(!rF \iA\space PtoC)}% -\pscircle[dimen=outer,linewidth=0.3,linecolor={[rgb]{0.95 0.95 0}}](0,0){!rF 2 div} -\pscircle(0,0){!rF 5 div} -\multido{\iA=0+36}{10}{% -\psline[linewidth=2pt](0,0)(!rF 2 div \iA\space PtoC)}% -}% -\def\TractorRearWheel{% -\pscircle*(0,0){0.25}% -% 0.7=rB/2 0.28=rb/5 -\pscircle[linewidth=0.7,dimen=outer](0,0){!rB} -\multido{\iA=0+36}{10}{% -\psline[linewidth=2pt,linecolor=red](0,0)(!rB 2 div \iA\space PtoC)(!rB \iA\space PtoC)}% -\pscircle[dimen=outer,linewidth=0.42,linecolor={[rgb]{0.95 0.95 0}}](0,0){!rB 2 div} -\pscircle(0,0){!rB 5 div} -\multido{\iA=0+36}{10}{% -\psline[linewidth=2pt](0,0)(!rB 2 div \iA\space PtoC)}% -}% diff --git a/graphics/pstricks/contrib/pst-vehicle/README.md b/graphics/pstricks/contrib/pst-vehicle/README.md index b2020233db..04bf8fe1f9 100644 --- a/graphics/pstricks/contrib/pst-vehicle/README.md +++ b/graphics/pstricks/contrib/pst-vehicle/README.md @@ -1,11 +1,33 @@ -The pst-vehicle package Author: J. Gilg, M. Luque, T. Söll +# pst-vehicle: creating vehicles for physical animations -Dated: 2017/09/16 Version 1.2 +This package was created to illustrate the notion of slope, the coefficient +of the tangent line at a point of a curve. On the road, a rampant way or a +dangerous descent due to their slope is indicated by a sign showing the +percentage of the slope of this section of road, for example 10%. -pst-vehicle contains the following: +It was therefore quite obvious that the idea of representing a vehicle rolling +without slipping on a curve came into our minds. Different types of vehicles +are proposed, the shape of the curve is to be defined by its equation: $y=f(x)$ +in algebraic notation. -1) pst-vehicle.sty -2) pst-vehicle.tex -3) ListVehicles.tex (in the same folder as pst-vehicle.tex) +Save the files pst-vehicle.sty|data|tex in a directory, which is part of your +local TeX tree. The pro file should go into $TEXMF/dvips/pstricks/ +Then do not forget to run texhash to update this tree. -T. Söll +pst-vehicle needs pstricks, which should be part of your local TeX installation, +otherwise get it from a CTAN server, https://mirror.ctan.org + +PSTricks is PostScript Tricks, the documentation cannot be run +with pdftex, use the sequence latex->dvips->ps2pdf or +pdflatex with package auto-pst-pdf or xelatex or (best) lualatex + +This program can redistributed and/or modified under %% +the terms of the LaTeX Project Public License %% +Distributed from CTAN archives in directory %% +macros/latex/base/lppl.txt; either version 1.3c of %% +the License, or (at your option) any later version. %% + +Thomas Söll +Bugs: hvoss@tug.org + +%% $Id: README.md 819 2018-09-26 06:40:48Z herbert $ diff --git a/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc-fr.pdf b/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc-fr.pdf Binary files differnew file mode 100644 index 0000000000..06cfea8d83 --- /dev/null +++ b/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc-fr.pdf diff --git a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc-fr.tex b/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc-fr.tex index 44aa52ea56..df6064298a 100644 --- a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc-fr.tex +++ b/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc-fr.tex @@ -1,22 +1,17 @@ -%% $Id: pst-pers-doc.tex 2017-04-05 Jürgen, Thomas $ -\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,fleqn, - smallheadings, headexclude,footexclude,oneside,dvipsnames,svgnames,x11names]{pst-doc} -%\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings -% headexclude,footexclude,oneside,dvipsnames,svgnames,distiller]{pst-doc} -\usepackage[utf8]{inputenc} +%% $Id: pst-vehicle-doc-fr.tex 376 2021-12-29 12:28:42Z herbert $ +\RequirePackage{pdfmanagement-testphase} +\DeclareDocumentMetadata{} +% +\documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small, + headinclude=false,footinclude=false,oneside]{pst-doc} \listfiles \usepackage[autostyle]{csquotes} \usepackage{biblatex}%\usepackage[style=dtk]{biblatex} \addbibresource{pst-vehicle-doc.bib} -\usepackage[utf8]{inputenc} %\let\pstpersFV\fileversion \usepackage[e]{esvect} % für schönere Vektorpfeile \usepackage{pst-vehicle,pst-eucl,pstricks-add,animate} \let\belowcaptionskip\abovecaptionskip - -\usepackage{etex} % um die Anzahl der Register zu erhöhen (sonst nur 256) - - \newcommand{\qrq}{\ensuremath{\quad \Rightarrow \quad}} \newcommand{\envert}[1]{\left\lvert#1\right\rvert} \let\abs=\envert @@ -94,15 +89,16 @@ \begin{document} -\title{pst-vehicle v 1.0} +\title{pst-vehicle v 1.3} %\subtitle{A PSTricks package for slipping/rolling vehicles on curves of any kind of mathematical functions} \subtitle{Un package PSTricks pour faire rouler sans glisser des véhicules sur des courbes définies par une fonction mathématique} \author{Thomas \textsc{Söll}\\ avec la collaboration de\\ -Jürgen \textsc{Gilg} et Manuel \textsc{Luque}} +Jürgen \textsc{Gilg} et Manuel \textsc{Luque}\\ +Herbert Voß (bugfixes)} \date{\today} -\maketitle +\settitle \tableofcontents \psset{unit=1cm} @@ -123,7 +119,7 @@ Il est également possible de dessiner son propre véhicule. \end{abstract} \clearpage -\section{\protectÉtude théorique du roulement sans glissement, d'une roue sur une courbe} +\section{Étude théorique du roulement sans glissement, d'une roue sur une courbe} Dans cette première partie, nous établissons les résultats nécessaires permettant de déterminer suivant la position choisie pour le véhicule sur la courbe (l'abscisse du point de contact de roue arrière), les éléments suivants : \begin{itemize} \item la position du point de contact de la roue avant ; @@ -198,20 +194,20 @@ $x$ est l'abscisse du point de contact de la roue avant avec la courbe. Le vecteur unitaire normal en ce point est : \begin{equation*} \vec{n}_{0x}=\frac{1}{\sqrt{1+f'(x)^2}} -\begin{pmatrix} --f'(x)\\ -1 -\end{pmatrix} +\begin{pmatrix}-f'(x)\\1\end{pmatrix} \end{equation*} + Soit $V$ l'axe de la roue avant, son vecteur position a pour coordonnées : + \begin{align*} -\overrightarrow{OV}&=\vec{x}+r\cdot \vec{n}_{0x}\\ -&=\begin{pmatrix} -x-r\frac{f'(x)}{\sqrt{1+f'(x)^2}}\\ -f(x)+r\frac{1}{\sqrt{1+f'(x)^2}} -\end{pmatrix} +\overrightarrow{OV} &= \vec{x}+r\cdot \vec{n}_{0x}\\ + &=\begin{pmatrix} x-r\frac{f'(x)}{\sqrt{1+f'(x)^2}}\\ + f(x)+r\frac{1}{\sqrt{1+f'(x)^2}} + \end{pmatrix} \end{align*} + Si $R$ est la distance entre les 2 axes : + \begin{align*} |\overrightarrow{OV}-\overrightarrow{OH}|&=R\\ \left| @@ -226,7 +222,10 @@ f(x)-f(x_0)+r\left(\frac{1}{\sqrt{1+f'(x)^2}}-\frac{1}{\sqrt{1+f'(x_0)^2}}\right \end{pmatrix} \right|&=R \end{align*} -Nous obtenons une équation en $x$, où $x$ est l'abscisse du point de tangence de la roue avant avec la courbe. La résolution de cette équation fixera la position de la roue avant. + +Nous obtenons une équation en $x$, où $x$ est l'abscisse du point de tangence de la roue +avant avec la courbe. La résolution de cette équation fixera la position de la roue avant. + \begin{equation*} \left(x-x_0+r\left(\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}-\frac{f'(x)}{\sqrt{1+f'(x)^2}}\right)\right)^2+\left(f(x)-f(x_0)+r\left(\frac{1}{% \sqrt{1+f'(x)^2}}-\frac{1}{\sqrt{1+f'(x_0)^2}}\right)\right)^2=R^2 diff --git a/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc.pdf b/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc.pdf Binary files differnew file mode 100644 index 0000000000..f19ef0ef9d --- /dev/null +++ b/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc.pdf diff --git a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc.tex b/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc.tex index 97fa8996b0..ec2e9cf97b 100644 --- a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc.tex +++ b/graphics/pstricks/contrib/pst-vehicle/doc/pst-vehicle-doc.tex @@ -10,6 +10,8 @@ %% Juergen Gilg %% Manuel Luque %% +%% Herbert Voß (bugfixes) +%% %% This program can redistributed and/or modified under %% %% the terms of the LaTeX Project Public License %% %% Distributed from CTAN archives in directory %% @@ -20,24 +22,21 @@ %% `pst-vehicle' is a PSTricks package %% %% -\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,fleqn, - smallheadings, headexclude,footexclude,oneside,dvipsnames,svgnames,x11names,distiller]{pst-doc} -%\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings -% headexclude,footexclude,oneside,dvipsnames,svgnames,distiller]{pst-doc} +%% $Id: pst-vehicle-doc.tex 375 2021-12-29 12:04:46Z herbert $ +\RequirePackage{pdfmanagement-testphase} +\DeclareDocumentMetadata{} +% +\documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small, + headinclude=false,footinclude=false,oneside]{pst-doc} \listfiles +\usepackage{biblatex} \usepackage[autostyle]{csquotes} -\usepackage{biblatex}%\usepackage[style=dtk]{biblatex} \addbibresource{pst-vehicle-doc.bib} -\usepackage[utf8]{inputenc} \let\pstvehicleFV\fileversion \usepackage[e]{esvect} % für schönere Vektorpfeile \usepackage{pst-vehicle,pst-eucl,pstricks-add,animate} \let\belowcaptionskip\abovecaptionskip - -\usepackage{etex} % um die Anzahl der Register zu erhöhen (sonst nur 256) - - \newcommand{\qrq}{\ensuremath{\quad \Rightarrow \quad}} \newcommand{\envert}[1]{\left\lvert#1\right\rvert} \let\abs=\envert @@ -48,15 +47,13 @@ \makeatletter \def\curveVal{\def\pst@par{}\pst@object{curveVal}}% -\def\curveVal@i#1#2{\@ifnextchar[% -{\curveVal@ii{#1}{#2}}% -{\curveVal@ii{#1}{#2}[1]}}% +\def\curveVal@i#1#2{\@ifnextchar[{\curveVal@ii{#1}{#2}}{\curveVal@ii{#1}{#2}[1]}}% \def\curveVal@ii#1#2[#3]{% -\pst@killglue% -\begingroup% -\use@par% -\begin@SpecialObj% -\pst@Verb{% + \pst@killglue% + \begingroup% + \use@par% +%\begin@SpecialObj% + \pst@Verb{% /Pi 3.1415926 def /rpn {tx@AlgToPs begin AlgToPs end cvx} def /x0 #1 def @@ -85,14 +82,14 @@ /gamma 90 beta add def /nex gamma cos def /ney gamma sin def -}% -\pnode(!x0 funcx0){PC}% -\pnode(!x0 deltaxW 2 mul add funcx0 deltayW 2 mul add){QC}% -\pnode(!x0 deltax0 add funcx0 deltay0 add){MC}% -\pnode(!x0 deltaxW add funcx0 deltayW add){MW}% -\showpointsfalse% -\end@SpecialObj% -\endgroup\ignorespaces% + }% + \pnode(!x0 funcx0){PC}% + \pnode(!x0 deltaxW 2 mul add funcx0 deltayW 2 mul add){QC}% + \pnode(!x0 deltax0 add funcx0 deltay0 add){MC}% + \pnode(!x0 deltaxW add funcx0 deltayW add){MW}% + \showpointsfalse +% \end@SpecialObj% + \endgroup\ignorespaces }% \makeatother %3 \cdot f' \cdot (f'')^2 - (f')^2 \cdot f''' - f''' = 0 Stellen maximaler Krümmung! @@ -102,13 +99,12 @@ \def\bgImage{% \begin{pspicture}(0,0)(14,8) -\def\FuncA{0.5*cos(1.5*x)+0.25*x} -\psplot[plotpoints=500]{0}{16}{\FuncA} -\psVehicle[vehicle=\HighWheeler,showSlope=false,linecolor=Gold]{0.35}{1.2}{\FuncA}% -\psVehicle[vehicle=\Bike,style=bike,showSlope=false,linecolor=green!70]{0.5}{6}{\FuncA}% -\psVehicle[vehicle=\Truck,style=truck,showSlope=false]{0.35}{12.2}{\FuncA}% -\end{pspicture} -} + \def\FuncA{0.5*cos(1.5*x)+0.25*x} + \psplot[plotpoints=500]{0}{16}{\FuncA} + \psVehicle[vehicle=\HighWheeler,showSlope=false,linecolor=Gold]{0.35}{1.2}{\FuncA}% + \psVehicle[vehicle=\Bike,style=bike,showSlope=false,linecolor=green!70]{0.5}{6}{\FuncA}% + \psVehicle[vehicle=\Truck,style=truck,showSlope=false]{0.35}{12.2}{\FuncA}% +\end{pspicture}} \lstset{language=PSTricks,morekeywords={psVehicle}\footnotesize\ttfamily} % @@ -116,26 +112,23 @@ \psset{algebraic=true} \newpsstyle{quadrillage}{subgriddiv=2,gridlabels=5pt,gridwidth=0.3pt,gridcolor=black!50,subgridwidth=0.2pt,subgridcolor=black} -\newcommand{\Epkt}[3]{\ensuremath{{\text{#1}}\left(\,#2\;\vline\;#3\,\right)}} +\newcommand\Epkt[3]{\ensuremath{{\text{#1}}\left(\,#2\;\vline\;#3\,\right)}} \begin{document} -\title{pst-vehicle v 1.2} +\title{pst-vehicle v 1.3} \subtitle{A PSTricks package for slipping/rolling vehicles on curves of any kind of mathematical functions} -\author{Thomas \textsc{Söll}\\ -avec la collaboration de\\ -Manuel \textsc{Luque} et Jürgen \textsc{Gilg}} +\author{Thomas Söll\\Manuel Luque\\Jürgen Gilg\\Herbert Voß (bugfixes)} \date{\today} -\maketitle +\settitle \tableofcontents \psset{unit=1cm} - -\clearpage +\newpage \begin{abstract} @@ -156,13 +149,13 @@ the License, or (at your option) any later version. %% \end{abstract} -\clearpage - +\newpage \section{Theory---the mathematical background} -Within the following first sections, we like to show the theory on how we programmed the package. Easy elementary vector geometry with some basic calculus aspects. +Within the following first sections, we like to show the theory on how we programmed +the package. Easy elementary vector geometry with some basic calculus aspects. @@ -205,15 +198,15 @@ x_0\\ f(x_0) \end{pmatrix} \end{equation*} + The direction of the tangent line is: + \begin{equation*} -\vec{t}_0= -\begin{pmatrix} -1\\ -f'(x_0) -\end{pmatrix} +\vec{t}_0= \begin{pmatrix} 1\\ f'(x_0) \end{pmatrix} \end{equation*} + The normed normal vector in $x_0$ is: + \begin{equation*} \vec{n}_{0x_0}=\frac{1}{\sqrt{1+f'(x_0)^2}} \begin{pmatrix} @@ -270,6 +263,8 @@ This leads to an equation of the variable $x$, where $x$ is the abscissa of the + + \subsection{Wheels on a curve---different radii} \psset{saveNodeCoors,NodeCoorPrefix=n,algebraic} @@ -400,6 +395,7 @@ This leads to an equation of the variable $x$, where $x$ is the abscissa of the \pcline[linecolor=gray,linestyle=dashed](H)(!nHx nVy)\nbput{$r_1-r_2$} \pcline[linecolor=gray,linestyle=dashed](!nHx nVy)(!nVx nVy)\nbput{$\sqrt{R^2-(r_1-r_2)^2}$} +%$ \pnode(!nHx nVy){X} \pstMarkAngle[linecolor=red,arrows=->,MarkAngleRadius=4.5,LabelSep=3.6]{H}{V}{X}{\color{red}$\alpha$} @@ -442,6 +438,7 @@ If the plane is not horizontal, there is an additional angle $\beta$ given by th \pcline[linecolor=gray,linestyle=dashed](H)(!nHx nVy)\nbput{$r_1-r_2$} \pcline[linecolor=gray,linestyle=dashed](!nHx nVy)(!nVx nVy)\nbput{$\sqrt{R^2-(r_1-r_2)^2}$} +%$ \pnode(!nHx nVy){X} \pstMarkAngle[linecolor=red,arrows=->,MarkAngleRadius=4.5,LabelSep=3.6]{H}{V}{X}{\color{red}$\alpha$} @@ -487,6 +484,9 @@ The total angle $\gamma$ is: + + + \subsection{Determination of the curvature radius} A curved curve can be imagined from many small circular arcs. The radius of the respective associated circles is referred to as the radius of curvature. The stronger the curvature of a curve changes, the smaller the intervals have to be chosen in @@ -554,69 +554,75 @@ Using $\Delta x_{m} = -\frac{f'(x_{0})}{f''(x_{0})}\cdot \left\{ 1 + \left[f'(x_ \subsection{Rolling without slipping} \begin{pspicture}[showgrid=false,shift=0,saveNodeCoors,NodeCoorPrefix=n](0,-0.8)(18,11) -\def\funkg{0.4*(x-3)*sin(0.2*(x-5))} -\curveVal{7}{\funkg}[3] -%\psplot[algebraic=true,plotpoints=500,linecolor=black,linewidth=2pt,yMaxValue=25,yMinValue=-15]{0}{18}{\funkg} -\pcline[linewidth=1.5pt,nodesepB=0,linecolor=BrickRed](PC)(MC) -\psdot[dotsize=5pt](MC) -\uput{0.2}[40]{0}(MC){M$_{\text{c}}$} -\psarc[linewidth=1.5pt,linecolor=cyan](MC){!Rhox0}{255}{340} -\psdot[dotsize=5pt](PC) -\uput{0.25}[-60]{0}(PC){P} -\uput{0.25}[60]{0}(QC){Q} -\uput{0.3}[-100]{0}(MW){M$_{\text{w}}$} -\pnode([offset=1.3cm]{MC}PC){PCO} -\pnode([offset=-1.3cm]{PC}MC){MCO} -\pnode([offset=-1.3cm]{PC}MW){MWO} -\psline[linewidth=1.5pt](MWO)(MW) -\psline[linewidth=1.5pt](MCO)(MC) -\pcline[offset=-5pt,linewidth=1.5pt,linecolor=BrickRed]{<->}(MWO)(MCO) -\ncput*{\color{BrickRed}$R=\rho - r$} -\psdot[dotsize=5pt](QC) -\psdot[dotsize=5pt](MW) -\pscircle[linewidth=1.5pt](MW){!rW} -\psarcn[linewidth=1.5pt,linecolor=BrickRed]{->}(MW){!rW 0.5 add}{180}{150} -\uput{3.65}[165]{0}(MW){$\omega=\dot{\varphi}$} -%\multido{\iC=0+1}{11}{% -%\definecolor[ps]{rainbow}{hsb}{0.9 \iC\space 15 div sub 0.95 0.7 }% -%\rput{!-90 \iC\space 0.5 mul 180 mul Pi div rW div sub alpha sub}(MW){\psline[linewidth=1.5pt,linecolor=rainbow](!rW 0)(!rW 0.2 sub 0)} -%\rput{!-90 \iC\space 0.5 mul 180 mul Pi div Rhox0 div sub alpha sub}(MC){\psline[linewidth=1.5pt,linecolor=rainbow](!Rhox0 0)(!Rhox0 0.2 add 0)} -%} -%%\rput(MW){\psline[linewidth=1.5pt]{->}(0,0)(!tex 4 mul tey 4 mul)} -\rput{!beta}(MW){\pcline[linewidth=1.2pt,linecolor=BrickRed]{->}(0,0)(2,0)\nbput[npos=0.7]{\color{BrickRed}$\vv{v_{\text{c}}}$}} -\rput{0}(MC){\uput{!Rho}[-19]{0}(0,0){\color{cyan}G$_{f}$}} -\rput{-40}(MC){\pnode(!Rho rW sub 0){MWI}} -\rput{-40}(MC){\pnode(!Rho 0){PCI}} -\pscircle[linewidth=1.2pt,linecolor=gray,linestyle=dashed](MWI){!rW} -\psarc[linewidth=1.5pt,linecolor=gray,linestyle=dashed](MC){!Rhox0 rW sub}{290}{330} -\pcline[linewidth=1pt,nodesepB=0,linecolor=cyan!60,linestyle=dashed](PCI)(MC) -\pcline[linewidth=1.5pt,nodesepB=0,linecolor=gray,linestyle=dashed](MWI)(MC) -\psdot[dotsize=5pt,linecolor=gray](MWI) -\psdot[dotsize=5pt,linecolor=gray](PCI) -\uput{0.3}[-20]{0}(PCI){$\text{P}'$} -\uput{0.3}[0]{0}(MWI){$\text{M}_{\text{w}}'$} -\multido{\iC=0+1}{11}{% -\definecolor[ps]{rainbow}{hsb}{0.9 \iC\space 15 div sub 1 \iC\space 11 div sub 0.7 }% -\rput{!-90 \iC\space 0.5 mul 180 mul Pi div rW div sub -50 sub}(MWI){\psline[linewidth=1.5pt,linecolor=rainbow](!rW 0)(!rW 0.2 sub 0)} -\rput{!-90 \iC\space 0.5 mul 180 mul Pi div Rhox0 div sub -50 sub}(MC){\psline[linewidth=1.5pt,linecolor=rainbow](!Rhox0 0)(!Rhox0 0.2 add 0)} -} -%\multido{\iC=0+1}{11}{% -%\rput{!-90 \iC\space 0.5 mul 180 mul Pi div rW div sub alpha sub 50 gamma sub Rhox0 mul rW div sub}(MWI){\psline[linewidth=1.5pt,linecolor=gray!50](!rW 0)(!rW 0.2 sub 0)} -%} -\rput{!beta}(PC){\pcline[linewidth=2pt,linecolor=Green]{->}(0,0)(1.5,0)\nbput[npos=0.7,nrot={!beta neg}]{\color{Green}$\vv{e_{\text{t}}}$}} -\rput{!gamma}(PC){\pcline[linewidth=2pt,linecolor=Green]{->}(0,0)(1.5,0)\nbput[npos=0.7,nrot={!gamma neg}]{\color{Green}$\vv{e_{\text{n}}}$}} + \def\funkg{0.4*(x-3)*sin(0.2*(x-5))} + \curveVal{7}{\funkg}[3] + %\psplot[algebraic=true,plotpoints=500,linecolor=black,linewidth=2pt,yMaxValue=25,yMinValue=-15]{0}{18}{\funkg} + \pcline[linewidth=1.5pt,nodesepB=0,linecolor=BrickRed](PC)(MC) + \psdot[dotsize=5pt](MC) + \uput{0.2}[40]{0}(MC){M$_{\text{c}}$} + \psarc[linewidth=1.5pt,linecolor=cyan](MC){!Rhox0}{255}{340} + \psdot[dotsize=5pt](PC) + \uput{0.25}[-60]{0}(PC){P} + \uput{0.25}[60]{0}(QC){Q} + \uput{0.3}[-100]{0}(MW){M$_{\text{w}}$} + \pnode([offset=1.3cm]{MC}PC){PCO} + \pnode([offset=-1.3cm]{PC}MC){MCO} + \pnode([offset=-1.3cm]{PC}MW){MWO} + \psline[linewidth=1.5pt](MWO)(MW) + \psline[linewidth=1.5pt](MCO)(MC) + \pcline[offset=-5pt,linewidth=1.5pt,linecolor=BrickRed]{<->}(MWO)(MCO) + \ncput*{\color{BrickRed}$R=\rho - r$} + \psdot[dotsize=5pt](QC) + \psdot[dotsize=5pt](MW) + \pscircle[linewidth=1.5pt](MW){!rW} + \psarcn[linewidth=1.5pt,linecolor=BrickRed]{->}(MW){!rW 0.5 add}{180}{150} + \uput{3.65}[165]{0}(MW){$\omega=\dot{\varphi}$} + %\multido{\iC=0+1}{11}{% + %\definecolor[ps]{rainbow}{hsb}{0.9 \iC\space 15 div sub 0.95 0.7 }% + %\rput{!-90 \iC\space 0.5 mul 180 mul Pi div rW div sub alpha sub}(MW){\psline[linewidth=1.5pt,linecolor=rainbow](!rW 0)(!rW 0.2 sub 0)} + %\rput{!-90 \iC\space 0.5 mul 180 mul Pi div Rhox0 div sub alpha sub}(MC){\psline[linewidth=1.5pt,linecolor=rainbow](!Rhox0 0)(!Rhox0 0.2 add 0)} + %} + %%\rput(MW){\psline[linewidth=1.5pt]{->}(0,0)(!tex 4 mul tey 4 mul)} + \rput{!beta}(MW){\pcline[linewidth=1.2pt,linecolor=BrickRed]{->}(0,0)(2,0)\nbput[npos=0.7]{\color{BrickRed}$\vv{v_{\text{c}}}$}} + \rput{0}(MC){\uput{!Rho}[-19]{0}(0,0){\color{cyan}G$_{f}$}} + \rput{-40}(MC){\pnode(!Rho rW sub 0){MWI}} + \rput{-40}(MC){\pnode(!Rho 0){PCI}} + \pscircle[linewidth=1.2pt,linecolor=gray,linestyle=dashed](MWI){!rW} + \psarc[linewidth=1.5pt,linecolor=gray,linestyle=dashed](MC){!Rhox0 rW sub}{290}{330} + \pcline[linewidth=1pt,nodesepB=0,linecolor=cyan!60,linestyle=dashed](PCI)(MC) + \pcline[linewidth=1.5pt,nodesepB=0,linecolor=gray,linestyle=dashed](MWI)(MC) + \psdot[dotsize=5pt,linecolor=gray](MWI) + \psdot[dotsize=5pt,linecolor=gray](PCI) + \uput{0.3}[-20]{0}(PCI){$\text{P}'$} + \uput{0.3}[0]{0}(MWI){$\text{M}_{\text{w}}'$} + \multido{\iC=0+1}{11}{% +% \definecolor{rainbow}{hsb}{\directlua{tex.print(0.9-\iC/15)}, \directlua{tex.print(1-\iC/11)}, 0.7}% + \definecolor[ps]{rainbow}{hsb}{0.9 \iC\space 15 div sub 1 \iC\space 11 div sub 0.7 }% + \rput{!-90 \iC\space 0.5 mul 180 mul Pi div rW div sub -50 sub}(MWI){\psline[linewidth=1.5pt,linecolor=rainbow](!rW 0)(!rW 0.2 sub 0)} + \rput{!-90 \iC\space 0.5 mul 180 mul Pi div Rhox0 div sub -50 sub}(MC){\psline[linewidth=1.5pt,linecolor=rainbow](!Rhox0 0)(!Rhox0 0.2 add 0)} + } + %\multido{\iC=0+1}{11}{% + %\rput{!-90 \iC\space 0.5 mul 180 mul Pi div rW div sub alpha sub 50 gamma sub Rhox0 mul rW div sub}(MWI){\psline[linewidth=1.5pt,linecolor=gray!50](!rW 0)(!rW 0.2 sub 0)} + %} + \rput{!beta}(PC){\pcline[linewidth=2pt,linecolor=Green]{->}(0,0)(1.5,0)\nbput[npos=0.7,nrot={!beta neg}]{\color{Green}$\vv{e_{\text{t}}}$}} + \rput{!gamma}(PC){\pcline[linewidth=2pt,linecolor=Green]{->}(0,0)(1.5,0)\nbput[npos=0.7,nrot={!gamma neg}]{\color{Green}$\vv{e_{\text{n}}}$}} \end{pspicture} The condition of a rolling wheel without slipping forces, that the center of the wheel needs to make a rotation around the point P. Therefore, the center moves with the velocity: + \begin{equation*} \vv{v_{\text{c}}} = r\cdot \dot{\varphi}\cdot \vv{e_{\text{t}}} \qquad \text{with normed tangent vector } \vv{e_{\text{t}}} \end{equation*} + Cause the center of the wheel also moves along the circle around M$_{\text{c}}$ with radius $\rho - r$ and therefore the point P moves through the distance $\Delta s$ to the point $\text{P}'$---the velocities in M$_\text{w}$ and in P behave like their corresponding radii: + \begin{equation*} \vv{v_{\text{c}}} = \frac{\rho - r}{\rho}\cdot \frac{\Delta s}{\Delta t} \cdot \vv{e_{\text{t}}} \qquad \text{with very small intervals, thus }\quad \frac{\Delta s}{\Delta t} = \dot{s} \end{equation*} + Equating the right sides of both equations for the velocity of the center of the wheel finally leads to: + \begin{equation*} r\cdot \dot{\varphi} = \frac{\rho - r}{\rho}\cdot \dot{s} \qrq \frac{\text{d}\varphi}{\text{d}t} = \frac{\rho - r}{\rho \cdot r}\cdot \frac{\text{d}s}{\text{d}t} \qrq \text{d}\varphi = \frac{\rho - r}{\rho \cdot r}\cdot \text{d}s = \frac{\rho - r}{\rho \cdot r}\cdot \sqrt{1+[f'(x)]^{2}} \cdot \text{d}x @@ -644,6 +650,8 @@ Here follows a list of the vehicles that come along with the package: + + \subsection{\textbackslash Bike} \begin{LTXexample}[pos=l,width=4cm] @@ -744,7 +752,9 @@ In this section we present $12$ predefined wheels that can be used for the front -\subsection{\textbackslash{}wheelB} + + +\subsection{\nxLcs{wheelB}} \begin{LTXexample}[pos=l,width=2cm] \begin{pspicture}(-1,-1)(1,1) @@ -988,7 +998,7 @@ extra_mem_bot = 12000000 % extra low memory for boxes, glue, breakpoints, etc. \end{LTXexample} -\clearpage +%\clearpage \section{List of all optional arguments for \texttt{pst-vehicle}} @@ -996,14 +1006,13 @@ extra_mem_bot = 12000000 % extra low memory for boxes, glue, breakpoints, etc. \xkvview{family=pst-vehicle,columns={key,type,default}} -\clearpage - +%\clearpage -\nocite{*} -\bgroup -\RaggedRight -\printbibliography -\egroup +%\nocite{*} +%\bgroup +%\RaggedRight +%\printbibliography +%\egroup \printindex diff --git a/graphics/pstricks/contrib/pst-vehicle/latex/pst-vehicle.sty b/graphics/pstricks/contrib/pst-vehicle/latex/pst-vehicle.sty new file mode 100644 index 0000000000..c0fbb1f3a3 --- /dev/null +++ b/graphics/pstricks/contrib/pst-vehicle/latex/pst-vehicle.sty @@ -0,0 +1,7 @@ +\RequirePackage{pstricks} +\ProvidesPackage{pst-vehicle}[2017/05/29 package wrapper for pst-vehicle.tex] +\input{pst-vehicle.tex} +\ProvidesFile{pst-vehicle.tex}[\filedate\space v\fileversion\space `PST-vehicle'] +\endinput +%% $Id: pst-vehicle.sty 376 2021-12-29 12:28:42Z herbert $ + diff --git a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc-fr.pdf b/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc-fr.pdf Binary files differdeleted file mode 100644 index 71c3c513b9..0000000000 --- a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc-fr.pdf +++ /dev/null diff --git a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc.pdf b/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc.pdf Binary files differdeleted file mode 100644 index 4ba0224abd..0000000000 --- a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle-doc.pdf +++ /dev/null diff --git a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle.sty b/graphics/pstricks/contrib/pst-vehicle/pst-vehicle.sty deleted file mode 100644 index a726ddecc0..0000000000 --- a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle.sty +++ /dev/null @@ -1,6 +0,0 @@ -\RequirePackage{pstricks} -\ProvidesPackage{pst-vehicle}[2017/05/29 package wrapper for pst-vehicle.tex] -\input{pst-vehicle.tex} -\ProvidesFile{pst-vehicle.tex} - [\filedate\space v\fileversion\space `PST-vehicle'] -\endinput diff --git a/graphics/pstricks/contrib/pst-vehicle/tex/pst-vehicle.data b/graphics/pstricks/contrib/pst-vehicle/tex/pst-vehicle.data new file mode 100644 index 0000000000..3c718cfc8d --- /dev/null +++ b/graphics/pstricks/contrib/pst-vehicle/tex/pst-vehicle.data @@ -0,0 +1,483 @@ +%% $Id: pst-vehicle.data 376 2021-12-29 12:28:42Z herbert $ +%% +%% This is file `ListVehicles.tex', +%% +%% IMPORTANT NOTICE: +%% +%% Package `pst-vehicle.tex' +%% +%% Thomas Söll +%% with the collaboration of +%% Juergen Gilg +%% Manuel Luque +%% HErbert Voß (bugfixes) +%% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.3c of %% +%% the License, or (at your option) any later version. %% +%% +%% DESCRIPTION: +%% `pst-vehicle' is a PSTricks package +%% +%% +\newpsstyle{segway}{rB=1.4,backwheel=\segWheel} +\newpsstyle{unicycle}{rB=1.6,backwheel=\SpokesWheelB} +\newpsstyle{tractor}{d=4,rB=1.4,rF=1.0} +\newpsstyle{truck}{backwheel=\TruckWheel,frontwheel=\TruckWheel,d=6.28,rB=1.9,rF=1.9} +\newpsstyle{bike}{backwheel=\SpokesWheelB,frontwheel=\SpokesWheelB,d=5.8,rB=1.6,rF=1.6} +%\wheelA,\wheelB,\wheelC,\segWheel,\arrowWheel,\TruckWheel,\TractorFrontWheel,\TractorRearWheel,\SpokesWheelCrossed,\SpokesWheelA +\def\Bike{% ------------------------------ Vehicle Nr. 1: normal bike ---------------------------- + \rput{!phiB}(0,0){% ------------ backwheel --- Hinterrad + \pst@backwheel + }% + \rput{!phiF}(!/rB rF def AF1x AF1y){%------ frontwheel --- Vorderrad + \pst@frontwheel + }% + \rput(!0 rB neg){% + \psline[linewidth=3pt](2.5,1.95)(0,1.7)% + \psline[linewidth=3pt](2.5,1.25)(0,1.45)% + \rput{!phiB Gang div}(!2.5 rB){% Kurbel + \pscircle*(0,0){0.4}% + \psline[linewidth=4pt](-0.3,-0.9)(0.3,0.9)% + \rput{!phiB Gang div neg}(-0.3,-0.9){\psline[linewidth=4pt](0,0)(-0.3,0)}% + \rput{!phiB Gang div neg}(0.3,0.9){\psline[linewidth=4pt](0,0)(0.3,0)}% + }% + \psline[linewidth=5pt](5.8,1.6)(4.75,4.85)(3.8,4.85)% + \psline[linewidth=5pt](0,1.6)(2.5,1.6)(5.2,3.65)% + \psline[linewidth=5pt](0,1.6)(1.6,4.05)(5,4.05)% + \psline[linewidth=5pt](2.5,1.6)(1.5,4.45)% + \psline[linewidth=7pt](0.8,4.45)(2,4.45)% + \pspolygon[linecolor=\pslinecolor,fillstyle=solid,fillcolor=\pslinecolor](5.05,3.85)(5.65,4.1)(5.65,3.6)% + }% +}% + +\def\HighWheeler{% ------------------------------ Vehicle Nr. 2: high wheeler -- Hochrad Nr 2 ---------- + %------ pedal behind the frontwheel -- Pedal hinter dem Rad --------------------------------------- + \rput{!phiF 5 mul Gang div}(!AF1x AF1y){% + \psline[linewidth=3pt,border=0.5pt,bordercolor=white](0,0)(1.15;135) + \rput{!phiF 5 mul Gang div 180 add neg}(1.11;135){% + \pspolygon*[linearc=0.08,border=0.5pt,bordercolor=white](-0.25,0.06)(-0.1,0.08)(-0.08,0.16)(0.08,0.16)(0.1,0.08)(0.25,0.06)% + (0.25,-0.06)(0.1,-0.08)(0.08,-0.16)(-0.08,-0.16)(-0.1,-0.08)(-0.25,-0.06)% + }% + \pscircle[linewidth=0.75pt,dimen=outer,linecolor=white](1.1;135){0.075} + }% + %-------------------------------------------------------------------------------------------- + \rput{!phiF}(!AF1x AF1y){% % frontwheel ----- Vorderrad + \multido{\iA=0+10}{36}{% + \rput(0,0){\psline[linewidth=0.7pt,border=0.35pt,bordercolor=white](0,0)(!rF \iA\space PtoC)}% + }% + \pscircle[linewidth=7.5pt,dimen=outer](0,0){!rF}% + \pscircle[linewidth=0.6pt,dimen=outer,linecolor=white](0,0){!rF 0.955 mul}% + \pscircle*(0,0){0.3}% + \pscircle*[linecolor=white](0,0){0.2}% + \pscircle*(0,0){0.14}% + }% + %------------------------------------------------------------------------------------------------- + \rput{!phiF}(!AF1x AF1y){% + \pscircle*(0,0){0.14}% + \pscircle[linewidth=0.6pt,linecolor=white](0,0){0.07}% + }% + %-------------------------------------------------------------------------------------------------- + \rput{!phiB}(0,0){% backwheel ------ Hinterrad + \multido{\iA=0+24}{15}{% + \rput(0,0){\psline[linewidth=0.7pt,border=0.35pt,bordercolor=white](0,0)(!rB \iA\space PtoC)}% + }% + \pscircle[linewidth=4.3pt,dimen=outer](0,0){!rB}% + \pscircle[linewidth=0.6pt,dimen=outer,linecolor=white](0,0){!rB 0.91 mul}% + \pscircle*[linewidth=0.5pt](0,0){0.14}% + }% + %-------- front to back connection -- Verbindung vordere Gabel zur Hinterachse ---------------------- + \rput(!AF1x AF1y){\pnode(!rF 1.06 mul 170 PtoC){ZA}}% + \let\myfillcolor\pslinecolor + \rput(!AF1x AF1y){% + \pscustom[linewidth=0.4pt,linecolor=white,fillstyle=solid,fillcolor=\myfillcolor]{% + \parametricplot[linewidth=0.5pt]{88}{10}{-(rF+0.36)*cos(Pi*t/180)|(rF+0.36)*sin(Pi*t/180)}% + \psarc(!AF1x 0.1 sub neg AF1y 0.03 add neg){0.08}{200}{300} + \parametricplot[linewidth=0.5pt]{10}{88}{-(rF+0.08-(t-100)*0.0353*2.5/78)*cos(Pi*t/180)|(rF+0.08-(t-100)*0.0353*2.5/78)*sin(Pi*t/180)} + \closepath + }% + }% + \rput(0,0){% + \pscircle[linestyle=none,fillstyle=solid,fillcolor=\pslinecolor](0,0){0.08}% + \pscircle[linewidth=0.9pt,linecolor=white](0,0){0.08}% + } + %-------------------------------------------------------------------------------------------------- + %-------front part and handle bar --- Vordere Gabel und Lenker ------------------------------------------- + \rput{1.5}(!AF1x AF1y){% + \psline[linewidth=5.5pt,border=0.5pt,bordercolor=white](0,0.1)(!0 rF 1.265 mul)% + \pscircle*[linewidth=0.6pt](!0 rF 1.28 mul){0.075}% + \psline[linewidth=5.5pt,linecolor=white](!0 rF 1.265 mul)(!0 rF 1.27 mul) + \psline[linewidth=3pt,linearc=0.02](!0 rF 1.24 mul)(!0.193 rF 1.24 mul)(!0.33 rF 1.31 mul)(!0.38 rF 1.31 mul) + \psline[linewidth=4.7pt,linearc=0.02,linecap=1,border=0.5pt,bordercolor=white](!0.42 rF 1.32 mul)(!0.455 rF 1.22 mul) + \pscircle*[linewidth=0.6pt](!0.455 rF 1.223 mul){0.145}% + \pscircle[linecolor=white,linewidth=0.5pt](!0.455 rF 1.223 mul){0.085}% + \pscircle[linecolor=white,linewidth=0.65pt](!0.455 rF 1.223 mul){0.15}% + \psline[linewidth=5.5pt,linecolor=white](!0 rF 1.208 mul)(!0 rF 1.211 mul) + \psline[linewidth=8.5pt](!0 rF 1.186 mul)(!0 rF 1.208 mul) + \psline[linewidth=5.5pt,linecolor=white](!0 rF 1.183 mul)(!0 rF 1.186 mul) + }% + %-------------------------------------------------------------------------------------------------- + %--------- pedal in front of the frontwheel --- Pedal vor dem Rad --------------------------------------------------------------- + \rput{!phiF 5 mul Gang div 180 add}(!AF1x AF1y){% + \psline[linewidth=3pt,border=0.5pt,bordercolor=white](0.12;135)(1.15;135) + \rput{!phiF 5 mul Gang div 180 add neg}(1.11;135){% + \pspolygon*[linearc=0.08,border=0.5pt,bordercolor=white]% + (-0.25,0.06)(-0.1,0.08)(-0.08,0.16)(0.08,0.16)(0.1,0.08)(0.25,0.06)% + (0.25,-0.06)(0.1,-0.08)(0.08,-0.16)(-0.08,-0.16)(-0.1,-0.08)(-0.25,-0.06)% + } + \pscircle[linewidth=0.75pt,dimen=outer,linecolor=white](1.1;135){0.075} + \psline[linewidth=3pt](0,0)(0.12;135) + \pscircle[linecolor=white,linewidth=0.3pt](0,0){0.065}% + } + %--------------------------------------------------------------------------------- + \rput(2,5.87){% + %--------- special garniture frontwheel ---- Geschweifte Linie am Vorderrad ------------------------------------------------------- + \rput(0,0){% + \pscustom[linewidth=1pt]{% + \psarc(3.16,1.53){0.1}{0}{180} + \psbezier(3.06,1.2)(3.2,1.05)(3.5,1.05) + \psbezier(3.63,1.05)(3.6,1.16)(3.53,1.17) + }% + \pscircle*[linewidth=0.6pt](3.2,1.5){0.075}% + \psellipse*[rot=0,linewidth=0.6pt](3.47,1.15)(0.085,0.05)% + }% + %------------ part of saddle ------ Sattelhalterung ----------------------------------------------------------- + \pscircle*[linewidth=0.6pt](2.63,1.6){0.068}% + \rput(0,0){% + \pscustom[showpoints=true,linewidth=1pt]{% + \psarcn(2.66,1.63){0.097}{235}{10} + \psbezier(2.8,1.3)(2.1,1.32)(1.4,1.32) + \psbezier(1.1,1.32)(0.9,1.1)(0.82,1) + \psbezier(0.74,0.9)(0.6,0.54)(0.3,0.54) + \psbezier(0.15,0.54)(0.17,0.7)(0.17,0.7) + \psarcn(0.31,0.7){0.14}{180}{0} + \psbezier(0.44,0.61)(0.34,0.61)(0.32,0.61) + }% + \pscircle*[linewidth=0.6pt](0.33,0.673){0.075}% + }% + \rput(0,0){% + \pscustom[showpoints=true,linewidth=1pt]{% + \psbezier(0.35,0.53)(0.3,0.45)(0.1,0.48)(0.1,0.4) + \psbezier(0.1,0.31)(0.18,0.345)(0.19,0.39) + }% + \psellipse*[rot=50,linewidth=0.6pt](0.2,0.4)(0.055,0.03)% + }% + %------------------------------------------------------------------------------------------------------- + %------------------ saddle ----- Sattel ---------------------------------------------------------------- + \rput(0,0){% + \pscustom[showpoints=true,linewidth=0.4pt,fillstyle=solid,fillcolor=\pslinecolor]{% + \psbezier(1.34,1.25)(1.42,1.25)(1.43,1.25)(1.58,1.25) + \psbezier(1.58,1.35)(1.62,1.38)(1.65,1.4)% <<----- Start the white line -- Startpunkt für die weiße Linie + \psbezier(1.7,1.37)(1.8,1.38)(1.91,1.38) + \psbezier(1.98,1.38)(2.35,1.48)(2.35,1.55) + \psbezier(2.35,1.59)(2.2,1.6)(2.15,1.6) + \psbezier(2.05,1.6)(1.8,1.55)(1.74,1.55) + \psbezier(1.56,1.55)(1.41,1.75)(1.1,1.75) + \psbezier(0.9,1.75)(0.79,1.65)(0.79,1.59) + \lineto(0.835,1.59) + \psbezier(0.83,1.5)(1.12,1.45)(1.2,1.42) + \psbezier(1.25,1.4)(1.34,1.38)(1.34,1.25) + \closepath + }% + \psbezier[linecolor=white,linewidth=0.6pt](0.8,1.584)(1.1,1.75)(1.4,1.58)(1.67,1.38) + }% + }% +}% + +\def\Truck{% \psset{radH=1.9,radV=1.9,d=6.28,vehicle=\Truck,ownvehicle=\ownTestB,frontwheel=\segWheel,backwheel=\segWheel} +% ------------------------------ Vehicle Nr. 3: truck ----------------------------------- +\rput(0,-2){% +\pscustom[linecolor=blue,fillstyle=solid,fillcolor=blue!20]{% +\psline(8.6,2)(8.38,2) +\psarc(6.28,2){2.1}{0}{180} +\psline(4.18,2)(2.1,2) +\psarc(0,2){2.1}{0}{180} +\psline(-2,2)(-2.2,2) +\moveto(-2.2,2) +\psline[linearc=0.2](-2.2,4.4)(2.5,4.4)(2.5,6)(4.4,6)(5.2,4.4)(7.8,4)(8.6,2) +\moveto(4.2,5.7) +\pspolygon[linearc=0.1](4.4,5.7)(2.8,5.7)(2.8,4.2)(5.1,4.2) +}% +\pswedge[fillstyle=solid,fillcolor=gray!20](6.28,2){2.1}{0}{180} +\pswedge[fillstyle=solid,fillcolor=gray!20](0,2){2.1}{0}{180} +\psarc[doubleline=true,doublecolor=blue!50](0,2){2.1}{0}{180} +\psarc[doubleline=true,doublecolor=blue!50](6.28,2){2.1}{0}{180} +% le phare +\pswedge[linecolor=blue,fillstyle=solid,fillcolor=blue!20](8.65,3){0.4}{90}{270} +% le conducteur +\pstVerb{% + /r1 0.4 def + /a1 -50 def + /b1 50 def +% r2=r1*sqrt(2-sin(2*a1)) + /r2 r1 2 1 a1 cos sub mul sqrt mul def + /b2 a1 sin neg 1 a1 cos sub atan def +}% +\rput(3.8,4.6){ +\pscustom[fillstyle=solid,fillcolor={[RGB]{253 191 183}}]{\psarc(0,0){!r1}{20}{-20} + \psarc(!r1 0){0.075}{-90}{90} + \closepath} +\psarcn(!r1 0){!r2}{!b2 180 add}{!b2 180 add b1 sub} +\pscircle*(0.2,0.1){0.05} +\psarc(0.2,0.1){0.1}{60}{130} +\psarc(-0.1,0){0.1}{120}{240} +\pscustom[fillstyle=solid,fillcolor=red]{\psarc(0,0){!r1}{60}{160}\closepath} +\pcline[nodesepB=1](!r1 60 cos mul r1 60 sin mul)(!r1 160 cos mul r1 160 sin mul)} +}% +\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad +\pst@backwheel +}% +\rput{!phiF}(!/rB rF def AF1x AF1y){%----- frontwheel --- Vorderrad +\pst@frontwheel +}% +}% + +%%%%%%%%%% Le tracteur %%%%%%%%%%%% +\definecolor{couleurtracteur}{RGB}{130 196 108} +\def\Tractor{% le tracteur seul +\psset{fillcolor=couleurtracteur} +\pscustom[fillstyle=solid]{% +\psline(!rB 160 cos mul rB 160 sin mul)(!rB 1.25 mul 160 cos mul rB 1.25 mul 160 sin mul)(-0.8,1.6)(1.2,1.5)(1.7,0.6)(1.7,0)(! rB 0) +\psarc(0,0){!rB}{0}{160} +\closepath} +\pscustom[fillstyle=solid]{ +\psline(1.4,1.14)(1.7,0.6)(1.7,-0.6)(2.4,-0.6)(2.4,-0.4)(3,-0.4) +\psarcn(!dA12 rF rB sub){!rF}{180}{126.87} +\psline(!dA12 rF 126.87 cos mul add rF rB sub rF 126.87 sin mul add)(2.4,0.4)(2.4,1.6)(2,1.14)(1.4,1.14) +\closepath} +\psline[linecolor=blue](2.4,1.6)(2,2.8)(0.4,2.8)(0.2,1.55) +\pscustom[fillstyle=solid]{% +\psline(2,2.8)(0.4,2.8)(0.2,1.55)(-0.2,1.57)(0.2,3.1)(1.932,3.004) +\closepath} +\pscustom[fillstyle=solid]{% +\psline(!dA12 rF 126.87 cos mul add rF rB sub rF 126.87 sin mul add)(2.4,0.4)(2.4,1.6)(4,1.4)(!dA12 rF 80 cos mul add rF rB sub rF 80 sin mul add) +\psarc(!dA12 rF rB sub){!rF}{80}{126.87} +\closepath} +\pscustom[fillstyle=solid]{% +\psline(3.9,1.43)(3.9,1.8)(3.7,1.8)(3.7,1.4555) +\closepath} +\pspolygon[fillstyle=solid,fillcolor=magenta](4,1.8)(3.6,1.8)(3.8,2) +\psline(2.4,-0.4)(1.7,-0.4) +\psdiamond[linejoin=1,fillstyle=solid,fillcolor=lightgray,doubleline](2.55,1)(0.12,0.2) +\rput(3.3,1){\textsf{\textbf{Renault}}}% +\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad +%\pst@backwheel +\TractorRearWheel +}% +\rput{!phiF}(!AF1x AF1y){%----- frontwheel --- Vorderrad +%\pst@frontwheel +\TractorFrontWheel +}% +} + +\def\Segway{% ------------------------------ Vehicle Nr. 4: Segway ----------------------------------- +\rput{!gamma neg}(0,0){% +\psframe*(-0.6,1)(0.2,4.5) +\rput{-10}(-0.8,0){\psframe*[framearc=0.6](-0.9,4.3)(0.4,7.4)} +\pscircle*(0.3,8.2){0.78} +\psline[linewidth=7pt](1,0.5)(2.1,5.2) +%% ARM +\psline[linewidth=12pt](2.1,5.4)(0.6,5.8)(0.2,6.8) +\pscircle*(2.1,5.4){0.3} +\pscircle[linecolor=white](2.1,5.4){0.25} +\psarc[linewidth=5pt](0,0){1.55}{0}{180} +%% la ROUE +}% +\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad +\pst@backwheel +}% +}% + +\def\UniCycle{% ------------------------------ Vehicle UniCycle ----------------------------------- +\rput{!gamma neg}(0,0){% +\rput{!phiB 180 add}(0,0){%!phiB +\rput{!phiB 180 add neg}(0,1){\psframe*[linecolor=black!80,framearc=0.15,linestyle=none,linewidth=0pt](-0.25,-0.1)(0.25,0.1)}%!phiB neg +\pscustom[linecolor=black!80,linewidth=0.015,fillstyle=solid,fillcolor=black!60]{% +\psarc(0,1){0.11}{0}{180} +\psbezier(-0.11,0.95)(-0.08,0.8)(-0.08,0.7) +\lineto(-0.08,0.4) +\psbezier(-0.08,0.25)(-0.12,0.05)(-0.12,0) +\psarc(0,0){0.12}{180}{0} +\psbezier(0.12,0.05)(0.08,0.25)(0.08,0.4) +\lineto(0.08,0.7) +\psbezier(0.08,0.8)(0.11,0.95)(0.11,1) +\closepath +}% +\pscircle[linecolor=black!90,linewidth=0.015](0,1){0.09}% +\pscircle*[linecolor=black](0,1){0.02} +} +\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad +\pst@backwheel +}% +%--- Gabel nach oben und Sattel +\rput{0}(0,0){%!gamma neg +\psframe*[linecolor=black!80,framearc=0.1,linestyle=none,linewidth=0pt](-0.085,2.9)(0.085,4) +\psframe*[linecolor=black!90,framearc=0.1,linestyle=none,linewidth=0pt](-0.1,1.9)(0.1,3) +\psframe*[linecolor=black,framearc=0.1,linestyle=none,linewidth=0pt](-0.16,2.85)(0.12,3.05) +\psframe*[linecolor=black!80,framearc=0.15,linestyle=none,linewidth=0pt](-0.12,0)(0.12,2) +%------------ Sattel ---------------------- +\pspolygon[fillstyle=solid,fillcolor=black!90,linearc=0.1,linestyle=none](-0.7,4)(1,4)(1,4.4)(0.6,4.35)(-0.2,4.35)(-0.7,4.4) +}% +%Pedale vorne +\rput{!phiB}(0,0){%!phiB +\pscustom[linecolor=black!80,linewidth=0.015,fillstyle=solid,fillcolor=black!60]{% +\psarc(0,1){0.11}{0}{180} +\psbezier(-0.11,0.95)(-0.08,0.8)(-0.08,0.7) +\lineto(-0.08,0.4) +\psbezier(-0.08,0.25)(-0.12,0.05)(-0.12,0) +\psarc(0,0){0.12}{180}{0} +\psbezier(0.12,0.05)(0.08,0.25)(0.08,0.4) +\lineto(0.08,0.7) +\psbezier(0.08,0.8)(0.11,0.95)(0.11,1) +\closepath +}% +\rput{!phiB neg}(0,1){\psframe*[linecolor=black!80,framearc=0.15,linestyle=none,linewidth=0pt](-0.25,-0.1)(0.25,0.1)}%!phiB neg +\pscircle[linecolor=black!60,linewidth=0.015](0,1){0.09}% +\pscircle*[linecolor=black](0,1){0.02} +\pscircle[linecolor=black,linewidth=0.015](0,0){0.1}% +\pscircle*[linecolor=black](0,0){0.02} +}% +}% +}% + +\def\SelfDefinedVehicle{% ------------- Vehicle Nr. 5: self defined vehicle -- Eigenes Fahrzeug Nr 5 +\pst@ownvehicle +\rput{!phiB}(0,0){% ----------- backwheel --- Hinterrad +\pst@backwheel +}% +\rput{!phiF}(!/rB rF def AF1x AF1y){%----- frontwheel --- Vorderrad +\pst@frontwheel +}% +}% + +\def\wheelA{% +\multido{\iA=0+36}{10}{% +\rput(0,0){\psline[linewidth=2pt](0,0)(!rB \iA\space PtoC)}% +}% +\pscircle[linewidth=5pt,dimen=outer](0,0){!rB}% +\pscircle*(0,0){0.25}% +}% + +\def\wheelB{% + \multido{\iA=0+36, \rA=0.0+0.1}{10}{% + \definecolor{couleurrayons}{hsb}{\rA, 1, 1 }% + \rput(0,0){\psline[linecolor=couleurrayons,linewidth=2pt](0,0)(!rB 0.9 mul \iA\space PtoC)} + }% + \pscircle[linewidth=5pt,dimen=outer](0,0){!rB}% + \pscircle*(0,0){0.25}% +}% + +\def\wheelC{% + \pscircle[fillstyle=solid,fillcolor=gray!20,dimen=outer](0,0){!rB}% + \multido{\iA=0+36,\rA=0.0+0.1}{10}{% + \definecolor{couleurrayons}{hsb}{\rA, 1, 1 }% + \rput(0,0){\psline[linecolor=couleurrayons,linewidth=2pt](0,0)(!rB 0.9 mul \iA\space PtoC)} + }% + \pscircle[linewidth=15pt,dimen=outer](0,0){!rB}% + \pscircle*(0,0){0.25}% +}% + +\def\wheelD{% + \multido{\iA=0+36,\rA=0.0+0.1}{10}{% + \definecolor{couleurrayons}{hsb}{\rA, 1, 1 }% + \rput(0,0){\psline[linecolor=couleurrayons,linewidth=1pt](0,0)(!rB \iA\space PtoC)} + }% + \pscircle[linewidth=1pt,dimen=outer](0,0){!rB}% + \pscircle*(0,0){0.1}% +} + +\def\arrowWheel{% +\pscircle*(0,0){!rB} +\pscircle*[linecolor=white](0,0){0.2} +\multido{\iA=0+30}{12}{% +\psline[linecolor=white](0,0)(!rB 0.7 mul \iA\space PtoC) +}% +\pscircle[linecolor=white,linewidth=2pt](0,0){!rB 0.7 mul} +\psline[linecolor=magenta,linewidth=1.5pt]{->}(0,0)(!rB -90 PtoC) +}% + +\def\TruckWheel{% +\pscircle*(0,0){!rB} +\pscircle*[linecolor=white](0,0){0.2} +\multido{\iA=0+30}{12}{% +\psline[linecolor=white](0,0)(!rB 0.65 mul \iA\space PtoC) +}% +\pscircle[linecolor=white,linewidth=2pt](0,0){!rB 0.65 mul} +}% + +\def\segWheel{% +\pscircle*(0,0){!rB} +\pscircle*[linecolor=white](0,0){0.2} +\multido{\iA=0+30}{12}{% +\psline[linecolor=white](0,0)(!rB 0.9 mul \iA\space PtoC) +}% +\pscircle[linecolor=white,linewidth=2pt](0,0){!rB 0.9 mul} +}% + +\def\SpokesWheelCrossed{ +\multido{\iM=0+40,\iJ=60+40}{10}{\psline[linewidth=0.1](!rB 0.16 mul \iM\space PtoC)(!rB \iJ\space PtoC) + \psline[linewidth=0.1](!rB 0.16 mul \iM\space PtoC)(!rB \iJ\space 10 add PtoC)} +\pscircle[fillstyle=solid,fillcolor=white,linewidth=0.1]{!rB 0.16 mul 0.2 add} +\multido{\i=0+40}{9}{\pscircle[linestyle=dashed,linecolor=gray!50](!rB 0.16 mul \i\space PtoC){! 0.1 rB 0.16 mul mul} + \pscircle*(!rB 0.16 mul \i\space 20 add PtoC){! 0.1 rB 0.16 mul mul}} +\multido{\iM=20+40,\iJ=-30+40}{10}{\psline[linewidth=0.1](!rB 0.16 mul \iM\space PtoC)(!rB \iJ\space PtoC) + \psline[linewidth=0.1](!rB 0.16 mul \iM\space PtoC)(!rB \iJ\space 10 sub PtoC)} +\pscircle[dimen=outer,linewidth=0.5,linecolor=black!90]{!rB}% +\pscircle[dimen=outer,linewidth=0.1,linecolor=white]{!rB 0.3 sub}% +} + +\def\SpokesWheelA{ +\multido{\iM=0+40,\iJ=60+40}{10}{\psline[linewidth=0.025](!rB 0.1 mul \iM\space PtoC)(!rB \iJ\space PtoC) + \psline[linewidth=0.025](!rB 0.1 mul \iM\space PtoC)(!rB \iJ\space 10 add PtoC)} +\pscircle[fillstyle=solid,fillcolor=white,linewidth=0.025]{!rB 0.1 mul 0.1 add} +\multido{\i=0+40}{9}{\pscircle[linewidth=0.025,linecolor=gray!50](!rB 0.1 mul \i\space PtoC){! 0.03 rB 0.16 mul mul} + \pscircle*[linewidth=0.025](!rB 0.1 mul \i\space 20 add PtoC){! 0.03 rB 0.16 mul mul}} +\multido{\iM=20+40,\iJ=-30+40}{10}{\psline[linewidth=0.025](!rB 0.1 mul \iM\space PtoC)(!rB \iJ\space PtoC) + \psline[linewidth=0.025](!rB 0.1 mul \iM\space PtoC)(!rB \iJ\space 10 sub PtoC)} +\pscircle[dimen=outer,linewidth=0.2,linecolor=black!90]{!rB}% +\pscircle[dimen=outer,linewidth=0.02,linecolor=white]{!rB 0.15 sub}% +} + +\def\SpokesWheelB{ + \multido{\iM=0+40,\iJ=60+40}{10}{% + \psline[linewidth=0.015,linecolor=black!80](!rB 0.11 mul \iM\space PtoC)(!rB \iJ\space PtoC) + \psline[linewidth=0.015,linecolor=black!80](!rB 0.11 mul \iM\space PtoC)(!rB \iJ\space 10 add PtoC)% + }% + \pscircle[fillstyle=solid,fillcolor=white,linewidth=0.025,linecolor=black!80]{!rB 0.11 mul 0.06 add}% + \multido{\i=0+40}{9}{% + \pscircle[linewidth=0.01,linecolor=black!50](!rB 0.11 mul \i\space PtoC){! 0.09 rB 0.16 mul mul}% + \pscircle*[linewidth=0.01,linecolor=black](!rB 0.11 mul \i\space 20 add PtoC){! 0.09 rB 0.16 mul mul}% + }% + \multido{\iM=20+40,\iJ=-30+40}{10}{% + \psline[linewidth=0.015,linecolor=black!80](!rB 0.11 mul \iM\space PtoC)(!rB \iJ\space PtoC)% + \psline[linewidth=0.015,linecolor=black!80](!rB 0.11 mul \iM\space PtoC)(!rB \iJ\space 10 sub PtoC)% + }% + \psline[linewidth=0.04,linecolor=black!90](!rB 0.3 sub -85 PtoC)(!rB 0.4 sub -85 PtoC)% + \psline[linewidth=0.048,linecolor=black!90](!rB 0.4 sub -85 PtoC)(!rB 0.44 sub -85 PtoC)% + \pscircle[dimen=outer,linewidth=0.3,linecolor=black!90]{!rB}% + \pscircle[dimen=outer,linewidth=0.09,linecolor=gray!20]{!rB 0.18 sub}% +} + +\def\TractorFrontWheel{% + \pscircle*(0,0){0.25}% + % 0.5=rF/2 0.2=rF/5 + \pscircle[linewidth=0.5,dimen=outer](0,0){!rF} + \multido{\iA=0+36}{10}{\psline[linewidth=2pt,linecolor=red](0,0)(!rF 2 div \iA\space PtoC)(!rF \iA\space PtoC)}% + \pscircle[dimen=outer,linewidth=0.3,linecolor={[rgb]{0.95 0.95 0}}](0,0){!rF 2 div} + \pscircle(0,0){!rF 5 div} + \multido{\iA=0+36}{10}{\psline[linewidth=2pt](0,0)(!rF 2 div \iA\space PtoC)}% +}% + +\def\TractorRearWheel{% + \pscircle*(0,0){0.25}% + % 0.7=rB/2 0.28=rb/5 + \pscircle[linewidth=0.7,dimen=outer](0,0){!rB} + \multido{\iA=0+36}{10}{% + \psline[linewidth=2pt,linecolor=red](0,0)(!rB 2 div \iA\space PtoC)(!rB \iA\space PtoC)% + }% + \pscircle[dimen=outer,linewidth=0.42,linecolor={[rgb]{0.95 0.95 0}}](0,0){!rB 2 div} + \pscircle(0,0){!rB 5 div} + \multido{\iA=0+36}{10}{\psline[linewidth=2pt](0,0)(!rB 2 div \iA\space PtoC)}% +}% diff --git a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle.tex b/graphics/pstricks/contrib/pst-vehicle/tex/pst-vehicle.tex index a971eaae9f..0029a34ea3 100644 --- a/graphics/pstricks/contrib/pst-vehicle/pst-vehicle.tex +++ b/graphics/pstricks/contrib/pst-vehicle/tex/pst-vehicle.tex @@ -1,3 +1,4 @@ +%% $Id: pst-vehicle.tex 376 2021-12-29 12:28:42Z herbert $ %% %% This is file `pst-vehicle.tex', %% @@ -9,6 +10,7 @@ %% with the collaboration of %% Juergen Gilg %% Manuel Luque +%% Herbert Voß (bugfixes) %% %% This program can redistributed and/or modified under %% %% the terms of the LaTeX Project Public License %% @@ -27,8 +29,8 @@ \ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex\fi \ifx\PSTplotLoaded\endinput\else\input pst-plot.tex\fi \ifx\PSTnodeLoaded\endinput\else\input pst-node.tex\fi -\def\fileversion{1.2} -\def\filedate{2017/09/16} +\def\fileversion{1.3} +\def\filedate{2021/12/29} \message{`PST' v\fileversion, \filedate} \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -51,7 +53,9 @@ \define@boolkey[psset]{pst-vehicle}[Pst@]{showSlope}[true]{} % \define@boolkey[psset]{pst-vehicle}[Pst@]{MonoAxis}[false]{} % %\define@boolkey[psset]{pst-vehicle}[Pst@]{EqValveStartPos}[true]{} % -\input{ListVehicles.tex} + +\input{pst-vehicle.data} + \psset[pst-vehicle]{gang=1,epsilon=1e-6,rB=1.6,rF=1.6,d=5.8,vehicle=\Bike,ownvehicle=,backwheel=\wheelA,frontwheel=\wheelA,showSlope=true,% startPos=0,MonoAxis=false,GravNode=dA12 2 div 1} \psset{algebraic} @@ -70,7 +74,7 @@ startPos=0,MonoAxis=false,GravNode=dA12 2 div 1} \begin@SpecialObj \pst@Verb{% /rpn { tx@AlgToPs begin AlgToPs end cvx } def% - /x0 #2 def % -------------- x-Wert des Punktes auf der Kurve, wo das Hinterrad die Kurve berührt; von diesem Wert startet die Rechnung + /X0 #2 def % -------------- x-Wert des Punktes auf der Kurve, wo das Hinterrad die Kurve berührt; von diesem Wert startet die Rechnung /XST \pst@startPos\space def % Untergrenze für die Integration bei der Rotationswinkelbestimmung %---- % Definition of the function f(x), its first derivative f'(x) and \sqrt{1+f'(x)^2} Definition de la fonction et la premiere derivee /func (#3) rpn def @@ -80,9 +84,9 @@ startPos=0,MonoAxis=false,GravNode=dA12 2 div 1} /dABdiff (Derive(1,sqrt(1+(Derive(1,#3))^2))) rpn def /x XST def func /funcxST exch def %---- f(XST) /x XST def Diff /DiffxST exch def %---- f'(XST) - /x x0 def func /funcx0 exch def % ----- f(x0) - /x x0 def Diff /Diffx0 exch def % ----- f'(x0) - /x x0 def DiffI /DiffIx0 exch def % --- f''(x0) + /x X0 def func /funcX0 exch def % ----- f(X0) + /x X0 def Diff /DiffX0 exch def % ----- f'(X0) + /x X0 def DiffI /DiffIX0 exch def % --- f''(X0) %----------------------------------------------------------------------------------------------------------------------- /eps \pst@epsilon def % Definition of a transmission between frontwheel and backwheel (interesting for vehicles with pedals) --- Gangschaltung @@ -97,12 +101,12 @@ startPos=0,MonoAxis=false,GravNode=dA12 2 div 1} /rBs rB skal mul def %--------% dA12 = Distance between the axes of the wheels ----- Achsabstand --- distance entre les axes /dA12s dA12 skal mul def -/tA 1 1 Diffx0 dup mul add sqrt div def% -/deltax0 tA Diffx0 mul rBs mul def -/deltay0 tA rBs mul def +/tA 1 1 DiffX0 dup mul add sqrt div def% +/deltaX0 tA DiffX0 mul rBs mul def +/deltaY0 tA rBs mul def %----------------------------------------------------------------------------------------------------------------------------------------- -/Function ((x-x0+rBs*Diffx0/(sqrt(1+(Diffx0)^2))-rFs*(Diff)/(sqrt(1+(Diff)^2)))^2+% - (func-funcx0+rFs/(sqrt(1+(Diff)^2))-rBs/(sqrt(1+(Diffx0)^2)))^2-dA12s^2) rpn def +/Function ((x-X0+rBs*DiffX0/(sqrt(1+(DiffX0)^2))-rFs*(Diff)/(sqrt(1+(Diff)^2)))^2+% + (func-funcX0+rFs/(sqrt(1+(Diff)^2))-rBs/(sqrt(1+(DiffX0)^2)))^2-dA12s^2) rpn def %----------------------------------------------------------------------------------------------------------------------------------------- /FunctionST ((x-XST+rBs*DiffxST/(sqrt(1+(DiffxST)^2))-rFs*(Diff)/(sqrt(1+(Diff)^2)))^2+% (func-funcxST+rFs/(sqrt(1+(Diff)^2))-rBs/(sqrt(1+(DiffxST)^2)))^2-dA12s^2) rpn def @@ -110,7 +114,7 @@ startPos=0,MonoAxis=false,GravNode=dA12 2 div 1} /Zeros { %% Funktion xinf 1 dict begin /Xinf exch def % ---------------------------------- Untergrenze für die Schnittpunktsuche des Vorderrades mit der Kurve -% superior value to search for the intersection point of the frontwheel with the curve = x0 + distance axes + radius frontwheel + radius backwheel +% superior value to search for the intersection point of the frontwheel with the curve = X0 + distance axes + radius frontwheel + radius backwheel /Xsup Xinf dA12s add rBs rFs add add def % ---------- Obergrenze für die Schnittpunktsuche des Vorderrades mit der Kurve %---% Calculating the intersection point of the frontwheel with the function------ Schnittpunktberechnung --------------------------------- /NB 0 def %-----------------loop-variable ----- Laufvariable für loop @@ -135,7 +139,7 @@ xM % \ifPst@EqValveStartPos /FUNK {FunctionST} def XST Zeros /FWxST exch def % \else /FWxST XST def \fi -/FUNK {Function} def x0 Zeros /FWx exch def +/FUNK {Function} def X0 Zeros /FWx exch def /FWy /x FWx def func def %----------------------- Berührpunkt des Vorderrades (FWx,FWy) /mFWy /x FWx def Diff def %----------------------- mFWy = Tangentensteigung in (FWx,FWy) /TermFW 1 1 mFWy dup mul add sqrt div def % 1/sqrt(1+f'(x_Q)^2) @@ -152,8 +156,8 @@ xM X1 X2 /x {dPhiF} eps SIMPSON } def % % length of the curve for the wheels -- La longueur de la courbe pour la roue avant --- Kurvenlänge -/X1 XST def /X2 x0 def % Integral_{0}^{x0} -/sB AngleCumB def % ---backwheel - length from 0 to x0 ---- roue arrière ---- Kurvenlänge von 0 bis x0 (Hinterrad) +/X1 XST def /X2 X0 def % Integral_{0}^{X0} +/sB AngleCumB def % ---backwheel - length from 0 to X0 ---- roue arrière ---- Kurvenlänge von 0 bis X0 (Hinterrad) /X1 FWxST def /X2 FWx def /sF AngleCumF def % --frontwheel - length from 0 to the abscissa of the intersection frontwheel with curve - roue avant -- Kurvenlänge von 0 bis zum SP Vorderrad - Kurve %-------------------------------------------------------------------------------------------------------------------- @@ -166,8 +170,8 @@ xM %---------------------------------------------------------------------------------------------------------------------- /AFx FWx deltaxFW sub def % % x-coordinate front axis x-Koordinate der Vorderradachse /AFy FWy deltayFW add def % % y-coordinate front axis y-Koordinate der Vorderradachse -/ABx x0 deltax0 sub def % % x-coordinate back axis x-Koordinate der Hinterradachse -/ABy funcx0 deltay0 add def % % y-coordinate back axis y-Koordinate der Hinterradachse +/ABx X0 deltaX0 sub def % % x-coordinate back axis x-Koordinate der Hinterradachse +/ABy funcX0 deltaY0 add def % % y-coordinate back axis y-Koordinate der Hinterradachse %--------------- Koordinaten der Vorderradachse im System des Fahrzeugs, also unskalierte Größen verwenden --( innerhalb der \psscalebox ) %--coordinates for the front axis of the wheels within \psscalebox -- Die Koordinaten der Hinterradachse sind im System des Fahrzeugs (0,0) /AF1x dA12 dup mul rF rB sub dup mul sub sqrt def @@ -179,12 +183,12 @@ xM % whole angle (correction with +180 in case the whole angle gets 90 degrees which can be possible with not equal radii) /gamma beta alpha add AFx ABx lt { 180 add } if def % gesamter Neigungswinkel des Fahrzeugs %--------% Special case (mono-axis vehicle) Nr 4 --> segway --------------------------------------------------------------------------- -\ifPst@MonoAxis Diffx0 1 atan /omega exch def Diffx0 /mVehicle exch def \else FWy funcx0 sub FWx x0 sub div /mVehicle exch def mVehicle 1 atan /omega exch def \fi -/normNorm FWy funcx0 eq { 1 } { x0 FWx sub FWy funcx0 sub div dup mul 1 add sqrt } ifelse def -/mTgy FWy funcx0 eq { 1 } { x0 FWx sub FWy funcx0 sub div normNorm div } ifelse def -/mTgx FWy funcx0 eq { 0 } { 1 normNorm div } ifelse def -/xMTg x0 FWx add 2 div def -/yMTg funcx0 FWy add 2 div def +\ifPst@MonoAxis DiffX0 1 atan /omega exch def DiffX0 /mVehicle exch def \else FWy funcX0 sub FWx X0 sub div /mVehicle exch def mVehicle 1 atan /omega exch def \fi +/normNorm FWy funcX0 eq { 1 } { X0 FWx sub FWy funcX0 sub div dup mul 1 add sqrt } ifelse def +/mTgy FWy funcX0 eq { 1 } { X0 FWx sub FWy funcX0 sub div normNorm div } ifelse def +/mTgx FWy funcX0 eq { 0 } { 1 normNorm div } ifelse def +/xMTg X0 FWx add 2 div def +/yMTg funcX0 FWy add 2 div def }% %------------------------%%%% END OF PS-CODE %%%%%-------------------------------------------------------- \pnode(!FWx FWy){FW}% @@ -196,19 +200,19 @@ xM \pnode(!\pst@GravNode){GravC}% \pst@vehicle}}% \ifPst@showSlope -\rput{!omega}(!x0 mVehicle 0 ge { 0 add } { 100 add } ifelse funcx0 0.75 sub){% +\rput{!omega}(!X0 mVehicle 0 ge { 0 add } { 100 add } ifelse funcX0 0.75 sub){% \psframebox[fillstyle=solid,fillcolor=greenSlp,linestyle=none]{\footnotesize\color{white}$m\geq 0$}} -\rput{!omega}(!x0 mVehicle 0 lt { 0 add } { 100 add } ifelse funcx0 0.75 sub){% +\rput{!omega}(!X0 mVehicle 0 lt { 0 add } { 100 add } ifelse funcX0 0.75 sub){% \psframebox[fillstyle=solid,fillcolor=redSlp,linestyle=none]{\footnotesize\color{white}$m < 0$}} \ifPst@MonoAxis -\psplotTangent[linewidth=0.75\pslinewidth,linecolor=orange,nodesep=-2]{x0}{1}{#3} -\psplotTangent[linewidth=0.75\pslinewidth,linecolor=greenSlp,Tnormal,nodesep=-2]{x0}{1}{#3} -\psdot[linecolor=red](!x0 funcx0) +\psplotTangent[linewidth=0.75\pslinewidth,linecolor=orange,nodesep=-2]{X0}{1}{#3} +\psplotTangent[linewidth=0.75\pslinewidth,linecolor=greenSlp,Tnormal,nodesep=-2]{X0}{1}{#3} +\psdot[linecolor=red](!X0 funcX0) \else \pcline[linecolor=greenSlp,nodesepA=-1,nodesepB=-3](!xMTg yMTg)(!xMTg mTgy 0 ge { mTgx } { mTgx neg } ifelse add yMTg mTgy abs add) -\pcline[linecolor=magenta,nodesep=-2](FW)(!x0 funcx0) +\pcline[linecolor=magenta,nodesep=-2](FW)(!X0 funcX0) \psdot[linecolor=red](FW) -\psdot[linecolor=red](!x0 funcx0) +\psdot[linecolor=red](!X0 funcX0) \fi% \fi% \showpointsfalse |