马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 st788796 于 2013-11-19 11:32 编辑
 - (Defun XD::Polyline:IsPolygon (e / pts tf pcen)
- (setq tf
- (and
- (= (xdrx_getpropertyvalue e "IsA") "AcDbPolyline")
- (not (xdrx_polyline_hasbulges e))
- (xdrx_polyline_compress e)
- (setq pts (xdrx_getpropertyvalue e "Vertices"))
- (setq pcen (apply 'xdrx_points_centroid pts))
- (apply '=
- (mapcar '(lambda (x) (rtos (distance pcen x) 2 8)) pts)
- )
- (apply
- '=
- (mapcar
- '(lambda (x) (rtos (apply 'distance x) 2 8))
- (XD::List:SnakePair (XD::Pnts:Close pts))
- )
- )
- )
- )
- (if tf
- (if (xdrx_curve_isclosed e)
- (length pts)
- (if (equal (last pts) (car pts) 1e-8)
- (1- (length pts))
- nil
- )
- )
- tf
- )
- )
|