找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1363|回复: 10

[求助] [求助]:请教斑竹,多面网格的问题??急!!!

[复制链接]
发表于 2006-4-20 18:49:28 | 显示全部楼层 |阅读模式

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

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

×
斑竹看看利用程序或命令怎样将图内下边的图形(平面多边形)转换(变)成上边的两个图形(平面多面网格),多谢!!!!!急!!!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2006-4-21 13:56:52 | 显示全部楼层
附件无法下载!!!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-21 15:10:24 | 显示全部楼层
最初由 xyp1964 发布
[B]附件无法下载!!! [/B]


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

使用道具 举报

发表于 2006-4-24 13:57:23 | 显示全部楼层
目前仅限于四边形:
  1. [FONT=courier new](load "xyp_lib.vlx")  ;版本 V.20060422
  2. ;|下载和加载通用函数(可在签名栏直接下载后放到搜索路径下)
  3. 利用以下任何一种方式(首选第一种)即可加载和运行通用函数内的所有子程序:
  4. ★1·在acad.lsp中增加(load"xyp_lib.vlx")
  5. ■2·在每个程序内增加(load"xyp_lib.vlx")
  6. ■3·在command下,输入(load"xyp_lib.vlx")
  7. ■4·在菜单.mnl中增加(load"xyp_lib.vlx")
  8. ■5·将xyp_lib.vlx文件直接拽到cad屏幕
  9. [COLOR=red] ★通用函数下载地址:[/COLOR]
  10. [url]http://www.xdcad.net/forum/attachment.php?s=&postid=1606661[/url]
  11. [url]http://free.ys168.com/?xyp1964[/url]
  12. |;

  13. ;;; pface 多面网格
  14. ;;; 多面网格类似于三维网格。两种网格都是逐点构造的,因此可以创建不规则表面形状。
  15. ;;; 通过指定各个顶点,然后将这些顶点与网格中的面关联,可以定义多面网格。多面网格将作为一个单元来编辑。
  16. ;;; 通常情况下,通过应用程序而不是用户直接输入来使用 PFACE 命令。
  17. ;;; [url]http://www.xdcad.net/forum/showthread.php?s=&threadid=548288[/url]
  18. (defun c:test ()
  19.   (CMDLASC0)
  20.   (setvar "osmode" 0)
  21.   (setq        ss   (ssget '((0 . "*POLYLINE")))
  22.         real (UREAL 3 "" "\n高度" real)
  23.         ptn  '()
  24.         i    -1
  25.   )
  26.   (xyp-mklaco"4bx"2)
  27.   (while (setq s1 (ssname ss (setq i (1+ i))))
  28.     (setq ptn        (xyp-get-Vertexs s1 1)
  29.           ptn-h        '()
  30.     )
  31.     (foreach pt        ptn
  32.       (setq pt-h  (list (car pt) (cadr pt) (+ (caddr pt) real))
  33.             ptn-h (cons pt-h ptn-h)
  34.       )
  35.     )
  36.     (setq ptn-h        (reverse ptn-h)
  37.           ptn-h        (append ptn ptn-h)
  38.           j        0
  39.     )
  40.     ;|
  41.     (foreach pt        ptn-h
  42.       (xyp-Text 5 pt (rtos (setq j (1+ j)) 2 0))
  43.     )|;
  44.     (command "pface")
  45.     (foreach pt        ptn-h
  46.       (command pt)
  47.     )
  48.     (command "")
  49.     (foreach n '((1 2 5)
  50.                  (2 5 6)
  51.                  (2 3 6)
  52.                  (3 6 7)
  53.                  (3 4 7)
  54.                  (4 7 8)
  55.                  (4 1 8)
  56.                  (1 8 5)
  57.                  (1 2 3)
  58.                  (1 3 4)
  59.                  (5 6 7)
  60.                  (5 7 8)
  61.                 )
  62.       (command (car n))
  63.       (command (cadr n))
  64.       (command (caddr n))
  65.       (command "")
  66.     )
  67.     (command "")
  68.   )
  69.   (CMDLA1)
  70. )[/FONT]
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-24 14:54:24 | 显示全部楼层
最初由 xyp1964 发布
[B]目前仅限于四边形:
[CODE](load "xyp_lib.vlx")  ;版本 V.20060422
;|下载和加载通用函数(可在签名栏直接下载后放到搜索路径下)
利用以下任何一种方式(首选第一种)即可加载和运行通用函数内... [/B]


斑竹,您好,不加载您的函数库怎么做??另多边形的房子怎么办??多谢!!您能否公布源码让我学习一下!!多谢!!!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2006-4-24 23:09:36 | 显示全部楼层
命令:dmwg    (多面网格)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

使用道具 举报

 楼主| 发表于 2006-4-25 08:46:21 | 显示全部楼层
