%% syntaxe : A B k segment_inter_planz --> array true ou false
/segment_inter_planz {
4 dict begin
/k exch def
/B defpoint3d
/A defpoint3d
A /zA exch def pop pop
B /zB exch def pop pop
zA k sub zB k sub mul dup 0 gt {
%% pas d intersection
pop
false
} {
0 eq {
%% intersection en A ou en B
[
zA k eq {A} if
zB k eq {B} if
] true
} {
%% intersection entre A et B
[
A B vecteur3d
k zA sub zB zA sub div mulv3d
A addv3d
] true
} ifelse
} ifelse
end
} def
|