如何求屋面膜的面积
本人手上有一工程结算,在计算屋面膜面积时犯了难一直求不出来(结构如下图、手上有CAD)。所以请教各位大神,在此先谢过了。http://bbs.mjtd.com/xwb/images/bgimg/icon_logo.png 该贴已经同步到 我爱欧洲杯123的微博 根据图面三角网计算表面积 论坛测量测绘 用犀牛插件grasshopper中的area电池,应该能很好解决楼主的问题 把膜炸开成3DFace,再用下面的程序得出
;;;Calculate the total area of all selected 3DFaces
(defun C:FArea
(/ farea parea ss idx cpt1 cpt2 cpt3 cpt4 a1 b1 c1 a2 b2 c2)
(if (setq ss (ssget '((0 . "3DFACE"))))
(progn
(setq idx 0
farea 0
)
(repeat (sslength ss)
(setq ent (entget (ssname ss idx)))
(setq cpt1 (dxf 10 ent)
cpt2 (dxf 11 ent)
cpt3 (dxf 12 ent)
cpt4 (dxf 13 ent)
)
(setq a1 (distance cpt1 cpt2)
b1 (distance cpt1 cpt3)
c1 (distance cpt2 cpt3)
a2 (distance cpt1 cpt4)
b2 (distance cpt1 cpt3)
c2 (distance cpt3 cpt4)
)
(setq farea
(+
farea
(/ (sqrt (ABS (- (expt (+ (expt a1 2)
(expt b1 2)
(expt c1 2)
)
2
)
(* 2 (+ (expt a1 4) (expt b1 4) (expt c1 4)))
)
)
)
4.0
)
(/ (sqrt (ABS (- (expt (+ (expt a2 2)
(expt b2 2)
(expt c2 2)
)
2
)
(* 2 (+ (expt a2 4) (expt b2 4) (expt c2 4)))
)
)
)
4.0
)
)
)
(setq idx (1+ idx))
) ; repeat
(setq idx 0
parea 0
)
(repeat (sslength ss)
(setq ent (entget (ssname ss idx)))
(setq cpt1 (flatten (dxf 10 ent))
cpt2 (flatten (dxf 11 ent))
cpt3 (flatten (dxf 12 ent))
cpt4 (flatten (dxf 13 ent))
)
(setq a1 (distance cpt1 cpt2)
b1 (distance cpt1 cpt3)
c1 (distance cpt2 cpt3)
a2 (distance cpt1 cpt4)
b2 (distance cpt1 cpt3)
c2 (distance cpt3 cpt4)
)
(setq parea
(+
parea
(/ (sqrt (ABS (- (expt (+ (expt a1 2)
(expt b1 2)
(expt c1 2)
)
2
)
(* 2 (+ (expt a1 4) (expt b1 4) (expt c1 4)))
)
)
)
4.0
)
(/ (sqrt (ABS (- (expt (+ (expt a2 2)
(expt b2 2)
(expt c2 2)
)
2
)
(* 2 (+ (expt a2 4) (expt b2 4) (expt c2 4)))
)
)
)
4.0
)
)
)
(setq idx (1+ idx))
) ; repeat
(alert (strcat "\nSurface Area:"
(rtos farea 1 3)
" unit sq."
"\nPlan Area: "
(rtos parea 1 3)
" unit sq."
)
)
) ;progn
) ; if
(princ)
) ;end defun
(defun Flatten (pt)
(list (car pt) (cadr pt) 0)
) 感谢 alin 分享程序!!!! alin 发表于 2017-9-20 12:51
把膜炸开成3DFace,再用下面的程序得出
;;;Calculate the total area of all selected 3DFaces
CAD拉伸的三维实体炸开后无法测量?如何让炸开的面是3DFACE? alin 发表于 2017-9-20 12:51
把膜炸开成3DFace,再用下面的程序得出
;;;Calculate the total area of all selected 3DFaces
老哥,可以分享一下同时计取曲面、面域、多段线的面积的程序嘛
页:
[1]