明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2452|回复: 7

[求助]遍历图块中子图元时,提取子图元的点数据如何不对

[复制链接]
发表于 2009-3-31 00:26 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2009-3-31 0:30:39 编辑

遍历图块中子图元时,提取子图元的点数据为什么不对?(在wcs下就是错误的数据)我知道一定有问题。不知道如何转换。根据cad帮且文件里说的,提取块的转换矩阵数据来进行转换,还是不对。有没有哪位大侠告知一下方法。不胜感谢!能提供一下lisp源码最好。不知各位朋友在写lisp时有没有碰到过类似的问题?
发表于 2009-3-31 14:29 | 显示全部楼层
Goto the website http://acad.fleming-group.com/
Download BIXform.lsp via the link below
http://acad.fleming-group.com/Download/BIXForm/BIXform.zip
It's the perfect reference routine that may help you.
 楼主| 发表于 2009-3-31 16:05 | 显示全部楼层
本帖最后由 作者 于 2009-3-31 16:22:08 编辑

問題已經解決.只是自己利用轉換矩陣轉換時有一個cadr用錯,不過還是多謝alin賜教!看來寫lisp時大家一定要小心.別少一個字母名是多一個字母的.那結果會大不同喲!

很詳細.再次感謝alin!

发表于 2009-4-7 10:20 | 显示全部楼层
仅供参考。
  1. ;|功能:获得块的矩阵----支持三维-----------------
  2. (blkmat (vlax-ename->vla-object(car(entsel))))
  3. |;
  4. (defun    blkmat    (vobj / mxm origin ang inspt zdir xdir ydir rmat movmatrix resmatrix)
  5.    (defun    mxm    (m q / qt)
  6.      (setq qt (apply 'mapcar (cons 'list q)))
  7.      (mapcar '(lambda    (x)    (mapcar '(lambda    (y)    (apply '+ (mapcar '* y x))) qt)) m)
  8.    )
  9.    (and
  10.      (setq origin(vlax-get (vlax-invoke (vlax-get (vlax-get (vlax-get-acad-object)    "Activedocument")    "blocks")
  11.                  "item"  (vlax-get vobj "name"))    "origin"))
  12.      (setq ang (vlax-get vobj "Rotation"))
  13.      (setq inspt (mapcar '- (vlax-get vobj "InsertionPoint") origin));需要增加块定义原点的判断~~~~
  14.      (setq zdir (vlax-get vobj "Normal"))
  15.      (setq xdir(trans    (list    (cos ang)(sin ang)    0) zdir 0))
  16.      (setq ydir(list    (-    (*    (cadr zdir)(caddr xdir))    (*    (caddr zdir)(cadr xdir)));叉乘得到Y轴方向-------
  17.              (-    (*    (caddr zdir)(car xdir))    (*    (car zdir)(caddr xdir)))
  18.              (-    (*    (car zdir)(cadr xdir))    (*    (cadr zdir)(car xdir)))))
  19.      (setq rmat(list    (list    (car xdir)(car ydir)    (car zdir)    0)
  20.              (list    (cadr xdir)(cadr ydir)(cadr zdir)    0)
  21.              (list    (caddr xdir)(caddr ydir)(caddr zdir)    0)))
  22.      (setq rmat(mapcar '(lambda(x y)(mapcar '(lambda(m)(* m y)) x))
  23.                   rmat
  24.                   (list    (vlax-get vobj "XScaleFactor")
  25.                         (vlax-get vobj "YScaleFactor")
  26.                         (vlax-get vobj "ZScaleFactor")
  27.                         )))
  28.      (setq rmat(list    (car rmat)    (cadr rmat)    (caddr rmat) '(0 0 0 1)))
  29.      (setq movmatrix(list    (list    1 0 0    (car inspt))(list    0 1 0    (cadr inspt))(list    0 0 1    (caddr inspt))
  30.                       '(0 0 0 1)))
  31.      (setq rmat (mxm movmatrix rmat))
  32.    )
  33.    rmat
  34. )
  1. (defun    InsertMat    (InsertEname /    InsertEList ZAxis
  2.      NCSXAxis    InsertAngle tmp1       tmp2
  3.      Orig
  4.     )
  5.    (setq ZAxis     (cdr    (assoc    210    (setq InsertEList (entget InsertEName))))
  6.   InsertAngle (cdr    (assoc    50 InsertEList))
  7.   NCSXAxis    (trans    (list    (cos InsertAngle)    (-    (sin InsertAngle))    0.0)
  8.        (cdr    (assoc    210 InsertEList))
  9.        0
  10.        )
  11.   Orig     (mapcar
  12.          '-
  13.          (vlax-get
  14.     (vla-item
  15.       (vla-get-blocks
  16.         (vla-get-activedocument    (vlax-get-acad-object))
  17.       )
  18.       (vlax-get (vlax-ename->vla-object InsertEName) 'Name)
  19.     )
  20.     'Origin
  21.          )
  22.        )
  23.    )
  24.    ;; Set up the return value
  25.    ;; The insertion point of the insert
  26.    (setq tmp1 (trans    (cdr    (assoc    10 InsertEList)) ZAxis 0))
  27.    ;; The scale factors
  28.    (setq tmp2 (list    (cdr    (assoc    41 InsertEList))
  29.       (cdr    (assoc    42 InsertEList))
  30.       (cdr    (assoc    43 InsertEList))
  31.        )
  32.    )
  33.    (mxm
  34.      (list    (append    (mapcar '* NCSXAxis tmp2)    (list    (nth    0 tmp1)))
  35.     (append    (mapcar '* (VectorCrossProduct ZAxis NCSXAxis) tmp2)
  36.      (list    (nth    1 tmp1))
  37.     )
  38.     (append    (mapcar '* ZAxis tmp2)    (list    (nth    2 tmp1)))
  39.     '(0.0 0.0 0.0 1.0)
  40.      )
  41.      (list    (list    1.0 0.0 0.0    (car Orig))
  42.     (list    0.0 1.0 0.0    (cadr Orig))
  43.     (list    0.0 0.0 1.0    (caddr Orig))
  44.     '(0.0 0.0 0.0 1.0)
  45.      )
  46.    )
  47. )
  1. ;; TransNested (gile)
  2. ;; Translates a point coordinates from WCS or UCS to RCS -coordinates system of a
  3. ;; reference (xref or block) whatever its nested level-
  4. ;;
  5. ;; Arguments
  6. ;; pt : the point to translate
  7. ;; rlst : the parents entities list from the deepest nested to the one inserted in
  8. ;;        current space -same as (last        (nentsel)) or (last        (nentselp))
  9. ;; from to : as with trans function: 0 for WCS, 1 for current UCS, 2 for RCS
  10. (defun    TransNested    (pt rlst from to)
  11.    (and    (=    1 from)    (setq pt (trans pt 1 0)))
  12.    (and    (=    2 to)    (setq rlst (reverse rlst)))
  13.    (and    (or    (=    2 from)    (=    2 to))
  14.         (while rlst
  15. (setq geom (if
  16.    (=    2 to)
  17.        (RevRefGeom (car rlst))
  18.        (RefGeom (car rlst))
  19.      )
  20.         rlst (cdr rlst)
  21.         pt   (mapcar '+ (mxv (car geom) pt)    (cadr geom))
  22. )
  23.         )
  24.    )
  25.    (if    (=    1 to)
  26.      (trans pt 0 1)
  27.      pt
  28.    )
  29. )
  30. ;; RefGeom (gile)
  31. ;; Returns a list which first item is a 3x3 transformation matrix (rotation,
  32. ;; scales, normal) and second item the object insertion point in its parent
  33. ;; (xref, bloc or space)
  34. ;;
  35. ;; Argument : an ename
  36. (defun    RefGeom    (ename / elst ang norm mat)
  37.    (setq
  38.    elst (entget ename)
  39. ang  (cdr    (assoc    50 elst))
  40. norm (cdr    (assoc    210 elst))
  41.    )
  42.    (list
  43.      (setq mat
  44.     (mxm
  45.       (mapcar    (function    (lambda    (v)    (trans v 0 norm T)))
  46.       '((1.0 0.0 0.0)    (0.0 1.0 0.0)    (0.0 0.0 1.0))
  47.       )
  48.       (mxm
  49.         (list    (list    (cos ang)    (-    (sin ang))    0.0)
  50.       (list    (sin ang)    (cos ang)    0.0)
  51.       '(0.0 0.0 1.0)
  52.         )
  53.         (list    (list    (cdr    (assoc    41 elst))    0.0 0.0)
  54.       (list    0.0    (cdr    (assoc    42 elst))    0.0)
  55.       (list    0.0 0.0 (cdr    (assoc    43 elst)))
  56.         )
  57.       )
  58.     )
  59.      )
  60.      (trans
  61.        (mapcar
  62. '-
  63. (cdr    (assoc    10 elst))
  64. (mxv mat
  65.       (cdr    (assoc    10    (tblsearch    "BLOCK"    (cdr    (assoc    2 elst)))))
  66. )
  67.        )
  68.        norm
  69.        0
  70.      )
  71.    )
  72. )
  73. ;; RevRefGeom (gile)
  74. ;; RefGeom inverse function
  75. (defun    RevRefGeom    (ename / entData ang norm mat)
  76.    (setq
  77.    entData
  78.    (entget ename)
  79. ang
  80.    (-    (cdr    (assoc    50 entData)))
  81. norm
  82.    (cdr    (assoc    210 entData))
  83.    )
  84.    (list
  85.      (setq mat
  86.     (mxm
  87.       (list    (list    (/    1    (cdr    (assoc    41 entData)))    0.0 0.0)
  88.     (list    0.0    (/    1    (cdr    (assoc    42 entData)))    0.0)
  89.     (list    0.0 0.0 (/    1    (cdr    (assoc    43 entData))))
  90.       )
  91.       (mxm
  92.         (list    (list    (cos ang)    (-    (sin ang))    0.0)
  93.       (list    (sin ang)    (cos ang)    0.0)
  94.       '(0.0 0.0 1.0)
  95.         )
  96.         (mapcar    (function    (lambda    (v)    (trans v norm 0 T)))
  97.         '((1.0 0.0 0.0)    (0.0 1.0 0.0)    (0.0 0.0 1.0))
  98.         )
  99.       )
  100.     )
  101.      )
  102.      (mapcar '-
  103.      (cdr    (assoc    10    (tblsearch    "BLOCK"    (cdr    (assoc    2 entData)))))
  104.      (mxv mat (trans    (cdr    (assoc    10 entData)) norm 0))
  105.      )
  106.    )
  107. )
  108. ;;; VXV Returns the dot product of 2 vectors
  109. (defun    vxv    (v1 v2)
  110.    (apply '+ (mapcar '* v1 v2))
  111. )
  112. ;; TRP Transpose a matrix -Doug Wilson-
  113. (defun    trp    (m)
  114.    (apply 'mapcar (cons 'list m))
  115. )
  116. ;; MXV Apply a transformation matrix to a vector -Vladimir Nesterovsky-
  117. (defun    mxv    (m v)
  118.    (mapcar '(lambda    (r)    (vxv r v)) m)
  119. )
  120. ;; MXM Multiply two matrices -Vladimir Nesterovsky-
  121. (defun    mxm    (m q)
  122.    (mapcar '(lambda    (r)    (mxv (trp q) r)) m)
  123. )
发表于 2009-4-7 10:25 | 显示全部楼层
再贴一个函数:
  1. ;; By Joe Burke with thanks to those who helped.
  2. ;; Revisions version 2 - 1/28/2006.
  3. ;; Fixes a bug when the block definition origin is not (0 0 0).
  4. ;; Added OM:xx sub-functions.
  5. ;; Removed block uniform scale check. Both matrix functions work
  6. ;; with non-uniformly scaled blocks.
  7. ;; Calling functions which use TransformBy should check the block
  8. ;; for uniform scale. TransformBy does not work with a non-uniform matrix.
  9. ;; Revision to version 2 - 1/30/2006.
  10. ;; Added James Allen's functions to calculate the normal matrix
  11. ;; when a block normal is other than (0 0 1) or (0 0 -1).
  12. ;; Test Function
  13. ;; Highlight a deep nested pline segment in a block reference.
  14. ;; TransPt calls InverseObjMatrix to translate the nentselp
  15. ;; point to the OCS of the block. It calls ObjMatrix to
  16. ;; translate the end points of the segment to UCS or WCS.
  17. ;|
  18. (defun c:TestOM ( / e obj pt blklst param p1 p2)
  19.   (and
  20.     (setq e (nentselp "\nSelect nested pline: "))
  21.     (= 4 (length e))
  22.     (setq obj (vlax-ename->vla-object (car e)))
  23.     (setq pt (cadr e))
  24.     (setq blklst (last e))
  25.     (setq pt (TransPt pt blklst 1 2)) ;UCS to OCS
  26.     (setq pt (vlax-curve-getClosestPointTo obj pt))
  27.     (setq param (vlax-curve-getparamatpoint obj pt))
  28.     (setq p1 (vlax-curve-getpointatparam obj (fix param)))
  29.     (setq p2 (vlax-curve-getpointatparam obj (1+ (fix param))))
  30.     (setq p1 (TransPt p1 blklst 2 1)) ;OCS to UCS
  31.     (setq p2 (TransPt p2 blklst 2 1))
  32.     (print (length blklst))
  33.     (grdraw p1 p2 7 -1)
  34.   )
  35.   (princ)
  36. ) ;end
  37. |;
  38. (or *blocks*
  39.   (setq    *blocks*
  40.     (vla-get-blocks
  41.       (vla-get-activedocument
  42.         (vlax-get-acad-object)
  43.       )
  44.     )
  45.   )
  46. )
  47. ;; Argument: a block reference ename or vla-object.
  48. ;; Returns: a 4x4 transformation matrix like nentselp.
  49. (defun ObjMatrix (vobj     /    orig   ang    inspt  nrml   xsf
  50.           ysf     zxf    sclm   rotm   movm   origm  nrmlm
  51.          )
  52.   (if (= (type vobj) 'ENAME)
  53.     (setq vobj (vlax-ename->vla-object vobj))
  54.   )
  55.   (setq orig (vlax-get (vla-item *blocks* (vlax-get vobj 'Name)) 'Origin))
  56.   (setq    orig  (mapcar '- orig)
  57.     ang   (vlax-get vobj 'Rotation)
  58.     inspt (vlax-get vobj 'InsertionPoint)
  59.                     ;revised 1/30/2006
  60.     nrml  (list (vlax-get vobj 'Normal) nil)
  61.     xsf   (vlax-get vobj 'XScaleFactor)
  62.     ysf   (vlax-get vobj 'YScaleFactor)
  63.     zsf   (vlax-get vobj 'ZScaleFactor)
  64.     sclm  (OM:ScaleMatrix xsf ysf zsf)
  65.     rotm  (OM:RotationMatrix ang)
  66.     movm  (OM:PointMatrix inspt)
  67.     origm (OM:PointMatrix orig)
  68.     nrmlm (OM:NormalMatrix nrml)
  69.   )
  70.   (mxm movm
  71.     (mxm nrmlm
  72.       (mxm rotm
  73.         (mxm sclm origm)
  74.       )
  75.     )
  76.   )
  77. )                    ;end
  78. ;; Argument: a block reference ename or vla-object.
  79. ;; Returns: an inverse 4x4 transformation matrix.
  80. (defun InverseObjMatrix    (vobj    /      orig   ang    inspt  nrml
  81.              xsf    ysf    zxf    sclm   rotm   movm
  82.              origm    nrmlm
  83.             )
  84.   (if (= (type vobj) 'ENAME)
  85.     (setq vobj (vlax-ename->vla-object vobj))
  86.   )
  87.   (setq    orig (vlax-get (vla-item *blocks* (vlax-get vobj 'Name)) 'Origin))
  88.   (setq    ang   (- (vlax-get vobj 'Rotation))
  89.     inspt (mapcar '- (vlax-get vobj 'InsertionPoint))
  90.                     ;revised 1/30/2006
  91.     nrml  (list (vlax-get vobj 'Normal) T)
  92.     xsf   (/ 1 (vlax-get vobj 'XScaleFactor))
  93.     ysf   (/ 1 (vlax-get vobj 'YScaleFactor))
  94.     zsf   (/ 1 (vlax-get vobj 'ZScaleFactor))
  95.     sclm  (OM:ScaleMatrix xsf ysf zsf)
  96.     rotm  (OM:RotationMatrix ang)
  97.     movm  (OM:PointMatrix inspt)
  98.     origm (OM:PointMatrix orig)
  99.     nrmlm (OM:NormalMatrix nrml)
  100.   )
  101.   (mxm origm
  102.     (mxm sclm
  103.       (mxm rotm
  104.         (mxm nrmlm movm)
  105.       )
  106.     )
  107.   )
  108. )                    ;end
  109. ;; Arguments:
  110. ;; pt - point to transform
  111. ;; blklst - typically a list of enames returned
  112. ;; by (last nentsel) or (last nentselp)
  113. ;; FROM and TO similar to trans: WCS = 0, UCS = 1 and OCS = 2
  114. ;; examples: (TransPt point blocklist 1 2) UCS > OCS
  115. ;;           (TransPt point blocklist 2 0) OCS > WCS
  116. ;; Returns: the transformed pt argument.
  117. (defun TransPt (pt blklst from to / ptmatrix matrix matrixlst res)
  118.   (or
  119.     (= 3 (length pt))
  120.     (setq pt (append pt '(0.0)))
  121.   )
  122.   (or
  123.     (or (= from 0) (= from 2))
  124.     (setq pt (trans pt 1 0))
  125.   )
  126.   (if (or (= to 0) (= to 1))
  127.                     ; to WCS or UCS
  128.     (setq matrixlst (mapcar 'ObjMatrix blklst))
  129.                     ; to OCS
  130.     (setq matrixlst (reverse (mapcar 'InverseObjMatrix blklst)))
  131.   )
  132.   (setq matrix (car matrixlst))
  133.   (if (> (length matrixlst) 1)
  134.     (repeat (1- (length matrixlst))
  135.       (setq matrix (mxm (cadr matrixlst) matrix))
  136.       (setq matrixlst (cdr matrixlst))
  137.     )
  138.   )
  139.   (setq ptmatrix (OM:PointMatrix pt))
  140.   (setq matrix (mxm matrix ptmatrix))
  141.   (setq    res
  142.      (list
  143.        (last (car matrix))
  144.        (last (cadr matrix))
  145.        (last (caddr matrix))
  146.      )
  147.   )
  148.   (or
  149.     (or (= to 0) (= to 2))
  150.     (setq res (trans res 0 1))
  151.   )
  152.   res
  153. )                    ;end
  154. ;; Start Sub-Functions ;;
  155. ;; Apply a transformation matrix to a vector,
  156. ;; by Vladimir Nesterovsky
  157. (defun mxv (m v)
  158.   (mapcar '(lambda (row) (apply '+ (mapcar '* row v))) m)
  159. )
  160. ;; Multiply two matrices, by Vladimir Nesterovsky.
  161. (defun mxm (m q / qt)
  162.   (setq qt (apply 'mapcar (cons 'list q)))
  163.   (mapcar '(lambda (mrow) (mxv qt mrow)) m)
  164. )
  165. (defun OM:ScaleMatrix (x y z)
  166.   (list
  167.     (list x 0 0 0)
  168.     (list 0 y 0 0)
  169.     (list 0 0 z 0)
  170.     (list 0 0 0 1)
  171.   )
  172. )
  173. (defun OM:RotationMatrix (a)
  174.   (list
  175.     (list (cos a) (- (sin a)) 0 0)
  176.     (list (sin a) (cos a) 0 0)
  177.     (list 0 0 1 0)
  178.     (list 0 0 0 1)
  179.   )
  180. )
  181. (defun OM:PointMatrix (p)
  182.   (list
  183.     (list 1 0 0 (car p))
  184.     (list 0 1 0 (cadr p))
  185.     (list 0 0 1 (caddr p))
  186.     (list 0 0 0 1)
  187.   )
  188. )
  189. ;; Revised to use an argument list 1/30/2006.
  190. ;; Objmatrix passes ((normal) nil).
  191. ;; InverseObjmatrix passes ((normal) T).
  192. (defun OM:NormalMatrix (arglst)
  193.   (cond
  194.     ((equal (car arglst) '(0.0 0.0 1.0))
  195.      (list
  196.        '(1 0 0 0)
  197.        '(0 1 0 0)
  198.        '(0 0 1 0)
  199.        '(0 0 0 1)
  200.      )
  201.     )
  202.     ((equal (car arglst) '(0.0 0.0 -1.0))
  203.      (list
  204.        '(-1 0 0 0)
  205.        '(0 1 0 0)
  206.        '(0 0 -1 0)
  207.        '(0 0 0 1)
  208.      )
  209.     )
  210.     (T
  211.       (MWE:GetNMatrix arglst)
  212.     )
  213.   )
  214. )
  215. ;; The following functions by James Allen calculate the
  216. ;; normal matrix when the block normal is other than
  217. ;; (0.0 0.0 1.0) or (0.0 0.0 -1.0).
  218. ;;; Returns a generalized orientation matrix given a
  219. ;;; source normal vector and destination normal vector
  220. ;;;
  221. ;;; Let nrm = ((i) (j) (k)) and W = ((x) (y) (z)):
  222. ;;;
  223. ;;; GetOMatrix returns ((Pix Pjx Pkx 0)
  224. ;;;         (Piy Pjy Pky 0)
  225. ;;;         (Piz Pjz Pkz 0)
  226. ;;;         (0   0   0   1))
  227. ;;;
  228. ;;; Where, for example, Pix indicates magnitude of
  229. ;;; vector i projected onto vector x
  230. ;;;
  231. (defun MWE:GetOMatrix (arglst / nrm W)
  232.   (setq    nrm (nth 0 arglst)
  233.     W   (nth 1 arglst)
  234.   )
  235.   (reverse
  236.     (cons
  237.       '(0 0 0 1)
  238.       (reverse
  239.     (mapcar
  240.       '(lambda (b)
  241.          (reverse
  242.            (cons 0
  243.          (reverse
  244.            (mapcar '(lambda (a) (MWE:ProjUV (list a b))) nrm)
  245.          )
  246.            )
  247.          )
  248.        )
  249.       W
  250.     )
  251.       )
  252.     )
  253.   )
  254. )
  255. ;;; Returns an OCS orientation matrix given a Normal vector
  256. (defun MWE:GetNMatrix (arglst / nrm W)
  257.   (setq    nrm (nth 0 arglst)
  258.     nrm (reverse (cons nrm (reverse (MWE:ArbAxis (list nrm)))))
  259.     W   '((1 0 0) (0 1 0) (0 0 1))
  260.   )
  261.   (if (nth 1 arglst)
  262.     (mapcar 'set '(nrm W) (list W nrm))
  263.   )
  264.   (MWE:GetOMatrix (list nrm W))
  265. )
  266. ;;; ArbAxis calculates the arbitrary x and resulting y axes
  267. ;;; from a given normal vector
  268. (defun MWE:ArbAxis (arglst / N Wy Wz Ax L Ay)
  269.   (setq    N  (nth 0 arglst)
  270.     Wy '(0.0 1.0 0.0)
  271.     Wz '(0.0 0.0 1.0)
  272.   )
  273.   (if (and (< (abs (nth 0 N)) (/ 1.0 64))
  274.        (< (abs (nth 1 N)) (/ 1.0 64))
  275.       )
  276.     (setq Ax (MWE:CrossProd (list Wy N)))
  277.     (setq Ax (MWE:CrossProd (list Wz N)))
  278.   )
  279.   (setq    L  (distance '(0 0 0) Ax)
  280.     Ax (mapcar '(lambda (x) (/ x L)) Ax)
  281.     Ay (MWE:CrossProd (list N Ax))
  282.     L  (distance '(0 0 0) Ax)
  283.     Ay (mapcar '(lambda (x) (/ x L)) Ay)
  284.   )
  285.   (list Ax Ay)
  286. )
  287. ;;; Calculates the cross product of two three-element vectors
  288. (defun MWE:CrossProd (arglst / a b)
  289.   (setq    a (nth 0 arglst)
  290.     b (nth 1 arglst)
  291.   )
  292.   (list    (- (* (nth 1 a) (nth 2 b)) (* (nth 2 a) (nth 1 b)))
  293.     (- (* (nth 2 a) (nth 0 b)) (* (nth 0 a) (nth 2 b)))
  294.     (- (* (nth 0 a) (nth 1 b)) (* (nth 1 a) (nth 0 b)))
  295.   )
  296. )
  297. ;;; ProjUV returns the magnitude of a vector u projected onto v
  298. (defun MWE:ProjUV (arglst / u v mv udv mm)
  299.   (setq    u   (nth 0 arglst)        ; Vector u
  300.     v   (nth 1 arglst)        ; Vector v
  301.     mv  (distance '(0 0 0) v)    ; Magnitude of v
  302.     udv (apply '+ (mapcar '* u v))    ; u dot v
  303.     mm  (/ udv mv)            ; Magnitude of u projection on v
  304.   )
  305. )
  306. ;; End Sub-Functions ;;
发表于 2009-4-7 10:27 | 显示全部楼层
BIXform.lsp
Block-to-Insert and Insert-to-Block Coordinate Transforms
  1. ;;; A set of routines for transforming back and forth
  2. ;;; between points found in the block table and points
  3. ;;; found in block inserts.
  4. ;;; Jon Fleming (jonf@fleming-group.com)
  5. ;;;  April 16, 1998
  6. ;;; Copyright (C) 1998 by The Fleming Group
  7. ;;; Permission to use, copy, modify, and distribute this software
  8. ;;; for any purpose and without fee is hereby granted, provided
  9. ;;; that the above copyright notice appears in all copies and
  10. ;;; that both that copyright notice and the limited warranty and
  11. ;;; restricted rights notice below appear in all supporting
  12. ;;; documentation.
  13. ;;; THE FLEMING GROUP PROVIDES THIS PROGRAM "AS IS" AND WITH ALL
  14. ;;; FAULTS. THE FLEMING GROUP SPECIFICALLY DISCLAIMS ANY IMPLIED
  15. ;;; WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
  16. ;;; THE FLEMING GROUP DOES NOT WARRANT THAT THE OPERATION OF THE
  17. ;;; PROGRAM WILL BE UNINTERRUPTED OR ERROR FREE.
  18. ;;; Usage:
  19. ;;;  The first step is to obtain the Entity Name of
  20. ;;;  an INSERT entity, pass that name to the
  21. ;;;  BlockToInsertSetup function, and save the return
  22. ;;;  value for use in later transformations.  Example:
  23. ;;;
  24. ;;;     (setq InsertEName (car (entsel "\nSelect insert: "))
  25. ;;;           XformSpec (BlockToInsertSetup InsertEName)
  26. ;;;     )
  27. ;;;
  28. ;;;  The second step is to obtain a point that you wish
  29. ;;;  to transform. This point may be a point obtained
  30. ;;;  from entries in the block table, or a point in the
  31. ;;;  insert entity (expressed in WCS).  Example:
  32. ;;;
  33. ;;;     (setq BlockName (cdr (assoc 2 (entget InsertEName)))
  34. ;;;           BlockEList (tblsearch "BLOCK" BlockName)
  35. ;;;           FirstEntity (entget (cdr (assoc -2 BlockEList)))
  36. ;;;           Point1 (cdr (assoc 10 FirstEntity))
  37. ;;;     )
  38. ;;;
  39. ;;;  The final step is to transform the point.  To transform
  40. ;;;  a point obtained from the block table into the corresponding
  41. ;;;  point in the insert entity, call BlockToInsertXform,
  42. ;;;  passing the point and the return value of BlockToInsertSetup
  43. ;;;  as arguments.  The return value will be the corresponding
  44. ;;;  point in the INSERT entity, expressed in WCS.  Example:
  45. ;;;
  46. ;;;     (setq Point2 (BlockToInsertXform Point1 XformSpec))
  47. ;;;
  48. ;;;  Or, to transform a point (expressed in WCS) obtained from
  49. ;;;  an insert entity into the corresponding point in the
  50. ;;;  block table, use InsertToBlockXform with the same arguments.
  51. ;;;
  52. ;;;  You may repeat the second and third steps as many times as
  53. ;;;  you wish.
  54. ;;; NOTE:  There are some pathological cases in which the answer
  55. ;;; is "correct" but not what you want.  These routines handle
  56. ;;; negative and positive scale factors correctly.  However, if the
  57. ;;; scale factors of the insert entity are not equal in magnitude,
  58. ;;; and the insert has attributes, and the attributes have not been
  59. ;;; scaled using the same scale factors as the insert entity, and
  60. ;;; you attempt to transform points such as attribute or attdef
  61. ;;; insert points, the results will not be what you expect.
  62. ;;;--------------------------------------------------------------
  63. ;;; Function to transform a point obtained from a block's
  64. ;;; specification in the block table into the corresponding
  65. ;;; point in an insert of that block.
  66. ;;; Arguments:
  67. ;;;   P1 = A list of three reals defining a point,
  68. ;;;        usually obtained from the block table.
  69. ;;;   TransformSpec = A list of five lists, obtained
  70. ;;;                   from the BlockToInsertSetup
  71. ;;;                   function.
  72. ;;; Return value:  A list of three reals containing
  73. ;;; the corresponding point in the INSERT entity,
  74. ;;; expressed in WCS.
  75. ;;; NOTE:  This function can be fooled in pathological
  76. ;;; circumstances.  If you are transforming a point obtained
  77. ;;; from an ATTDEF entity in the block table, and the X and/or
  78. ;;; Y and/or Z scale factors of the block insert have been
  79. ;;; modified so their magnitudes are not all the same, but
  80. ;;; the block insert's attributes have not been similarly
  81. ;;; scaled, the returned point will be where the attribute
  82. ;;; point "should be" (based on the insert entity's scale
  83. ;;; factors) rather than where the attribute point _is_.
  84. ;;; This routine does work correctly with scale factors
  85. ;;; of different signs.
  86. (defun BlockToInsertXform (P1 TransformSpec)
  87.   (3dTransformAB
  88.     (nth 0 TransformSpec)
  89.     (nth 1 TransformSpec)
  90.     (nth 2 TransformSpec)
  91.     (nth 3 TransformSpec)
  92.     (nth 4 TransformSpec)
  93.     P1
  94.   ) ;_ end 3dTransformAB
  95. ) ;_ end defun
  96. ;;; Function to transform a point obtained from an insert of
  97. ;;; a block intothe corresponding point in the definition
  98. ;;; of the block in the block table.
  99. ;;; Arguments:
  100. ;;;   P1 = A list of three reals defining a point,
  101. ;;;        expressed in WCS.
  102. ;;;   TransformSpec = A list of five lists, obtained
  103. ;;;                   from the BlockToInsertSetup
  104. ;;;                   function.
  105. ;;; Return value:  A list of three reals containing
  106. ;;; the corresponding point in the block table,
  107. ;;; expressed in WCS.
  108. ;;; NOTE:  This function can be fooled in pathological
  109. ;;; circumstances.  If you are transforming a point obtained
  110. ;;; from an ATTRIBUTE entity in the insert, and the X and/or
  111. ;;; Y and/or Z scale factors of the block insert have been
  112. ;;; modified so their magnitudes are not all the same, but
  113. ;;; the block insert's attributes have not been similarly
  114. ;;; scaled, the returned point will be where the ATTDEF
  115. ;;; point in the block table "should be" (based on the
  116. ;;; insert entity's scale factors) rather than where the
  117. ;;; ATTDEF point _is_.
  118. ;;; This routine does work correctly with scale factors
  119. ;;; of different signs.
  120. (defun InsertToBlockXform (P1 TransformSpec)
  121.   (3dTransformBA
  122.     (nth 0 TransformSpec)
  123.     (nth 1 TransformSpec)
  124.     (nth 2 TransformSpec)
  125.     (nth 3 TransformSpec)
  126.     (nth 4 TransformSpec)
  127.     P1
  128.   ) ;_ end 3dTransformBA
  129. ) ;_ end defun
  130. ;;; Function to set up the transformation specification
  131. ;;; for transforming coordinates specified in an entry
  132. ;;; the block table to an insert of that block (or vice
  133. ;;; versa).
  134. ;;; Argument:  the Entity Name of an INSERT entity
  135. ;;; To understand the return value, first consider
  136. ;;; a coordinate system I call the Natural Coordinate
  137. ;;; System (NCS).  The Z axis of the NCS is the same as
  138. ;;; the Z axis of the insert's Object Coordinate
  139. ;;; System (OCS).  The X Axis of the NCS is rotated
  140. ;;; (around the OCS Z axis) from the X axis of the OCS
  141. ;;; by the amount of rotation of the insert.  Similarly,
  142. ;;; the NCS Y axis is rotated (around the OCS Z axis)
  143. ;;; from the OCS Y axis by the same amount.  The origin
  144. ;;; of the NCS is at the insertion point of the insert.
  145. ;;; In other words, the NCS is a coordinate system in
  146. ;;; the block is inserted at (0,0,0) with a rotation
  147. ;;; angle of zero.
  148. ;;; Return value:  A list of lists containing:
  149. ;;;   1.  A unit vector along the X axis of the
  150. ;;;       insert's NCS, expressed in World
  151. ;;;       Coordinate System (WCS).
  152. ;;;   2.  A unit vector along the Y axis of the
  153. ;;;       insert's NCS, expressed in WCS.
  154. ;;;   3.  A unit vector along the Z axis of the
  155. ;;;       insert's NCS, expressed in WCS.
  156. ;;;   4.  A vector from WCS 0,0,0 to the insert
  157. ;;;       point of the INSERT entity (the origin
  158. ;;;       of the NCS), expressed in WCS.
  159. ;;;   5.  A list of three reals containing the
  160. ;;;       insert's X, Y and Z scale factors.
  161. (defun BlockToInsertSetup (InsertEname
  162.                            /
  163.                            InsertEList
  164.                            ZAxis
  165.                            NCSXAxis
  166.                            InsertAngle
  167.                           )
  168.   ;; Get the Entity Association List of the insert and the Z
  169.   ;; axis of the NCS (and OCS)
  170.   (setq ZAxis       (cdr (assoc 210 (setq InsertEList (entget InsertEName))))
  171.         ;; The OCS X axis is, in OCS, '(1 0 0).  The NCS X axis is
  172.         ;; therefore, in OCS,
  173.         ;; ((cos InsertAngle) (sin InsertAngle) 0.0).
  174.         ;; Transforming this vector to WCS gives the NCS X axis in
  175.         ;; WCS:
  176.         InsertAngle (cdr (assoc 50 InsertEList))
  177.         NCSXAxis    (trans (list (cos InsertAngle) (sin InsertAngle) 0.0)
  178.                            (cdr (assoc 210 InsertEList))
  179.                            0
  180.                     ) ;_ end trans
  181.   ) ;_ end setq
  182.   ;; Set up the return value
  183.   (list NCSXAxis
  184.         ;; The Y axis of the NCS (it will be a unit vector
  185.         ;; because it's the cross product of two unit
  186.         ;; vectors at a right angle to each other)
  187.         (VectorCrossProduct ZAxis NCSXAxis)
  188.         ZAxis
  189.         ;; The insertion point of the insert
  190.         (trans (cdr (assoc 10 InsertEList)) ZAxis 0)
  191.         ;; The scale factors
  192.         (list (cdr (assoc 41 InsertEList))
  193.               (cdr (assoc 42 InsertEList))
  194.               (cdr (assoc 43 InsertEList))
  195.         ) ;_ end list
  196.   ) ;_ end list
  197. ) ;_ end defun
  198. ;;; Vector cross product function
  199. ;;; Argument: Two lists, each of three real numbers defining
  200. ;;; a vector in 3-space
  201. ;;; Return value:  A list of three real numbers containing
  202. ;;; the first argument crossed with the second argument.
  203. (defun VectorCrossProduct (InputVector1 InputVector2)
  204.   (list (- (* (cadr InputVector1) (caddr InputVector2))
  205.            (* (cadr InputVector2) (caddr InputVector1))
  206.         ) ;_ end -
  207.         (- (* (caddr InputVector1) (car InputVector2))
  208.            (* (caddr InputVector2) (car InputVector1))
  209.         ) ;_ end -
  210.         (- (* (car InputVector1) (cadr InputVector2))
  211.            (* (car InputVector2) (cadr InputVector1))
  212.         ) ;_ end -
  213.   ) ;_ end list
  214. ) ;_ end defun
  215. ;;; Function to carry out an arbitrary 3D coordinate
  216. ;;; transformation from an "A" coordinate system
  217. ;;; to a "B" coordinate system.  Works between any two
  218. ;;; Cartesian coordinates of the same handedness, and
  219. ;;; may work between Cartesian coordinate systems of
  220. ;;; different handedness (with appropriate negative
  221. ;;; values in the "SA" argument).
  222. ;;; The "3DTransformBA" function is the inverse of
  223. ;;; this function.
  224. ;;; Arguments:
  225. ;;;    XA = a list of three reals defining a unit vector
  226. ;;;         pointing along the X axis of the "A" coordinate
  227. ;;;         system, expressed in the "B" coordinate system
  228. ;;;    YA = a list of three reals defining a unit vector
  229. ;;;         pointing along the Y axis of the "A" coordinate
  230. ;;;         system, expressed in the "B" coordinate system
  231. ;;;    ZA = a list of three reals defining a unit vector
  232. ;;;         pointing along the Z axis of the "A" coordinate
  233. ;;;         system, expressed in the "B" coordinate system
  234. ;;;    OA = A list of three reals defining a vector from
  235. ;;;         the origin of the "B" coordinate system to the
  236. ;;;         origin of the "A" coordinate system, expressed
  237. ;;;         in the "B" coordinate system
  238. ;;;    SA = A list of three reals defining the scale factors;
  239. ;;;         "B" X axis units per "A" X axis unit, "B" Y axis
  240. ;;;         units per "A" Y axis unit, and "B" Z axis units
  241. ;;;         per "A" Z axis unit
  242. ;;;    P1 = A list of three reals defining a point in the
  243. ;;;         "A" coordinate system
  244. ;;; Return value:  a list of three reals defining the same
  245. ;;; point as P1, but expressed in the "B" coordinate system
  246. (defun 3DTransformAB (XA YA ZA OA SA P1 /)
  247.   ;; Scale the input point to "B" system units
  248.   (setq P1 (mapcar '* P1 SA))
  249.   ;; Translate and set up the return value
  250.   (mapcar '+
  251.           OA
  252.           ;; The following does the rotation transformation
  253.           (list (+ (* (car XA) (car P1))
  254.                    (* (car YA) (cadr P1))
  255.                    (* (car ZA) (caddr P1))
  256.                 ) ;_ end +
  257.                 (+ (* (cadr XA) (car P1))
  258.                    (* (cadr YA) (cadr P1))
  259.                    (* (cadr ZA) (caddr P1))
  260.                 ) ;_ end +
  261.                 (+ (* (caddr XA) (car P1))
  262.                    (* (caddr YA) (cadr P1))
  263.                    (* (caddr ZA) (caddr P1))
  264.                 ) ;_ end +
  265.           ) ;_ end list
  266.   ) ;_ end mapcar
  267. ) ;_ end defun
  268. ;;; Function to carry out an arbitrary 3D coordinate
  269. ;;; transformation from a "B" coordinate system
  270. ;;; to an "A" coordinate system.  Works between any two
  271. ;;; Cartesian coordinates of the same handedness, and
  272. ;;; may work between Cartesian coordinate systems of
  273. ;;; different handedness (with appropriate negative
  274. ;;; values in the "SA" argument).
  275. ;;; The "3DTransformAB" function is the inverse of
  276. ;;; this function.
  277. ;;; Arguments:
  278. ;;;    XA = a list of three reals defining a unit vector
  279. ;;;         pointing along the X axis of the "A" coordinate
  280. ;;;         system, expressed in the "B" coordinate system
  281. ;;;    YA = a list of three reals defining a unit vector
  282. ;;;         pointing along the Y axis of the "A" coordinate
  283. ;;;         system, expressed in the "B" coordinate system
  284. ;;;    ZA = a list of three reals defining a unit vector
  285. ;;;         pointing along the Z axis of the "A" coordinate
  286. ;;;         system, expressed in the "B" coordinate system
  287. ;;;    OA = A list of three reals defining a vector from
  288. ;;;         the origin of the "B" coordinate system to the
  289. ;;;         origin of the "A" coordinate system, expressed
  290. ;;;         in the "B" coordinate system
  291. ;;;    SA = A list of three reals defining the scale factors;
  292. ;;;         "B" X axis units per "A" X axis unit, "B" Y axis
  293. ;;;         units per "A" Y axis unit, and "B" Z axis units
  294. ;;;         per "A" Z axis unit
  295. ;;;    P1 = A list of three reals defining a point in the
  296. ;;;         "B" coordinate system
  297. ;;; Return value:  a list of three reals defining the same
  298. ;;; point as P1, but expressed in the "A" coordinate system
  299. (defun 3DTransformBA (XA YA ZA OA SA P1 /)
  300.   ;; Translate
  301.   (setq P1 (mapcar '- P1 OA))
  302.   ;; Scale and set up the return value
  303.   (mapcar '/
  304.           ;; The following does the rotation
  305.           (list (+ (* (car XA) (car P1))
  306.                    (* (cadr XA) (cadr P1))
  307.                    (* (caddr XA) (caddr P1))
  308.                 ) ;_ end +
  309.                 (+ (* (car YA) (car P1))
  310.                    (* (cadr YA) (cadr P1))
  311.                    (* (caddr YA) (caddr P1))
  312.                 ) ;_ end +
  313.                 (+ (* (car ZA) (car P1))
  314.                    (* (cadr ZA) (cadr P1))
  315.                    (* (caddr ZA) (caddr P1))
  316.                 ) ;_ end +
  317.           ) ;_ end list
  318.           SA
  319.   ) ;_ end mapcar
  320. ) ;_ end defun
发表于 2009-4-7 10:30 | 显示全部楼层
3DXform.lsp
Generalized 3D Coordinate Transformations
  1. ;;; A set of routines for arbitrary 3D coordinate
  2. ;;; transformations (rotation, translation, and/or
  3. ;;; scaling) between Cartesian coordinate systems.
  4. ;;; Jon Fleming (jonf@fleming-group.com)
  5. ;;;  April 16, 1998
  6. ;;; Copyright (C) 1998 by The Fleming Group
  7. ;;; Permission to use, copy, modify, and distribute this software
  8. ;;; for any purpose and without fee is hereby granted, provided
  9. ;;; that the above copyright notice appears in all copies and
  10. ;;; that both that copyright notice and the limited warranty and
  11. ;;; restricted rights notice below appear in all supporting
  12. ;;; documentation.
  13. ;;; THE FLEMING GROUP PROVIDES THIS PROGRAM "AS IS" AND WITH ALL
  14. ;;; FAULTS. THE FLEMING GROUP SPECIFICALLY DISCLAIMS ANY IMPLIED
  15. ;;; WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
  16. ;;; THE FLEMING GROUP DOES NOT WARRANT THAT THE OPERATION OF THE
  17. ;;; PROGRAM WILL BE UNINTERRUPTED OR ERROR FREE.
  18. ;;;----------------------------------------------------
  19. ;;; Function to carry out an arbitrary 3D coordinate
  20. ;;; transformation from an "A" coordinate system
  21. ;;; to a "B" coordinate system.  Works between any two
  22. ;;; Cartesian coordinates of the same handedness, and
  23. ;;; may work between Cartesian coordinate systems of
  24. ;;; different handedness (with appropriate negative
  25. ;;; values in the "SA" argument).
  26. ;;; The "3DTransformBA" function is the inverse of
  27. ;;; this function.
  28. ;;; Arguments:
  29. ;;;    XA = a list of three reals defining a unit vector
  30. ;;;         pointing along the X axis of the "A" coordinate
  31. ;;;         system, expressed in the "B" coordinate system
  32. ;;;    YA = a list of three reals defining a unit vector
  33. ;;;         pointing along the Y axis of the "A" coordinate
  34. ;;;         system, expressed in the "B" coordinate system
  35. ;;;    ZA = a list of three reals defining a unit vector
  36. ;;;         pointing along the Z axis of the "A" coordinate
  37. ;;;         system, expressed in the "B" coordinate system
  38. ;;;    OA = A list of three reals defining a vector from
  39. ;;;         the origin of the "B" coordinate system to the
  40. ;;;         origin of the "A" coordinate system, expressed
  41. ;;;         in the "B" coordinate system
  42. ;;;    SA = A list of three reals defining the scale factors;
  43. ;;;         "B" X axis units per "A" X axis unit, "B" Y axis
  44. ;;;         units per "A" Y axis unit, and "B" Z axis units
  45. ;;;         per "A" Z axis unit
  46. ;;;    P1 = A list of three reals defining a point in the
  47. ;;;         "A" coordinate system
  48. ;;; Return value:  a list of three reals defining the same
  49. ;;; point as P1, but expressed in the "B" coordinate system
  50. (defun 3DTransformAB (XA YA ZA OA SA P1 /)
  51.   ;; Scale the input point to "B" system units
  52.   (setq P1 (mapcar '* P1 SA))
  53.   ;; Translate and set up the return value
  54.   (mapcar '+
  55.           OA
  56.           ;; The following does the rotation transformation
  57.           (list (+ (* (car XA) (car P1))
  58.                    (* (car YA) (cadr P1))
  59.                    (* (car ZA) (caddr P1))
  60.                 ) ;_ end +
  61.                 (+ (* (cadr XA) (car P1))
  62.                    (* (cadr YA) (cadr P1))
  63.                    (* (cadr ZA) (caddr P1))
  64.                 ) ;_ end +
  65.                 (+ (* (caddr XA) (car P1))
  66.                    (* (caddr YA) (cadr P1))
  67.                    (* (caddr ZA) (caddr P1))
  68.                 ) ;_ end +
  69.           ) ;_ end list
  70.   ) ;_ end mapcar
  71. ) ;_ end defun
  72. ;;; Function to carry out an arbitrary 3D coordinate
  73. ;;; transformation from a "B" coordinate system
  74. ;;; to an "A" coordinate system.  Works between any two
  75. ;;; Cartesian coordinates of the same handedness, and
  76. ;;; may work between Cartesian coordinate systems of
  77. ;;; different handedness (with appropriate negative
  78. ;;; values in the "SA" argument).
  79. ;;; The "3DTransformAB" function is the inverse of
  80. ;;; this function.
  81. ;;; Arguments:
  82. ;;;    XA = a list of three reals defining a unit vector
  83. ;;;         pointing along the X axis of the "A" coordinate
  84. ;;;         system, expressed in the "B" coordinate system
  85. ;;;    YA = a list of three reals defining a unit vector
  86. ;;;         pointing along the Y axis of the "A" coordinate
  87. ;;;         system, expressed in the "B" coordinate system
  88. ;;;    ZA = a list of three reals defining a unit vector
  89. ;;;         pointing along the Z axis of the "A" coordinate
  90. ;;;         system, expressed in the "B" coordinate system
  91. ;;;    OA = A list of three reals defining a vector from
  92. ;;;         the origin of the "B" coordinate system to the
  93. ;;;         origin of the "A" coordinate system, expressed
  94. ;;;         in the "B" coordinate system
  95. ;;;    SA = A list of three reals defining the scale factors;
  96. ;;;         "B" X axis units per "A" X axis unit, "B" Y axis
  97. ;;;         units per "A" Y axis unit, and "B" Z axis units
  98. ;;;         per "A" Z axis unit
  99. ;;;    P1 = A list of three reals defining a point in the
  100. ;;;         "B" coordinate system
  101. ;;; Return value:  a list of three reals defining the same
  102. ;;; point as P1, but expressed in the "A" coordinate system
  103. (defun 3DTransformBA (XA YA ZA OA SA P1 /)
  104.   ;; Translate
  105.   (setq P1 (mapcar '- P1 OA))
  106.   ;; Scale and set up the return value
  107.   (mapcar '/
  108.           ;; The following does the rotation
  109.           (list (+ (* (car XA) (car P1))
  110.                    (* (cadr XA) (cadr P1))
  111.                    (* (caddr XA) (caddr P1))
  112.                 ) ;_ end +
  113.                 (+ (* (car YA) (car P1))
  114.                    (* (cadr YA) (cadr P1))
  115.                    (* (caddr YA) (caddr P1))
  116.                 ) ;_ end +
  117.                 (+ (* (car ZA) (car P1))
  118.                    (* (cadr ZA) (cadr P1))
  119.                    (* (caddr ZA) (caddr P1))
  120.                 ) ;_ end +
  121.           ) ;_ end list
  122.           SA
  123.   ) ;_ end mapcar
  124. ) ;_ end defun
 楼主| 发表于 2009-4-10 11:37 | 显示全部楼层

雖然沒有完全解決問題.不過還是多謝!

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-7-4 12:34 , Processed in 0.155232 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表