iCAx开思网
标题:
如何获得操作树中的镜像操作
[打印本页]
作者:
wxmdef
时间:
2014-5-19 15:15
标题:
如何获得操作树中的镜像操作
我要判断零件的对称性问题,想通过提取镜像操作获得,求教如何获取镜像操作?谢谢了
作者:
linlily0925
时间:
2014-5-29 20:30
CATIGSMSymmetry
作者:
wxmdef
时间:
2014-5-29 21:17
linlily0925 发表于 2014-5-29 20:30
CATIGSMSymmetry
嗯,已经解决一部分了,下面这段代码只能检测到以实体为对象的镜像特征,而以特征树上选择的对象生成的镜像特征就识别不出来,应该是GetBReps()函数的问题,不知道该怎么改
CATLISTV(CATISpecObject_var) filletFeatures;
CATIDescendants *pPartAsDescendant = NULL;
rc = spPart->QueryInterface(IID_CATIDescendants, (void**)&pPartAsDescendant) ;
if( FAILED(rc) )
{
cout <<" The MechanicalPart does not implement CATIDescendant" << endl;
}
// pPartAsDescendant->GetAllChildren("CATIFillet", filletFeatures);
pPartAsDescendant->GetAllChildren("CATIMirror", filletFeatures);
cout<<filletFeatures.Size()<<"个倒角操作"<<endl;
for(int currentFillet=1; currentFillet<=filletFeatures.Size(); currentFillet++)
{
const CATISpecObject_var& currentfilletFeature = filletFeatures[currentFillet];
if ( NULL_var != currentfilletFeature )
{
//
// 6-2 Gets the BRep associated with the fillet
//
CATIMfGeometryAccess *pFilletAsGeomAccess = NULL;
rc= currentfilletFeature->QueryInterface(IID_CATIMfGeometryAccess,
(void**)&pFilletAsGeomAccess) ;
if ( SUCCEEDED(rc) )
{
CATLISTV(CATBaseUnknown_var) filletBReps;
pFilletAsGeomAccess->GetBReps(filletBReps);
// 6-3 Colorizes BRep
for(int currentBRep=1; currentBRep<=filletBReps.Size(); currentBRep++)
{
CATIVisProperties *pFilletBrepAsGraphics = 0;
const CATBaseUnknown_var& currentfilletBRep = filletBReps[currentBRep];
if (NULL_var != currentfilletBRep)
rc = currentfilletBRep->QueryInterface(IID_CATIVisProperties,
(void**)&pFilletBrepAsGraphics) ;
else
rc = E_FAIL;
if ( SUCCEEDED(rc) )
{
CATVisPropertiesValues color;
color.SetColor(0, 255, 0); // green
pFilletBrepAsGraphics->SetPropertiesAtt(color, CATVPColor, CATVPMesh);
pFilletBrepAsGraphics->Release();
pFilletBrepAsGraphics = NULL ;
}
}
pFilletAsGeomAccess->Release();
pFilletAsGeomAccess = NULL ;
}
}
}
pPartAsDescendant->Release();
pPartAsDescendant = NULL ;
}
作者:
hunter1985
时间:
2014-7-27 09:05
有没有简单点的
欢迎光临 iCAx开思网 (https://www.icax.org/)
Powered by Discuz! X3.3