\documentclass[11pt,a4paper,oneside]{article}
\usepackage{pdftricks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcount\Fa\newcount\Fct\newcount\tempA
\def\Factor{\ifnum\Fa=1\relax\else\advance\Fa by -1\multiply\Fct by \Fa\Factor\fi}
\def\FACTORIAL#1{\Fa=#1 \ifnum\Fa=0 \Fct=1\relax\else\Fct=\Fa \Factor\fi\global\tempA=\Fct}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcount\BINOM
\newcount\temp
\newcount\tmp
\def\BINOMIAL#1#2{%
\temp=#1\advance\temp by -#2
\FACTORIAL{#1}
\tmp=\tempA
\FACTORIAL{\temp}
\temp=\tempA
\divide\tmp by \temp
\FACTORIAL{#2}
\temp=\tempA
\divide\tmp by \temp\global\BINOM=\tmp}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\xch{\catcode`\p=12 \catcode`\t=12}\def\ych{\catcode`\p=11 \catcode`\t=11}
\xch \def\dec#1pt{#1}\ych \def\decimal#1{\expandafter\dec \the#1}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newdimen\Xa\newdimen\Yb\newcount\kc
\newdimen\BSTemp
\def\xmult#1{\ifnum\kc<#1\advance\kc by 1\Yb=\decimal\Xa\Yb\xmult{#1}\else\relax\fi}
\def\BERNSTEIN#1#2#3{\Xa=#3pt\kc=0\Yb=1pt\xmult{#1}\kc=0\Xa=-\Xa\advance\Xa by 1pt\xmult{#2}
\BINOMIAL{5}{#1}\global\BSTemp=\BINOM\Yb}

\newdimen\Xrf
\newdimen\Yrf
\newdimen\XoneBST\newdimen\YoneBST
\newdimen\XtwoBST\newdimen\YtwoBST
\newdimen\XBST\newdimen\YBST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\XoneBC#1{%
\BERNSTEIN{2}{3}{#1}
\Xrf=1.5pt
\XoneBST=\decimal\BSTemp\Xrf
\BERNSTEIN{3}{2}{#1}
\Xrf=3pt
\advance\XoneBST by \decimal\BSTemp\Xrf
\BERNSTEIN{4}{1}{#1}
\Xrf=5pt
\advance\XoneBST by \decimal\BSTemp\Xrf
\BERNSTEIN{5}{0}{#1}
\Xrf=5pt
\advance\XoneBST by \decimal\BSTemp\Xrf
\global\XBST=\XoneBST}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\XtwoBC#1{%
\BERNSTEIN{0}{5}{#1}
\Xrf=5pt
\XtwoBST=\decimal\BSTemp\Xrf
\BERNSTEIN{1}{4}{#1}
\Xrf=5pt
\advance\XtwoBST by \decimal\BSTemp\Xrf
\BERNSTEIN{2}{3}{#1}
\Xrf=3.5pt
\advance\XtwoBST by \decimal\BSTemp\Xrf
\BERNSTEIN{3}{2}{#1}
\Xrf=2pt
\advance\XtwoBST by \decimal\BSTemp\Xrf
\global\XBST=\XtwoBST}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\YoneBC#1#2#3{%
\BERNSTEIN{1}{4}{#1}
\Yrf=1.5pt
\YoneBST=\decimal\BSTemp\Yrf
\BERNSTEIN{2}{3}{#1}
\Yrf=1pt
\Yrf=#2\Yrf
\advance\YoneBST by \decimal\BSTemp\Yrf
\BERNSTEIN{3}{2}{#1}
\Yrf=2pt
\Yrf=#3\Yrf
\advance\YoneBST by \decimal\BSTemp\Yrf
\BERNSTEIN{4}{1}{#1}
\Yrf=1.5pt
\advance\YoneBST by \decimal\BSTemp\Yrf
\global\YBST=\YoneBST}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\YtwoBC#1#2#3{%
\BERNSTEIN{1}{4}{#1}
\Yrf=-1.5pt
\YtwoBST=\decimal\BSTemp\Yrf
\BERNSTEIN{2}{3}{#1}
\Yrf=-1pt
\Yrf=#2\Yrf
\advance\YtwoBST by \decimal\BSTemp\Yrf
\BERNSTEIN{3}{2}{#1}
\Yrf=-2pt
\Yrf=#3\Yrf
\advance\YtwoBST by \decimal\BSTemp\Yrf
\BERNSTEIN{4}{1}{#1}
\Yrf=-1.5pt
\advance\YtwoBST by \decimal\BSTemp\Yrf
\global\YBST=\YtwoBST}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\XoneFive{15*t^2*(1-t)^3+30*t^3*(1-t)^2+25*t^4*(1-t)+5*t^5}
\def\YoneFive#1#2{7.5*t*(1-t)^4+(#1)*10*t^2*(1-t)^3+(#2)*20*t^3*(1-t)^2+7.5*t^4*(1-t)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\XtwoFive{5*(1-t)^5+25*t*(1-t)^4+35*t^2*(1-t)^3+20*t^3*(1-t)^2}
\def\YtwoFive#1#2{(-7.5)*t*(1-t)^4+(#1)*(-10)*t^2*(1-t)^3+(#2)*(-20)*t^3*(1-t)^2+(-7.5)*t^4*(1-t)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\NetDrawOne#1#2#3{%
\newdimen\Xsize
\newdimen\Ysize
\newdimen\tempx
\newdimen\tempy
\Xsize=7pt \divide\Xsize by #1
\Ysize=6pt \divide\Ysize by #1
\parametricplot[algebraic,fillstyle=solid,fillcolor=yellow!85,plotpoints=200,linewidth=0.5pt]{0}{1}
{\XoneFive|\YoneFive{#2}{#3}}
\multido{\nz=0.00+0.005}{200}{\XoneBC{\nz}\YoneBC{\nz}{#2}{#3}
\multido{\nx=-1.00+\decimal\Xsize}{#1}
{\tempx=\nx pt\multido{\ny=-3.00+\decimal\Ysize}{#1}
{\tempy=\ny pt\ifdim\YBST<\tempy\relax\else\advance\tempy by \Ysize
 \ifdim\YBST>\tempy\relax\else
 \ifdim\XBST<\tempx\relax\else\advance\tempx by \Xsize
 \ifdim\XBST>\tempx\relax\else\pspolygon[fillstyle=solid,fillcolor=blue!70,linecolor=black,linewidth=0.2pt]
 (\nx,\ny)(\decimal\tempx,\ny)(\decimal\tempx,\decimal\tempy)(\nx,\decimal\tempy)(\nx,\ny)\fi\fi\fi\fi}
}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\NetDrawTwo#1#2#3{%
\newdimen\Xsize
\newdimen\Ysize
\newdimen\tempx
\newdimen\tempy
\Xsize=7pt \divide\Xsize by #1
\Ysize=6pt \divide\Ysize by #1
\parametricplot[algebraic,fillstyle=solid,fillcolor=yellow!85,plotpoints=200,linewidth=0.5pt]{0}{1}
{\XtwoFive|\YtwoFive{#2}{#3}}
\multido{\nz=0.00+0.005}{200}{\XtwoBC{\nz}\YtwoBC{\nz}{#2}{#3}
\multido{\nx=-1.00+\decimal\Xsize}{#1}
{\tempx=\nx pt\multido{\ny=-3.00+\decimal\Ysize}{#1}
{\tempy=\ny pt\ifdim\YBST<\tempy\relax\else\advance\tempy by \Ysize
 \ifdim\YBST>\tempy\relax\else
 \ifdim\XBST<\tempx\relax\else\advance\tempx by \Xsize
 \ifdim\XBST>\tempx\relax\else\pspolygon[fillstyle=solid,fillcolor=blue!70,linecolor=black,linewidth=0.2pt]
 (\nx,\ny)(\decimal\tempx,\ny)(\decimal\tempx,\decimal\tempy)(\nx,\decimal\tempy)(\nx,\ny)\fi\fi\fi\fi}
}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{Making files \texttt{.ps} from \texttt{PSTricks}}
\begin{document}
\maketitle
\begin{psinputs}
\usepackage{pstricks}
\usepackage[dvips]{geometry}
\usepackage{pst-plot,pst-coil,multido,pst-xkey,pst-node}
\usepackage{calculator}
\usepackage{calculus}
\usepackage{pst-func}
\usepackage{pstricks-add}
\end{psinputs}
\section{Here is the PSTricks code to be converted}
\begin{pdfpic}
\begin{pspicture}(-1,-3)(6,3) \psset{unit=24pt}
\NetDrawOne{54}{1.7}{0.2}
\NetDrawTwo{54}{0.1}{1.8}
\multido{\nx=-1.00+\decimal\Xsize}{55}
{\psline[linewidth=0.2pt](\nx,-3)(\nx,3)}
\multido{\ny=-3.00+\decimal\Ysize}{55}
{\psline[linewidth=0.2pt](-1,\ny)(6,\ny)}
\parametricplot[algebraic,plotpoints=200,linecolor=white,linewidth=0.5pt]{0}{1}{\XoneFive|\YoneFive{1.7}{0.2}}
\parametricplot[algebraic,plotpoints=200,linecolor=white,linewidth=0.5pt]{0}{1}{\XtwoFive|\YtwoFive{0.1}{1.8}}
\end{pspicture}
\end{pdfpic}
\end{document}
