/sortp3d {
6 dict begin
/M1 defpoint3d
/M0 defpoint3d
M1
/z1 exch def
/y1 exch def
/x1 exch def
M0
/z0 exch def
/y0 exch def
/x0 exch def
x0 x1 lt {
M0 M1
} {
x0 x1 gt {
M1 M0
} {
y0 y1 lt {
M0 M1
} {
y0 y1 gt {
M1 M0
} {
z0 z1 lt {
M0 M1
} {
M1 M0
} ifelse
} ifelse
} ifelse
} ifelse
} ifelse
end
} def
|