;; | ---------------------------------------------------------------------------- ;; | GE_GetSegmentLengths ;; | ---------------------------------------------------------------------------- ;; | Function : Returns a list of all segment lengths from a list of points ;; | Arguments: ;; | 'vlist' - List of points ;; | 'Closed' - Flag to indicate if the polygon is closed ;; | '2d' - Flag to indicate if the distance measured is 2d ;; | Action : Returns a list of segment lengths ;; | Updated : February 8, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_GetSegmentLengths( vlist Closed 2d / SegPtLst LenLst pt1 pt2 ) (setq SegPtLst (GE_GetSegmentPoints vlist Closed) LenLst '() ) (foreach Seg SegPtLst (setq pt1 (car Seg) pt2 (cadr Seg) pt1 (if 2d (list (car pt1) (cadr pt1) 0.0) pt1) pt2 (if 2d (list (car pt2) (cadr pt2) 0.0) pt2) LenLst (cons (distance pt1 pt2) LenLst) ) ) (setq LenLst (reverse LenLst)) )