马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;|
- 获得3DMESH的基本数据
- 参数:
- e ---- 实体名
- mode-- 模式,T 强制更新 NIL,如果先前读取过不再更新内部表
- 返回值:关联表
- 如:(("Vertices" (28.6602 17.2293 0.0) (38.4865 16.3877 0.0) (30.2511 13.5824
- 0.0) (41.6684 12.4603 0.0) (31.0466 10.3563 0.0) (43.0254 8.62634 0.0) (31.0934
- 5.77427 0.0) (45.4586 5.25996 0.0) (32.076 2.59492 0.0)) ("MNCounts" 3 3)
- ("BoundingBox" (28.6602 17.2293 0.0) (30.2511 13.5824 0.0) (32.076 2.59492 0.0)
- (31.0934 5.77427 0.0)) ("Border" (28.6602 17.2293 0.0) (30.2511 13.5824 0.0)
- (32.076 2.59492 0.0) (31.0934 5.77427 0.0)) ("CoordSystem" (28.6602 17.2293
- 0.0) (0.399851 -0.91658 0.0) (0.207777 -0.978176 0.0) (0.0 0.0 -0.20068)))
- |;
- (defun XD::Entity:3DMESH-Data (e mode / _data _ori _xdir _ydir _zdir border
- border1 grids m n vts
- )
- (if (and
- (not mode)
- (setq info (assoc e $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST))
- )
- (cadr info)
- (progn
- (foreach n $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST
- (setq e (car n))
- (if (not (entget e))
- (setq $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST (vl-remove n $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST))
- )
- )
- (if (= "AcDbPolygonMesh" (cadr (xdrx_object_classname e)))
- (progn
- (setq old (assoc e $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST))
- (if old
- (setq $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST (vl-remove old $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST))
- )
- (setq vts (XD::Entity:3DMESH-getVertexAt e -1)
- grids (XD::Entity:3DMESH-MNCount e)
- m (car grids)
- n (cadr grids)
- border (XD::Entity:3DMESH-Border e)
- border1 (XD::Pnts:SetZ border 0.0)
- _ori (car border)
- _xdir (xdrx_vector_normalize (mapcar
- '-
- (cadr border1)
- (car border1)
- )
- )
- _ydir (xdrx_vector_normalize (mapcar
- '-
- (cadddr border1)
- (car border1)
- )
- )
- _zdir (xdrx_vector_crossProduct _xdir _ydir)
- _data (list (cons "Vertices" vts) (cons "MNCounts" grids)
- (cons "BoundingBox" border1) (cons "Border"
- border
- ) (cons "CoordSystem"
- (list _ori _xdir _ydir _zdir)
- )
- )
- )
- (setq old (assoc e $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST))
- (setq new (list e _data))
- (if (not old)
- (setq $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST (cons new $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST))
- (progn
- (setq $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST (subst new old $XDTB_GLOBAL_VAR_3DMESH_ENTITY_LIST))
- )
- )
- _data
- )
- )
- )
- )
- )
|