最初由 xyp1964 发布
[B]命令:dmwg    (多面网格) [/B]


斑竹,您好,不加载您的函数库怎么做??多谢!!您能否公布源码让我学习一下!!您的程序是编译过的,我想学习一下源码!或者您能否告诉我程序的大概框架和主要用什么命令?多谢!!!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2006-8-23 18:57:43 | 显示全部楼层
请问如何将多面网格转为实体?有办法吗?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2006-8-23 20:42:19 | 显示全部楼层
有一个程序 mesh2solid的
在这里http://www.cadtutor.org/forum/vi ... 3ee6bb4de607d6ceab1
还没有试过,不知道怎么样
[php]
;;    M2S  (Mesh-to-Solid)
;;    Creates an ACIS solid from an open 3d polygon mesh.
;;
;;    Take 2 - Updated 7/7/1998
;;       - Works with REVSURF'd meshes that touch or cross axis of revolution.
;;       - Works even if solid being constructed is not fully visible on screen.
;;       - Works with all open meshes created with REVSURF, RULESURF,
;;          EDGESURF, TABSURF, AI_MESH, and 3DMESH. Most of the stock 3D
;;          surfaces will work if you use DDMODIFY to open them in the M
;;          and N directions.
;;       - Does not work with polyface entities.
;;
;;    (c) Copyright 1998 Bill Gilliss.
;;        All rights reserved... such as they are.
;;
;;    bill.gilliss@aya.yale.edu    gilliss@iglou.com
;;
;;       I wrote this to create sculptable ACIS terrain models
;;    for architectural site renderings. It could also be used
;;    to create thin shells from meshes, by subtracting a moved
;;    copy of the solid from the original solid. Let me know of
;;    other uses you find for it, or problems you encounter.
;;
;;       The solid is created by projecting each mesh facet "down"
;;    the current z-axis to a plane a user-specified distance below
;;    the lowest vertex. To assure that all parts of the mesh are
;;    generated as solids, this distance can not be zero, but the
;;    solid can be SLICEd later if need be.
;;
;;       The solid will match the displayed mesh: if the mesh has
;;    been smoothed and SPLFRAME is set to 0, the solid will be
;;    smoothed. Otherwise, it will not be. The mesh itself is not
;;    changed at all.
;;


