天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 81|回复: 0

arx源码222

[复制链接]

该用户从未签到

主题

0

回帖

2912

积分

管理员

积分
2912
发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
[code]bool
myfunc(AcGeLineSeg3d x, AcGeLineSeg3d y, AcGeTol tol)
{
    AcGeVector3d v1 = x.endPoint().asVector() - x.startPoint().asVector() ;
    AcGeVector3d v2 = y.endPoint().asVector() - y.startPoint().asVector() ;

    AcGeVector3d nulvec = AcGeVector3d::kIdentity;

    v1.normalize();
    v2.normalize();

    AcGeVector3d sum = v1+v2;
    AcGeVector3d dif = v1-v2;
    AcGeTol zeroTol;
    zeroTol.setEqualPoint(0.0);
    zeroTol.setEqualVector(0.0);

    if ((sum == nulvec) || (dif == nulvec))
      return false;
     
    //if(sum.isEqualTo(nulvec,zeroTol) || dif.isEqualTo(nulvec,zeroTol))
    //    return true;

    return ! (v1.isParallelTo(v2, tol));
}

void AcGeLineSeg3dTest::intersection()
{
   AcGeTol told;
   double dtold=0.1;
   told.setEqualPoint(dtold);
   //told.setEqualPoint(1.0);
   told.setEqualVector(dtold);
   //told.setEqualVector(0.01);
   AcGePoint3d ptInsd1;

   

   Adesk::Boolean retdx = Adesk::kTrue, retd1= Adesk::kTrue;
   double deltad = 1e-5, gap = 0.0;

   unsigned long long x=0, NN=100000;

    x=NN;

   while(x--!=1)
   {
       AcGePoint3d pt1Adl(0.0,0.0+gap,0.0);
       AcGePoint3d pt1Bdl(100.0,0.0,0.0);
       AcGePoint3d pt2Adl(0.0,0.0,0.0);
       AcGePoint3d pt2Bdl(100.0,0.0,0.0);
       AcGeLineSeg3d lSeg1dl(pt1Adl,pt1Bdl);
       AcGeLineSeg3d lSeg2dl(pt2Adl,pt2Bdl);
             retdx = lSeg1dl.intersectWith(lSeg2dl,ptInsd1,told);
       retd1 = myfunc(lSeg1dl, lSeg2dl, told);
       if((retd1!=retdx))
           break;
       gap+=deltad;
       //pt1Ad.set(pt1Ad.x+gap,pt1Ad.y,pt1Ad.z);
       //lSeg1d.set(pt1Ad,pt1Bd);
   }

    CPPUNIT_ASSERT ( !x);

    x=NN;
   while(x--!=1)
   {
       AcGePoint3d pt1Adl(0.00000000 ,0.00000000+gap,0.00000000);
       AcGePoint3d pt1Bdl(100.0000000 ,0.00000000,0.00000000);
       AcGePoint3d pt2Adl(300.00000000 ,0.00000000 ,0.00000000);
       AcGePoint3d pt2Bdl(100.00000000 ,0.00000000 ,0.00000000);
       AcGeLineSeg3d lSeg1dl(pt1Adl,pt1Bdl);
       AcGeLineSeg3d lSeg2dl(pt2Adl,pt2Bdl);

       retd1 = lSeg1dl.intersectWith(lSeg2dl,ptInsd1,told);
       retdx = myfunc(lSeg1dl, lSeg2dl, told);
       if(retdx!=retd1)
           break;
       gap+=deltad;
       //pt1Ad.set(pt1Ad.x+gap,pt1Ad.y,pt1Ad.z);
       //lSeg1d.set(pt1Ad,pt1Bd);
   }
    CPPUNIT_ASSERT ( !x);
return;[/code]

 

 

 

 

arx源码222
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|中国膜结构网_中国空间膜结构协会

GMT+8, 2024-11-1 15:22 , Processed in 0.195940 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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