找回密码 注册 QQ登录
开思网工业级高精度在线3D打印服务

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?快速3D打印 手板模型CNC加工服务在线3D打印服务,上传模型,自动报价
查看: 17674|回复: 13
打印 上一主题 下一主题

请教一个CAA的问题!!!!!

[复制链接]
1
发表于 2004-11-11 16:16:47 | 显示全部楼层
找到当前part的所有点(这个所有的范围要自己定)
然后求各点到线的距离,小于当前GeoFactory的GetResolution的就算在线
  
当然还可以用找子的方法等,看你对点的要求
2
发表于 2004-11-11 17:54:07 | 显示全部楼层
什么叫‘天然’的联系?
3
发表于 2004-11-12 15:35:47 | 显示全部楼层
[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之类
4
发表于 2004-11-15 14:06:15 | 显示全部楼层
// 求2个body间的最短距离
CATDistanceMinBodyBody* pDistanceMinB2B = ::CATCreateDistanceMinTopo( pGeoFactory,pTopData, pBody1, pBody2, ADVANCED );
if ( !pDistanceMinB2B )  rc=E_FAIL;break;
pDistanceMinB2B->SetPointComputationMode( TRUE );
CATTry{
pDistanceMinB2B->Run();
}CATCatch ( CATError, pError){
delete pDistanceMinB2B;
pDistanceMinB2B = NULL;
rc=CATReturnError(pError);
break;
}CATEndTry;
double MiniDistance = pDistanceMinB2B->GetDistance();
delete pDistanceMinB2B;
pDistanceMinB2B = NULL;
//If the distance could not be computed, returns -1.  
if ( Temp1 < -ipImplicitGeoFactory->GetResolution() ) rc=E_FAIL;break;
  
你不是自己写了找点的程序了吗?你自己程序怎么运行的?
我给你的东西不过是参考呀
5
发表于 2004-11-16 11:06:16 | 显示全部楼层
windswolftxl wrote:
我写的程序不是找点的,是用户选定点,用程序提取点的坐标,进行输出!  
  
  您那个程序中的  
  
  HRESULT WSHSampleOperator::GetMathPointListFromBody( const CATBody_var& ispBody, CATLISTV(CATMathPoint) &oLISTMathPoint )   
  
  这个函数的oLISTMathPoint参数是之前定义好的吗?

  
o--输出
i-输入
  
那一样的呀,你不也得设CATFeatureImportAgent或CATPathElementAgent 接受用户的点选择,然后从Agent里取得点的CATISpecObject之类的interface
然后求坐标不的吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2025-7-24 14:00 , Processed in 0.023035 second(s), 12 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2025 www.iCAx.org

快速回复 返回顶部 返回列表