找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 914|回复: 4

[求助] [求助]:谁知道cad的“3DSOLID”实体的组码如何获得?

[复制链接]
发表于 2003-11-9 14:21:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
用(entget (car (entsel)))选择“3DSOLID”三维实体后,返回的是一堆乱码,看不懂。

这是其中的一段:
命令: (entget (car (entsel)))

{kj {rn |") (1 . ":;8: {gl rn {rn {im rnffqfffffffffffmhm {gk o {lj {gj 90-(>-;
_h *1410(1 |") (1 . "<0:;8: {rn rn {rn {lh {li {gi {gh -:):-,:; {nh {rn |") (1
. ":;8: {gg rn {rn {gf o {im loo {jj {fo 90-(>-; _h *1410(1 |") (1 .
"/+36,+r:&:r>++-6= {rn rn {rn {rn {lf |") (1 . "):-+:' {rn rn {rn {io {fn |")
(1 . ",+->687+r<*-): {rn rn {rn lmjkiqlnfhnokjjknl rlojniqmjjnjiimhfgk loo n
nqkogonnknmiligmog:roni o V V |") (1 . "<0:;8: {rn rn {rn {fm {gi {ko {ij
90-(>-; {hg {rn |") (1 . ":;8: {fl rn {rn {hn roqoolhgholjignnmmlnj {ig
oqoolhgholjignnmmkhjf {ik {fk 90-(>-; _h *1410(1 |") (1 . "<0:;8: {rn rn {rn
{kn {go {fm {fj -:):-,:; {ll {rn |") (1 . "/+36,+r:&:r>++-6= {rn rn {rn {rn {km
|") (1 . "):-+:' {rn rn {rn {fj {fi |") (1 . ",+->687+r<*-): {rn rn {rn
hnhmqjmjjikkoniklk rlolniqmjjnjiimgoom o o o n V V |") (1 . "/+36,+r:&:r>++-6=
{rn rn {rn {rn {kl |") (1 . "):-+:' {rn rn {rn {gh {fh |") (1 . ",+->687+r<*-):
{rn rn {rn ihogqinnkhjiffnggl rlojniqmjjnjiimhfgh o o o n V V |") (1 . ":;8:
{fg rn {rn {gk rmjlhlqhfknkiojlhh {kh o {jk {ff 90-(>-; _h *1410(1 |") (1 .
"/061+ {rn rn {rn hnhmqjmjjikkoniklk rlolniqmjjnjiimgoom loo |") (1 . "/061+
{rn rn {rn ihogqinnkhjiffnggl rlojniqmjjnjiimhfgh loo |") (1 .
"-:9@)+r:&:r>++-6= {rn rn {rn {jn {lm {k {j |") (1 . "92:,7r:&:r>++-6= {rn rn
{noo {rn {jm |") (1 . "300/ {rn rn {rn {rn {fm {jm |") (1 . "/3>1:r,*-9><: {rn
rn {rn nfiihqnkjlhjiljgjl rloknhqnkiniilnhnlm o o o n rn o o -:):-,:@) V V V V
|") (1 . "<0:;8: {rn rn {rn {ii {jk {ji {gm -:):-,:; {ll {rn |") (1 . "<0:;8:
{rn rn {rn {ji {jj {non {nom -:):-,:; {ml {rn |") (1 . ":;8: {nol rn {rn {nok o
{gk loo {go {noj 90-(>-; _h *1410(1 |") (1 . "/+36,+r:&:r>++-6= {rn rn {rn {rn
{jg |") (1 . "):-+:' {rn rn {rn {gm {noi |") (1 . ",+->687+r<*-): {rn rn {rn
lmjkiqlnfhnokjjknl rlolniqmjjnjiimhffn loo o n o V V |") (1 . "<0:;8: {rn rn
{rn {ik {non {jf {gh 90-(>-; {hg {rn |") (1 . ":;8: {noh rn {rn {gf o {hn
mjglhqhogmlkhjimmj {gi {nog 90-(>-; _h *1410(1 |") (1 . "/+36,+r:&:r>++-6= {rn
rn {rn {rn {io |") (1 . "):-+:' {rn rn {rn {nom {nof |") (1 . ",+->687+r<*-):
{rn rn {rn lmjkiqlnfhnokjjknl rlojniqmjjnjiimhfgk o o o n V V |") (1 . "/061+
{rn rn {rn lmjkiqlnfhnokjjknl rlojniqmjjnjiimhfgk loo |") (1 . "<0:;8: {rn rn
{rn {non {ik {ii {fj 90-(>-; {hg {rn |") (1 . "/+36,+r:&:r>++-6= {rn rn {rn {rn
{ij |") (1 . ":336/,:r<*-): {rn rn {rn lllkiqlnfhnokjmggn rfniiiqmjjnjiimfnog o
o o rn rmikojqfkojkmknmgmh inmjoqklfmnjlmhhjn o n V V |") (1 . ":;8: {nno rn
{rn {ig o {nok mjlhlqhfknkiojlhh {fm {nnn 90-(>-; _h *1410(1 |") (1 . "/061+
{rn rn {rn hnhmqjmjjikkoniklk rlolniqmjjnjiimgoom o |") (1 . "/061+ {rn rn {rn
ihogqinnkhjiffnggl rlojniqmjjnjiimhfgh o |") (1 . "/+36,+r:&:r>++-6= {rn rn {rn
{rn {hl |") (1 . ",+->687+r<*-): {rn rn {rn hnhmqjmjjikkoniklk
rlolniqmjjnjiimgoom loo rn rkqlonmilogffilklil:roni o V V |") (1 .
"-:9@)+r:&:r>++-6= {rn rn {rn {hh {jm {k {j |") (1 . "<0:;8: {rn rn {rn {gi {fm
{gn {nom 90-(>-; {hg {rn |") (1 . ":;8: {nnm rn {rn {nok o {gf
nffqfffffffffffmhm {non {nnl 90-(>-; _h *1410(1 |") (1 . "/+36,+r:&:r>++-6= {rn
rn {rn {rn {gm |") (1 . "):-+:' {rn rn {rn {fj {nnk |") (1 . ",+->687+r<*-):
{rn rn {rn lmjkiqlnfhnokjjknl rlolniqmjjnjiimhffn o o o n V V |") (1 . "/061+
{rn rn {rn lmjkiqlnfhnokjjknl rlolniqmjjnjiimhffn loo |") (1 .
"/+36,+r:&:r>++-6= {rn rn {rn {rn {gh |") (1 . ",+->687+r<*-): {rn rn {rn
lmjkiqlnfhnokjjknl rlojniqmjjnjiimhfgk o rn rnqkogonnknmiligmog:roni o V V |")
(1 . "/061+ {rn rn {rn lmjkiqlnfhnokjjknl rlojniqmjjnjiimhfgk o |") (1 .
"/+36,+r:&:r>++-6= {rn rn {rn {rn {fj |") (1 . ",+->687+r<*-): {rn rn {rn
hnhmqjmjjikkoniklk rlolniqmjjnjiimgoom o n kqlonmilogffilklil:roni o V V |") (1
. "/+36,+r:&:r>++-6= {rn rn {rn {rn {nom |") (1 . ",+->687+r<*-): {rn rn {rn
lmjkiqlnfhnokjjknl rlolniqmjjnjiimhffn o o rn o V V |") (1 . "/061+ {rn rn {rn
lmjkiqlnfhnokjjknl rlolniqmjjnjiimhffn o |")):@) V V V V |") (1 . "<0:;8: {rn
rn {rn {go {kn {kk {hl -:):-,:; {ll {rn |") (1 . "<0:;8: {rn rn {rn {gn {lj {lh
{io -:):-,:; {ml {rn |") (1 . "<0:;8: {rn rn {rn {lj {gn {go {gm 90-(>-; {ml
{rn |") (1 . "<0:;8: {rn rn {rn {kk {lg {lj {jg 90-(>-;
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2003-11-10 01:20:56 | 显示全部楼层
说明中就这几句,难啊

以下组码适用于三维实体图元。除此处所述的组码以外,另请参见“常用图元组码”。关于此表中使用的缩写和格式方面的信息,请参见“本参考的格式惯例”。 三维实体组码

组码
说明

100
子类标记 (AcDbModelerGeometry)

70
建模格式版本号(当前值 = 1)

1
所有权数据(多行,每行 < 255 个字符)

3
所有权数据的附加行(如果前一个组 1 的字符串长度大于 255 个字符)(可选)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2003-11-10 12:27:57 | 显示全部楼层
請問樓上
書上寫歸寫,怎麼用
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2003-11-11 13:03:26 | 显示全部楼层
;;下面這堆誰看懂再寫些心得出來好嗎?


  1. ;|am writing a lisp routine that help creating a 3d model
  2. from a 2d plan cutting windows doors, etc..... extrude the walls
  3. and then set an axonometric view look for the doors and windows
  4. ask for some points elev (if window) height etc. then the program
  5. will cut the opening and draw the 3d window
  6. I need to filter only the solid wall in front of me
  7. example: |;

  8. ;|setq pt1 (getpoint "\nleft Corner inside 2d window:"))
  9. from pt1 i want to extract the solid wall in front of me
  10. first problem is if your draworder is putting the solid on
  11. top of the window line than your entget will show gibberish data.some thing like this:
  12. ):-+:' {rn {fj {fi |") (1 . ",+->687+r<*-): {rn ninqlggiofjjlfmnik
  13. nkqkkgghnljlgjng o o o n V V |") (1 . ":;8: {fh {gk {ki {jk {fg 90-(>-; |") (1
  14. . "/061+ {rn ninqlggiofjjlfmnik nkqkkgghnljlgjng nkk |") (1 . "/061+ {rn
  15. ninqlggiofjjlfmnik gqkkgghnljlgjnhfff nkk |") (1 . "-:9@)+r:&:r>++-6= {rn {rn
  16. {jo {ln {l {k |") (1 . "92:,7r:&:r>++-6= {rn {ff {rn {jn |") (1 .
  17. "/3>1:r,*-9><: {rn ninqlggiofjjlfmnik nkqkkgghnljlgjng nkk o o n n o o
  18. 90-(>-;@) V V V V |") (1 . "<0:;8: {rn {ik {noo {if {fj 90
  19. am not gonna paste the whole thing it will take a long space.
  20. need to control the selection when i need to select the lines and
  21. when i need to select the solid wall to subtract for example.
  22. (ssget pt1 '((0 . "solid")))|;



  23. ;;-------------------------------------------------------------------
  24. ;;; go to spatial technolgies web site and get the sat guide book itdescribes
  25. ;;; the structure of the file, autocad stores 3dsolid data in the same format
  26. ;;; (entget) returns the entity data and the group 1 codes reflect each line in
  27. ;;; the sat file. the strings are scrambled and can be translated to readable
  28. ;;; text with this function:
  29. ;;; s = string to be translated to or from readable format or autocad entity format


  30. (defun TRACIS (S / N L)
  31.   (setq N "")
  32.   (while (> (strlen S) 0)
  33.     (setq
  34.       L        (substr S 1 1)
  35.       S        (substr S 2)
  36.       N        (strcat        N
  37.                 (if (= " " L)
  38.                   ""
  39.                   (chr (- 79 (- (ascii L) 80)))
  40.                 )
  41.         )
  42.     )
  43.   )
  44. )

  45. (defun C:SACIS (/ ENT E_DATA)
  46.   (if (setq ENT (entsel "Seleziona solido Acis:  "))
  47.     (progn
  48.       (terpri)
  49.       (setq E_DATA (entget (car ENT)))
  50.       (foreach DXF_1 (ALE_MASSOC 1 E_DATA)
  51.         (princ (TRACIS DXF_1))
  52.         (terpri)
  53.       )
  54.     )
  55.   )
  56.   (princ)
  57. )

  58. ;;; i have a small library of lisp acis functions to extract info from solids,
  59. ;;; generate profiles along alignments, create surface models, it can be done
  60. ;;; with autolisp


  61. ;|

  62. Eric;
  63.     In R2002: A quick non-programming way to get POINTs from ACIS objects is
  64. to create an xml file of the geometry using WBLOCK or EXPORT, and read the
  65. xyz entries for the "point" entities directly from the xml text file.
  66.     eg. "point $-1 0 3 0 #" --------> coordinates are '(0 3 0)

  67.     For non-R2002, you can get a start by using Kailas Dage's decrypting
  68. code which follows.
  69. |;

  70. ;;;From: Kailas Dhage (kailas@uts.com)
  71. ;;;Subject: Re: ACIS info
  72. ;;;Newsgroups: autodesk.autocad.customization
  73. ;;;Date: 1999/05/10
  74. ;;;
  75. ;;;Hi
  76. ;;;Please have look at code given below:

  77. ;;;;                                         Acis decode string
  78. (defun ACISDECODE (ST / LN N C ST1)
  79.   (setq        ST1 ""
  80.         N   (strlen ST)
  81.   )
  82.   (while (> N 0)
  83.     (setq C (ascii (substr ST N 1)))
  84.     (setq ST1 (strcat (cond ((= C 32) " ")
  85.                             ((= C 86) "I")
  86.                             ((chr (boole 6 C 95)))
  87.                       )
  88.                       ST1
  89.               )
  90.     )
  91.     (setq N (1- N))
  92.   )
  93.   ST1
  94. )

  95. ;;;                                        Acis decode entity
  96. (defun ACISDECODEENT (ENT)
  97.   (foreach @@ ENT
  98.     (if        (= (car @@) 1)
  99.       (setq ENT (subst (cons 1 (ACISDECODE (cdr @@))) @@ ENT))
  100.     )
  101.   )
  102.   ENT
  103. )

  104. ;;;                                        Display items
  105. (defun ACISWHAT        (ENT TP)
  106.   (setq TMP ())
  107.   (foreach @@ ENT
  108.     (if        (and (equal (car @@) 1) (wcmatch (cdr @@) (strcat TP "*")))
  109.       (setq TMP (cons @@ TMP))
  110.     )
  111.   )
  112.   (reverse TMP)
  113. )

  114. ;;;                                        GetACISDataonly
  115. (defun GETACISDATAONLY (ENT)
  116.   (setq TMP ())
  117.   (foreach @@ ENT
  118.     (if        (equal (car @@) 1)
  119.       (setq TMP (cons @@ TMP))
  120.     )
  121.   )
  122.   (setq TMP (reverse TMP))
  123.   (setq        TMP1 (car TMP)
  124.         TMP  (cdr TMP)
  125.         TMP  (cdr TMP)
  126.         TMP  (cdr TMP)
  127.   )
  128.   (cons TMP1 TMP)
  129. )

  130. ;;;                                        Main Routine
  131. (defun C:TEST ()
  132.   (setq ORENT (entget (car (entsel "\nSelect 3d Solid entity: "))))
  133.   (setq DEENT (ACISDECODEENT ORENT))
  134.   (setq ACENT (GETACISDATAONLY DEENT))
  135.   (princ "\nOrEnt: ")
  136.   ;(princ ORENT)
  137.   (princ "\nDeEnt: ")
  138.   (princ DEENT)
  139.   (princ "\nacEnt: ")
  140.   (princ ACENT)
  141.   (princ)
  142. )

  143. ;;;
  144. ;;;Cheers !!!
  145. ;;;
  146. ;;;Kailas Dhage
  147. ;;;UTS(i) India


  148. ;;Actually, ACISdecode function is by Owen Wengerd
  149. ;;and it appears EXACTLY as in the code you mention,
  150. ;;only 2.5 years _before_ it, as cited in the article

  151. ;;[[--------------------------------
  152. ;;Newsgroups: comp.cad.autocad
  153. ;;Subject: Re: R13 3D Solids
  154. ;;Date: Fri, 08 Nov 1996 14:55:28 GMT

  155. ;;owenw@manusoft.com (Owen Wengerd) has posted
  156. ;;this version on c.c.a. :
  157. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  158. (defun ACISDECODE (ST / LN N C ST1)
  159.   (setq        ST1 ""
  160.         N   (strlen ST)
  161.   )
  162.   (while (> N 0)
  163.     (setq C (ascii (substr ST N 1)))
  164.     (setq ST1
  165.            (strcat
  166.              (cond
  167.                ((= C 32) " ")
  168.                ((= C 86) "I")
  169.                ((chr (boole 6 C 95)))
  170.              )
  171.              ST1
  172.            )
  173.     )
  174.     (setq N (1- N))
  175.   )
  176.   ST1
  177. )
  178. ;;--------------------------------]]

  179. ;;The real question is, what to do with the decrypted solid data?
  180. ;;Points are trivial to see, but how to get "faces" ? All I see is
  181. ;;some indices with no apparent meaning.

  182. ;;Does someone know how this data can be interpreted? Joe,
  183. ;;you mention you can recreate the edges. Could you explain _how_?

  184. ;;--
  185. ;;Vlad   [url]http://vnestr.tripod.com/[/url]
  186. ;;--
  187. (defun C:SOLID-OUT (/ E D FD)
  188.   (cond
  189.     ((and
  190.        (setq E (car (entsel)))
  191.        (setq D (entget E))
  192.        (= "3DSOLID" (cdr (assoc 0 D)))
  193.        (setq FD (open "solid.out" "w"))
  194.      )
  195.      (foreach G        D
  196.        (and (= 1 (car G))
  197.             (princ (ACISDECODE (cdr G)) FD)
  198.             (princ "\n" FD)
  199.        )
  200.      )
  201.      (close FD)
  202.      (findfile "solid.out")
  203.     )
  204.   )
  205. )


  206. ;|
  207. From: "Joe Funk" <joefunk50@shaw.ca>
  208. Subject: Re: find vertex data of a solid
  209. Date: Saturday, February 09, 2002 6:22 PM

  210. Vladimir;
  211.     Thanks for pointing out that Owen was the author. He's good at
  212. deciphering things, isn't he? Kailas definitely should have attributed
  213. the code.
  214.     Yikes! re. recreating the edges of an ACIS object, I'm not sure
  215. how detailed to get, for fear of being boring or confusing (or worse
  216. - revealing my ignorance). You likely already know some or most of this.
  217.     I downloaded from Spatial Technologies the pdf docs which describe the
  218. ACIS SAT file Format. Chapter 2 gives details, of which I understand a
  219. small portion.
  220.      Once the AutoCAD dxf listing for an ACIS object, say a BOX, is
  221. translated into readable strings using Owen's code, the new record
  222. shows items like "face", "edge", "vertex", and "point". Each item is
  223. indexed to show its relationship to other items in the ACIS object.
  224. The indices are only implied, by the order of the objects in the record. To
  225. make it easier for my LISP to work with, I re-write the record again
  226. as explicitly indexed lists.
  227.     In the record, a header takes up the first 3 lines. The indexing starts
  228. with the first ACIS object, on line 4, so a "face" on line 6 of the record
  229. has index 3.
  230.     The Owen-translated line looks like:
  231.         "face $-1 $4 $5 $2 $-1 $6 forward single #"
  232. which I change to this indexed list:
  233.         (3 . "face $-1 $4 $5 $2 $-1 $6 forward single #")
  234.     Since a "face" has "edge"s and "point"s, and doesn't require higher math
  235. to trace out, it's maybe a good object to talk about. Here's how I pursue a
  236. face by following its indices downward in the record to get its 3 or 4 3-D
  237. points, in this case 4, in proper order for drawing a 3DFACE.

  238. Path to follow to get a face's coordinates:

  239. face
  240. |
  241. --> loop
  242.     |
  243.     --> coedge (main)
  244.        --> coedge
  245.            --> edge --> 2 vertices -->2 points   * second pair points
  246.        --> coedge
  247.            --> edge --> 2 vertices--> 2 points   * third pair points
  248.        --> coedge [ignore]
  249.        --> edge --> 2 vertices  --> 2 points     * first pair points

  250. The "loop" points to a coedge, whose own "edge" is the side to
  251. be drawn first. The order of a coedge's endpoints = the order
  252. in which they appear in the corresponding edge record.
  253.   coedge -> edge -> 2 "vertex"es -> 2 points (in drawing order)

  254. So ... starting with a "face" in the record ....

  255. (3 . "face $-1 $4 $5 $2 $-1 $6 forward single #")
  256.    ;;------ loop5---------------------------

  257.      You can identify which type of object a value is for, by the order of
  258. the entries in the string. The fourth value in this string holds the index
  259. for the line defining the face's "loop". (It's in the pdf's.) Go to that
  260. line (indexed here by 5) to find the "loop":

  261. (5 . "loop $-1 $-1 $10 $3 #")
  262.    ;;-------coedge10------------------------

  263.     Go to line indexed by 10 to find the main co-edge:

  264. (10 . "coedge $-1 $15 $16 $17 $18 forward $5 $-1 #")
  265.    ;;coedge15, coedge16, coedge17, edge18-------

  266.     Track down the 4 coedges 15, 16, 17, and 18. For each
  267. coedge, get:
  268.     - its "edge"
  269.     - the 2 vertices of the edge
  270.     - and the 2 "point"s (xyz values) for these vertices

  271. (15 . "coedge $-1 $27 $10 $28 $29 forward $5 $-1 #")
  272.    ;;--------------------edge29-----------------
  273.    (29 . "edge $-1 $36 $56 $28 $57 forward #")
  274.       ;;---vertex36, vertex56--------------
  275.         (36 . "vertex $-1 $18 $64 #")
  276.            ;;-------point64-------
  277.              (64 . "point $-1 5 3 2 #")    2
  278.         (56 . "vertex $-1 $29 $77 #")
  279.            ;;-------point77-------
  280.              (77 . "point $-1 0 3 2 #")    3

  281. (16 . "coedge $-1 $10 $27 $30 $31 forward $5 $-1 #")
  282.    ;;--------------edge31-----------------------
  283.    (31 . "edge $-1 $59 $35 $30 $60 forward #")
  284.       ;;---vertex59, vertex35--------------
  285.         (59 . "vertex $-1 $53 $78 #")
  286.            ;;-------point78-------
  287.              (78 . "point $-1 0 0 2 #")    4
  288.         (35 . "vertex $-1 $18 $63 #")
  289.            ;;-------point63-------
  290.             (63 . "point $-1 5 0 2 #")     2

  291. (17 . "coedge $-1 $32 $33 $10 $18 reversed $34 $-1 #")
  292.    ;;-------------edge18--------------------------
  293.    (18 . "edge $-1 $35 $36 $17 $37 forward #")
  294.       ;;-----vertex35, vertex36------------
  295.         (35 . "vertex $-1 $18 $63 #")
  296.            ;;-------point63-------
  297.             (63 . "point $-1 5 0 2 #")     1
  298.         (36 . "vertex $-1 $18 $64 #")
  299.            ;;-------point64-------
  300.             (64 . "point $-1 5 3 2 #")     2

  301. Since the 2nd pt of edge29 /= 1st pt of edge31, this is a 4-sided
  302. face, drawn p63 -> p64 -> p77 -> 78.

  303. ;;;============================================

  304.     That's a general description of how to get the points to re-create
  305. a face. It requires no math, just an understandingf of the SAT format.

  306. but ...
  307.     For "curve"s and "surface"s, the ACIS record gives B-Spline
  308. info, for which matrix manipulation becomes necessary (or at least
  309. very handy).
  310.     To date, I've been able to partially re-create the shape of what was
  311. originally an AutoCAD spline-fit 2-D polyline, from which a REGION
  312. was created. I'm missing some parts to the puzzle:
  313. 1. The ACIS record:
  314.         - only seems to give 3 control points, whereas I think the
  315.           B-Spline equations need 4. I already knew what the 4th point
  316.           was because I created the object in the first place, so I
  317.           plugged it into the matrix and got the points defining the
  318.           "first quarter" of the curve
  319. 2. The math:
  320.         - even given enough points to feed to the matrix, I only get 1/4 of
  321.             the curve
  322.         - apparently need to use a loop, feeding the 4 points to the
  323.             matrix 4 times, starting with a different point each time

  324.     Vladimir, I used some matrix functions I found in your discussions
  325. with ibro vehabovic about Bezier curves ... perhaps you remember
  326. some of these functions:
  327. mat*scalar
  328. mat-trans
  329. vec*vec
  330. mat*vec

  331. Here's the B-Spline equation I used:

  332. To calculate a point on the curve, given 4 control points Xi:
  333. p(t)= MTX-T *    MTX-BASIS         * MTX-PTS
  334. =>
  335. [ t^3 t^2 t 1]   [-0.1667 0.5   -0.5 0.1667]   [Xi-1 ]
  336.                      [  0.5    -1       0.5     0    ]    [Xi    ]
  337.                      [ -0.5     0       0.5     0    ]    [Xi+1]
  338.                      [0.1667 0.6667 0.1667  0]    [Xi+2]

  339. ;;;the Basis Matrix is rounded in that example, better use:
  340. ;;;"True" Basis Matrix for b-spline:
  341. ;;;| -1    3   -3    1 |
  342. ;;;|  3   -6    3    0 |  1
  343. ;;;| -3    0    3    0 | ---
  344. ;;;|  1    4    1    0 |  6

  345. If you have any suggestions, I'd be glad to hear them. I suppose this
  346. should be kept discrete, in case AutoDesk or Spatial feels that we're
  347. prying. *>) Just joking - I've so far detected no bad vibes from them.

  348. Joe
  349. "Track down the 4 coedges 15, 16, 17, and 18."
  350. should read
  351. "Track down the 3 coedges 15, 16, 17, and the edge 18."

  352. Joe

  353.     Reini Urban has an example of decoding a REGION in the topic
  354. [28] "How to decode ACIS internal geometry with Lisp?"
  355. in his FAQ at [url]http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.2[/url]

  356.     I've been fiddling with decoding ACIS objects when I have time. So far I
  357. can re-create straight edges and simple (2D) spline boundaries, but the code
  358. isn't dependable yet. Some linear algebra is required. I failed linear
  359. algebra.8>\|;

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2003-11-12 17:06:27 | 显示全部楼层
好资料啊,龙龙仔.收下了,抽时间看看:)
还有么?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-26 21:02 , Processed in 0.169178 second(s), 38 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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