;; | ---------------------------------------------------------------------------- ;; | GE_GetSegmentPoints ;; | ---------------------------------------------------------------------------- ;; | Function : Returns a list of all segment start and end points from a list ;; | of points ;; | Arguments: ;; | 'vlist' - List of points ;; | 'Closed' - Flag to indicate if the polygon is closed ;; | Action : Returns a list of segment points ;; | Updated : February 8, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_GetSegmentPoints( vlist Closed / SegPtLst cnt len pt1 pt2 ) (setq SegPtLst '()) (if vlist (progn (setq len (length vlist) cnt 0 ) (repeat (1- len) (setq pt1 (nth cnt vlist) pt2 (nth (1+ cnt) vlist) SegPtLst (cons (list pt1 pt2) SegPtLst) cnt (1+ cnt) ) ) (if Closed (setq SegPtLst (cons (list (last vlist) (car vlist)) SegPtLst)) ) (setq SegPtLst (reverse SegPtLst)) )) SegPtLst )