(defun c:m2s (/  ent ename entlst M N MN SN SM ST smooth oldecho vtx d1
                 low vtxcnt vtxmax bot bottom p1 p2 p3 p4 c1 c2 c3 c4
                 b1 b2 b3 b4 soldepth ssall ssrow)

(setq oldecho (getvar "cmdecho"))
(setq oldsnap (getvar "osmode"))
(setq oldblip (getvar "blipmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setvar "blipmode" 0)
(command "undo" "begin")

;;select the mesh
  (setq ent (entsel "Select a polygon mesh to solidify: "))
  (setq ename (car ent))
  (setq entlst (entget ename))

  (if (not (= (cdr (assoc 0 entlst)) "POLYLINE"))
    (progn
      (alert "That is not a polygon mesh.")
      (exit)
      (princ)
    );progn
  );endif

  (if
    (not
      (or
       (= (cdr (assoc 70 entlst)) 16) ;open 3d polygon mesh
       (= (cdr (assoc 70 entlst)) 20) ;open mesh w/ spline-fit vertices
        );or
       );not
     (progn
       (alert "That is not an *open* polygon mesh.")
       (exit)
       (princ)
     );progn
  );endif

;; decide whether to use smoothed or unsmoothed vertices
  (setq M (cdr (assoc 71 entlst)))   ;M vertices
  (setq N (cdr (assoc 72 entlst)))   ;N vertices
  (setq SM (cdr (assoc 73 entlst)))  ;smoothed M vertices
  (setq SN (cdr (assoc 74 entlst)))  ;smoothed N vertices
  (setq ST (cdr (assoc 75 entlst)))  ;surface type
  (if
    (or
      (= (getvar "splframe") 1)      ;use MxN vertices when splframe = 1
      (= ST 0)                       ;or mesh has not been smoothed
      )
    (setq smooth 0
         MN (* M N))
    (setq smooth 1                   ;use SMxSN vertices when mesh is smoothed
          MN (* SM SN)               ;and SPLFRAME = 0
          M SM
          N SN)
    );if

;; determine lowest vertex
  (grtext -2 "Checking out the mesh...")
  (setq vtx ename)
  (setq vtx (entnext vtx))
  (setq d1 (entget vtx))
  (setq bottom (caddr (trans (cdr (assoc 10 d1)) 0 1)))

  (repeat (1- MN)   ;compare with each vertex's z coord
    (setq vtx (entnext vtx))
    (setq d1 (entget vtx))
    (setq low (caddr (trans (cdr (assoc 10 d1)) 0 1)))
    (setq bottom (min bottom low))
    );repeat

;; get desired thickness of solid
  (setq soldepth 0)
  (while
     (zerop soldepth)
     (progn
       (setq soldepth
          (getdist "\nEnter desired thickness of solid below lowest vertex <1>: "))
       (if (not soldepth) (setq soldepth 1.0))
       (if (zerop soldepth)
          (princ "\nThickness can be small, but not zero. (Slice it later, if need be.)"))
        );progn
     );while
  (setq bot (- bottom (abs soldepth)))
   
  (setq p1 ename)
  (if (= smooth 1)
      (setq p1 (entnext p1))) ;skip 1st vtx of smoothed mesh - not true vtx
  (setq ssrow (ssadd))        ;initialize set of extruded segments to be unioned as a row
  (setq ssall (ssadd))        ;initialize set of rows to be unioned into the whole
  (grtext -2 "Creating row...")
  (setq vtxmax (- MN N))
  (setq vtxcnt 1)

;;create row of solid segments
  (while (< vtxcnt vtxmax)

    (if (= 0 (rem vtxcnt N))  ;at end of each row...
        (progn
          (setq rowmsg (strcat "Unioning row "
                       (itoa (/ vtxcnt N)) " of "
                       (itoa (1- M)) "... "))
          (grtext -2 rowmsg)
          (command "union" ssrow "")
          (setq row (entlast))
          (ssadd row ssall)
          (setq ssrow (ssadd))
          (setq p1 (entnext p1)         ;skip to the next vertex
                vtxcnt (1+ vtxcnt))
          );progn
        );if
      
    (grtext -2 "Creating row...")
    (setq p1 (entnext p1)                  ;first vertex of mesh square
          p2 (entnext p1)                  ;second vertex
          p3 p2)
    (repeat (1- n) (setq p3 (entnext p3))) ;walk along to 3rd (p1 + N) vertex
    (setq p4 (entnext p3))                 ;4th vertex of mesh square

    (setq c1 (trans (cdr (assoc 10 (entget p1))) 0 1) ;top coordinates
          c2 (trans (cdr (assoc 10 (entget p2))) 0 1)
          c3 (trans (cdr (assoc 10 (entget p3))) 0 1)
          c4 (trans (cdr (assoc 10 (entget p4))) 0 1)
          b1 (list (car c1) (cadr c1) bot)            ;bottom coordinates
          b2 (list (car c2) (cadr c2) bot)
          b3 (list (car c3) (cadr c3) bot)
          b4 (list (car c4) (cadr c4) bot))
          (LOFT c1 c2 c3 b1 b2 b3)
          (LOFT c2 c3 c4 b2 b3 b4)

    (setq vtxcnt (1+ vtxcnt))
  );while

(grtext -2 "Unioning last row...")
  (command "union" ssrow "")
  (setq row (entlast))
  (ssadd row ssall)
  (if (> M 2)       ;bypass final union for N x 1 meshes (i.e., RULESURF)
    (progn
      (grtext -2 "Unioning all rows...")
       (command "union" ssall "")
        );progn
     );if

;;cleanup
  (command "undo" "end")
  (setvar "cmdecho" oldecho)
  (setvar "osmode" oldsnap)
  (setvar "blipmode" oldblip)
  (setq ssall nil ssrow nil)
  (princ)

);defun

;;============== SUBROUTINES ====================
;(defun *error* (msg)
;  (command)
;  (command "undo" "end")
;  (setvar "cmdecho" oldecho)
;  (setvar "osmode" oldsnap)
;  (setvar "blipmode" oldblip)
;  (princ (strcat "\nError: " msg))
;  );defun

(defun LOFT (r1 r2 r3 s1 s2 s3 / e1 extr highest)
  (command "area" s1 s2 s3 "")
  (if (not (equal (getvar "area") 0.0 0.00000001))
    (progn
      (command "pline" s1 s2 s3 "c")
      (setq highest (max (caddr r1) (caddr r2) (caddr r3)))
      (setq extr (- highest bot))
      (command "extrude" (entlast) "" extr 0.0)
      (command "slice" (entlast) "" "3points" r1 r2 r3 s1)
      (setq e1 (entlast))
      (ssadd e1 ssrow)
      );progn
    );if
  );defun

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

使用道具 举报

发表于 2006-8-29 17:52:15 | 显示全部楼层
以下方法可以适应任意多边形和任意形状(需封闭):
1、把多变形变为面域(命令:region)
2、用ext命令拉伸刚才生成底面域(高度按需)
3、用explode命令炸开刚才拉伸生成的实体。
OK了。只有这样才是基本方法,因为有时多边形里还含有弧线、多意线、样条曲线等等,编程到通用的程度岂不是很复扎?!
不能把问题复扎化。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-29 15:44 , Processed in 0.212486 second(s), 53 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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