马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 marting 于 2020-4-20 23:42 编辑
使用了XDRX API的几何库函数,用SPLINE,椭圆的面积和转换成弧线的几何模型面积是否在精度内相等判断。
 - (defun XD::Geom:isArc (e tol / pts ge info)
- (if (and (= (type e) 'ename)
- (or (= (strcase (car (xdrx-getpropertyvalue e "classname")))
- "ELLIPSE"
- )
- (= (strcase (car (xdrx-getpropertyvalue e "classname")))
- "SPLINE"
- )
- )
- (setq pts (xdrx_getsamplept e))
- (not (equal (car pts) (last pts) tol))
- (setq ar1 (xdrx-getpropertyvalue e "area"))
- (setq pts (xdrx_getsamplept e))
- (and (setq ge (xdge::constructor
- "kcircarc3d"
- (car pts)
- (cadr pts)
- (last pts)
- )
- )
- (setq ar2 (xdrx-getpropertyvalue ge "area"))
- (setq info (list (xd::pnts:isclockwise pts)
- (xdrx-getpropertyvalue
- ge "center"
- "radius" "startangle"
- "endangle"
- )
- (list (car pts) (cadr pts) (last pts))
- )
- )
- (xdge::free ge)
- )
- (equal (/ (abs (- ar1 ar2)) ar1) 0.0 tol)
- )
- info
- )
- )
|