Hi Ymg,
In my head , Longer code still requires a larger computer memory , so shorting the codes is necessary for reduce computer memory usage , if we have enough computer memory , we also can build other ways list for contour routine to replace a large number of 'nth' . So we have to compare the speed after complied the file .
In the contour routine , make a zl will speed up some .
...
(setq ti (car (_VL-TIMES)) ; Re-initialize timer for Contouring
zl (mapcar (function caddr) pl) ;_only for zlist
zmin (apply (function min) zl) ;_improve speed by GSLS(SS) 2014.3.2
zmax (apply (function max) zl)
zmin (* (fix (/ zmin intv)) intv) ;_zmin, first level for contour. (* (+ (fix (/ zmin intv)) 1) intv)
zmax (* (fix (/ zmax intv)) intv) ;_ zmax; last level for contour.
z zmin ; Initialize Current Contour level.
...
)
(setq tl (vl-sort tl
(function
(lambda (a b)
(< (max (nth (car a) zl)
(nth (cadr a) zl)
(nth (caddr a) zl))
(max (nth (car b) zl)
(nth (cadr b) zl)
(nth (caddr b) zl)))))))
...