;; | ---------------------------------------------------------------------------- ;; | GE_PolyInters ;; | ---------------------------------------------------------------------------- ;; | Function : Checks if a given polygon intersects itself in any of its ;; | segments ;; | Arguments: 'vlist' - List of all points of the polygon ;; | 'Closed' - Flag (T of nil) to indicate if polygon is closed. ;; | Returns : 'IPtLst' or 'nil' - IPtLst is a list of all coordiantes where ;; | the intersection occurs ;; | Updated : January 9, 2000 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_PolyInters( vlist Closed / IPtLst _IPtLst IPt Seg SegLst ) (setq SegLst (GE_GetSegmentPoints vlist Closed) IPtLst '() ) (foreach Seg SegLst (if (setq _IPtLst (GE_SegInters (car Seg) (cadr Seg) SegLst T)) (progn (setq _IPtLst (nth 0 _IPtLst)) (foreach IPt _IPtLst (if (not (member IPt IPtLst)) (setq IPtLst (cons IPt IPtLst)) ) ) )) ) IPtLst )