%% syntaxe : x y z [normal] projpath --> planprojpath
%% syntaxe : x y z [normal] bool projpath --> planprojpath
%% syntaxe : solid i projpath --> solidprojpath
%% syntaxe : solid i bool projpath --> solidprojpath
%% syntaxe : solid i str bool projpath --> solidprojpath
%% syntaxe : solid i alpha str bool projpath --> solidprojpath
/projpath {
2 dict begin
dup isbool {
/mybool exch def
} {
/mybool true def
} ifelse
dup isplan {
3 dict begin
/lepl@n exch def
lepl@n plangetbase aload pop
/@V defpoint3d
/@U defpoint3d
lepl@n plangetorigine
[@U @U @V vectprod3d] mybool planprojpath
end
} {
dup isarray {
mybool planprojpath
} {
mybool solidprojpath
} ifelse
} ifelse
end
} def
%% %% syntaxe : x y z [normal] projpath --> planprojpath
%% %% syntaxe : x y z [normal] bool projpath --> planprojpath
%% %% syntaxe : solid i projpath --> solidprojpath
%% %% syntaxe : solid i bool projpath --> solidprojpath
%% %% syntaxe : solid i str bool projpath --> solidprojpath
%% %% syntaxe : solid i alpha str bool projpath --> solidprojpath
%% /projpath {
%% 2 dict begin
%% dup isbool {
%% /mybool exch def
%% } {
%% /mybool true def
%% } ifelse
%% dup isarray {
%% mybool planprojpath
%% } {
%% mybool solidprojpath
%% } ifelse
%% end
%% } def
%%
%% syntaxe : solid i str bool solidprojpath --> -
%% ou
%% syntaxe : solid i alpha str bool solidprojpath --> -
%% projette le chemin courant sur la face i du solide, apres
%% eventuellement une rotation d angle alpha autour de la normale
%% bool : pour savoir si on tient compte de la visibilite
/solidprojpath {
5 dict begin
/visibility exch def
dup isstring {
/option exch def
} if
2 copy pop
issolid {
/alpha 0 def
} {
/alpha exch def
} ifelse
/i exch def
/solid exch def
solid issolid not {
(Error : mauvais type d argument dans solidprojpath) ==
} if
/n solid solidnombrefaces def
i n 1 sub le {
visibility not solid i solidfacevisible? or {
currentdict /option known {
option cvx exec
} {
solid i solidcentreface
} ifelse
[
solid 0 i solidgetsommetface
solid 1 i solidgetsommetface
vecteur3d normalize3d
solid i solidnormaleface alpha
] false planprojpath
} {
newpath 0 0 smoveto
} ifelse
} {
(Error : indice trop grand dans solidprojpath) ==
quit
} ifelse
end
} def
%% syntaxe : x y z [normal] bool planprojpath
/planprojpath {
6 dict begin
/visibility exch def
%% on calcule l image de la base (I,J,K)
normalvect_to_orthobase
/imageK defpoint3d
/imageJ defpoint3d
/imageI defpoint3d
/z exch def
/y exch def
/x exch def
visibility not x y z imageK planvisible? or {
{ptojpoint 0
imageI
imageJ
imageK
transformpoint3d
x y z addv3d
3dto2d jtoppoint} currentppathtransform
} {
newpath
} ifelse
end
} def
|