- 积分
- 178
- 明经币
- 个
- 注册时间
- 2003-4-4
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
用arx生成两个实体,用循环语句反复进行布尔运算(subtract),循环到一半时,AutoCAD名令行提示如下:实体上布尔运算失败。建模操作错误:相交曲线的包容不一致。实在搞不清楚什么意思。请各位高手指点。源代码如下。两个实体指针已定义。
int tol=int(Q2);
AcDbObjectId objIdS1;
for(i=tol-30;i<=tol+30;i++)
{
if(i<tol+30){objIdS1=copy(ids);}
else{objIdS1=ids;}
acdbOpenObject(p3dObj1,objIdS1,AcDb::kForWrite);
x1.set(cos(Jf2),0,-sin(Jf2));
y1.set(-sin(Jf2),0,-cos(Jf2));
z1.set(0,1,0);
moveBy1.x=sg*cos(i*PI/180)*cos(Jf2);
moveBy1.y=-sg*sin(i*PI/180);
moveBy1.z=-sg*sin(Jf2)*cos(i*PI/180);
mat1.setCoordSystem(moveBy1,x1,y1,z1);
p3dObj1->transformBy(mat1);
p3dObj1->close();
x.set(1,0,0);
y.set(0,cos(PI*mg2/180),-sin(PI*mg2/180));
z.set(0,sin(PI*mg2/180),cos(PI*mg2/180));
mat.setCoordSystem(moveBy,x,y,z);
acdbOpenObject(p3dObj,objId,AcDb::kForWrite);
acdbOpenObject(p3dObj1,objIdS1,AcDb::kForWrite);
p3dObj->transformBy(mat);
p3dObj->booleanOper(AcDb::kBoolSubtract,p3dObj1);
p3dObj->close();
p3dObj1->close(); |
|