ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
trans 功能:将pt从from坐标系变换到to坐标系 函数签名 ~~~ (trans pt from to [disp]) ~~~ 参数: pt 类型是list,几何含义是点或向量 from 类型是 int 或list 或ename,几何含义是 坐标系 to 同 from disp 类型 任意,如果为非nil,表明pt是3d向量 如果from或to 的类型是int,则含义如下: 0---WCS 1---当前UCS 2---DCS 3---图纸空间DCS 如果from或to是ename类型,则表示此参数是ename的OCS 如果from或to是list类型,则表示此参数是由这个list根据任意轴算法生成的坐标系 ucs wcs相关示例: ``` (defun test1 (disp / pt pt2 osmode) (setq oldosmode (getvar "osmode")) (setvar "osmode" (logior (getvar "osmode") 16384)) (setq pt (list 1 1 1)) (command "ucs" "") (command "ucs" '(10 0 0) "") (setq pt2 (trans pt 0 1 disp)) (princ "\\n变换后坐标是:") (princ pt2) (setvar "osmode" oldosmode) (princ) ) (defun test2 (disp / pt pt2 osmode) (setq oldosmode (getvar "osmode")) (setvar "osmode" (logior (getvar "osmode") 16384)) (setq pt (list 1 1 1)) (command "ucs" "") (command "ucs" "x" "45") (setq pt2 (trans pt 0 1 disp)) (princ "\\n变换后坐标是:") (princ pt2) (setvar "osmode" oldosmode) (princ) ) (defun test3 (disp / pt pt2 osmode) (setq oldosmode (getvar "osmode")) (setvar "osmode" (logior (getvar "osmode") 16384)) (setq pt (list 1 1 1)) (command "ucs" "") (command "ucs" '(10 0 0) "") (command "ucs" "x" "45") (setq pt2 (trans pt 0 1 disp)) (princ "\\n变换后坐标是:") (princ pt2) (setvar "osmode" oldosmode) (princ) ) (test1 nil) ;结果(-9.0 1.0 1.0) (test1 t) ;结果(1.0 1.0 1.0) (test2 nil) ;结果 (1.0 1.41421 -1.11022e-016) (test2 t) ;结果 (1.0 1.41421 -1.11022e-016) (test3 nil) ;结果 (-9.0 1.41421 -1.11022e-016) (test3 t) ;结果 (1.0 1.41421 -1.11022e-016) ```