- 积分
- 6483
- 明经币
- 个
- 注册时间
- 2002-4-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2002-10-13 08:47:00
|
显示全部楼层
因为不光是1满足:
70 Polyline flag (bit-coded); default is 0:
1 = This is a closed polyline (or a polygon mesh closed in the M direction)
2 = Curve-fit vertices have been added
4 = Spline-fit vertices have been added
8 = This is a 3D polyline
16 = This is a 3D polygon mesh
32 = The polygon mesh is closed in the N direction
64 = The polyline is a polyface mesh
128 = The linetype pattern is generated continuously around the vertices of this polyline
比如,1+8=9
即二进制 0001 + 1000 = 1001
如果碰到一条polyline, 它是(70 . 9)的,
那么,根据9的二进制为1001, 它的右边第一位是1,说明它是闭合的。
又根据从右边数第4位也是1,说明这同时还是一条3dpoly
如何判断右边第一位是1呢,用 0001与它做逻辑与运算,
即 0001 and 1001 = 0001
所以,(logand 1 (cdr (assoc 70 ent)))即可判断右边第一位是不是1
同理,用 1000 (十进制即为8)与它做与运算,可以判断它是不是3dpoly
即 (logand 8 (cdr (assoc 70 ent)))
如果直接判断是不是为1,当然会漏掉好过种可能,你将不能正确判断闭合的3dpoly, 闭合的但fit过的polyline, 闭合的3dmesh等等。判断就不准确。 |
|