Fichier noeud_22.jps — Modifié le 18 Février 2008 à 23 h 58

noeud_22.pdf
Source
%% d'apres les donnees de
%% http://www.mathcurve.com/courbes3d/solenoidtoric/solenoidtoric.shtml

-3 3 setxrange
-3 3 setyrange
100 setxunit

50.01 50 50 SetCamPos
0 0 0 SetCamView
%/ScreenDist .05 def

-10 10 setxrange3d
-3 3 setyrange3d
2 setlinejoin


/m 12 def %% ex R
/r 8 def
/n 3 1 div def

/g {
3 dict begin
   settvar
#rpn# (m+r*Cos(n*t))*Cos(t)
#rpn# (m+r*Cos(n*t))*Sin(t)
#rpn# r*Sin(n*t)
end
} def

/g' {
3 dict begin
   settvar
#rpn# -n*r*Sin(n*t)*Cos(t) - (m+r*Cos(n*t))*Sin(t)
#rpn# -n*r*Sin(n*t)*Sin(t) + (m+r*Cos(n*t))*Cos(t)
#rpn# n*r*Cos(n*t)
end
} def

/g'' {
3 dict begin
   settvar
#rpn# -n^2*r*Cos(n*t)*Cos(t) +n*r*Sin(n*t)*Sin(t) + n*r*Sin(n*t)*Sin(t) - (m+r*Cos(n*t))*Cos(t)
#rpn# -n^2*r*Cos(n*t)*Sin(t) -n*r*Sin(n*t)*Cos(t) - (n*r*Sin(n*t))*Cos(t) - (m+r*Cos(n*t))*Sin(t)
#rpn# -n^2*r*Sin(n*t)
end
} def

%rouge
%0 pi 4 mul {g} CourbeR3
% stop

.1 setlinewidth
/aretescachees false def

GetCamPos setlightsrc
%solidgridOff

%0 4 pi mul (g) .5 [200 8] newtube
%dup (tube-01.obj) writeobjfile

(tube-01.obj) newobjfile
dup [0 .1] solidputhuecolors

(tube-01-45.obj) newobjfile
dup [.1 .2] solidputhuecolors
solidfuz

(tube-01.obj) newobjfile
{0 0 80 rotateOpoint3d} solidtransform
dup [.2 .3] solidputhuecolors
solidfuz

(tube-01-135.obj) newobjfile
dup [.3 .4] solidputhuecolors
solidfuz

(tube-01-180.obj) newobjfile
dup [.4 .5] solidputhuecolors
solidfuz

(tube-01-225.obj) newobjfile
dup [.5 .6] solidputhuecolors
solidfuz

(tube-01-270.obj) newobjfile
dup [.6 .7] solidputhuecolors
solidfuz

(tube-01-315.obj) newobjfile
dup [.7 .8] solidputhuecolors
solidfuz
%dup (test.dat) writedisttable
%stop
[(noeud_22-tri.dat) run] {1 sub} apply
drawsolid**