[quote][b]windswolftxl wrote:[/b]
多谢各位高手!!!
有没有能直接找到点的方法呀??
因为我有上千个点,判断起来会不会很慢呀???
多谢多谢!!!! [/quote]
如果你只要点的坐标
可以用GetResultBody之类的得到整个PartBody的形状,然后用GetDomain之类来得到所有1次元的元素(点)
给你1个从指定body求所有点的坐标的sample吧,不得照抄,如果在商业程序中使用,请通知我
HRESULT WSHSampleOperator::GetMathPointListFromBody( const CATBody_var& ispBody, CATLISTV(CATMathPoint) &oLISTMathPoint )
{
HRESULT rc = S_OK;
do {
if ( !ispBody ) {
rc = E_FAIL;
break;
}
CATLISTP(CATCell) LISTCell;
ispBody->GetAllCells( LISTCell, 0 );
for( int index = 1; index <= LISTCell.Size(); index++ ){
CATCell *pPointCell = LISTCell[index];
if(!pPointCell){
continue;
}
CATCell_var spPointCell = pPointCell;
if(!spPointCell){
continue;
};
CATVertex_var spVertex = spPointCell;
if( !spVertex ){
continue;
}
CATPoint *pPoint = spVertex->GetPoint();
if(!pPoint){
continue;
}
double pointX = 0.0;
double pointY = 0.0;
double pointZ = 0.0;
pPoint->GetCoord(pointX, pointY, pointZ);
CATMathPoint mathPoint( pointX, pointY, pointZ );
oLISTMathPoint.Append(mathPoint);
}
} while ( FALSE );
return rc;
}
你是要用这个做逆向?
或许你该想想如何充分利用现有的command,比如用section, drafting之类 |