%% syntaxe : z0 r0 z1 r1 newtronccone -> solid
/newtronccone {
11 dict begin
[[/n /N] [1 6] [1 8] [1 10] [3 12] [5 18]] gestionsolidmode
/r1 exch def
/z1 exch def
/r0 exch def
/z0 exch def
/dz z1 z0 sub n div def
/dr r1 r0 sub n div def
/FE [
[0 1 N 1 sub {} for]
[n 1 add N mul 1 sub -1 n N mul {} for]
0 1 n 1 sub {
/k exch def
k N mul 1 add 1 k 1 add N mul 1 sub {
/i exch def
[i i 1 sub N i add 1 sub N i add]
} for
[k N mul k 1 add N mul 1 sub k 2 add N mul 1 sub k 1 add N mul]
} for
] def
%% tableau des sommets
/S [
n -1 0 {
/k exch def
0 1 N 1 sub {
/i exch def
360 N idiv i mul cos r0 dr k mul add mul
360 N idiv i mul sin r0 dr k mul add mul
z0 dz k mul add
} for
} for
] def
S FE generesolid
end
} def
%% syntaxe : z0 r0 z1 r1 newtroncconecreux -> solid
/newtroncconecreux {
newtronccone
dup creusesolid
} def
|