;; ! **************************************************************************** ;; ! GE_pist3d2d ;; ! **************************************************************************** ;; ! Function : Converts a 3D points list to 2D points list ;; ! Arguments: ;; ! 'vlist' - List of 3d points ;; ! 'Mode' - Can be eithe rof the strings ;; ! "Zero" - Sets all elevations to 0.0 ;; ! "Lowest" - Sets the Z to the lowest value ;; ! "Highest" - Sets the Z to the highest value ;; ! "First" - Sets all elevations to first elevation ;; ! "Average" - Averages all the elevations and sets ;; ! it to every point. ;; ! Action : Returns the points list with the Z component reset to 0.0 ;; ! Updated : February 25, 1999 ;; ! (C) 1999-2004, Four Dimension Technologies, Bangalore ;; ! e-mail : rakesh.rao@4d-technologies.com ;; ! Web : www.4d-technologies.com ;; ! **************************************************************************** (defun GE_plist3d2d( vlist Mode / Z X ) (cond ((= Mode "Zero") (setq Z 0.0) ) ((= Mode "Lowest") (setq Z (apply 'min (mapcar 'caddr vlist))) ) ((= Mode "Highest") (setq Z (apply 'max (mapcar 'caddr vlist))) ) ((= Mode "First") (setq Z (caddr (car vlist))) ) ((= Mode "Average") (setq Z (/ (apply '+ (mapcar 'caddr vlist)) (length vlist))) ) ) (mapcar '(lambda(x) (list (car x) (cadr x) Z)) vlist) )