zoukankan      html  css  js  c++  java
  • ObjectARX学习笔记(廿九)---判断两条线段是否共线AcGeLineSeg3d ObjectARX学习笔记(廿八)---如何计算两条线段的交点AcGeLineSeg3d

    AcGeLineSeg3d acGeLineSegtmp1(AcGePoint3d(0,0,0),AcGePoint3d(100,0,0));
    AcGeLineSeg3d acGeLineSegtmp2(AcGePoint3d(10,0,0),AcGePoint3d(90,0,0));
    AcGeTol gGetol;
    gGetol.setEqualPoint(0.01);
    Adesk::Boolean bRec;
    bRec = acGeLineSegtmp1.isColinearTo(acGeLineSegtmp2); //此函数只是判断是否共线
    if (bRec)
    {
    acutPrintf(_T(" 共线1"));
    }
    else
    {
    acutPrintf(_T(" 不共线"));
    }
    acGeLineSegtmp1.set(AcGePoint3d(0,0,0),AcGePoint3d(100,0,0));
    acGeLineSegtmp2.set(AcGePoint3d(0,0,0),AcGePoint3d(100,0,0));

    bRec = acGeLineSegtmp1.isColinearTo(acGeLineSegtmp2);
    if (bRec)
    {
    acutPrintf(_T(" 共线2"));
    }
    else
    {
    acutPrintf(_T(" 不共线"));
    }

    acGeLineSegtmp1.set(AcGePoint3d(0,0,0),AcGePoint3d(100,0,0));
    acGeLineSegtmp2.set(AcGePoint3d(0,0,0),AcGePoint3d(101.9,0,0));

    bRec = acGeLineSegtmp1.isColinearTo(acGeLineSegtmp2);
    if (bRec)
    {
    acutPrintf(_T(" 共线3"));
    }
    else
    {
    acutPrintf(_T(" 不共线3"));
    }

    ObjectARX学习笔记(廿八)---如何计算两条线段的交点AcGeLineSeg3d

    <pre name="code" class="cpp">AcGeLineSeg3d acGeLineSegtmp1(AcGePoint3d(0,100,0),AcGePoint3d(50,100,0));
    AcGeLineSeg3d acGeLineSegtmp2(AcGePoint3d(-50,50,0),AcGePoint3d(-50,120,0));
    AcGeTol gGetol;gGetol.setEqualPoint(0.001);//设置精度
    AcGePoint3d intPnt;//交点
    bool bRec = acGeLineSegtmp1.intersectWith(acGeLineSegtmp2,intPnt,gGetol);//交点
     


     

  • 相关阅读:
    《闯关东》群英传
    这老太太
    URL重写与伪静态
    创建索引视图时提示架构绑定无效,名称必须由两部分构成
    马色见
    食神智多星
    Beautiful Code and Beautiful Software
    /wp64 Compiler Option
    C++的x64移植
    Managing the State Data of MFC Modules
  • 原文地址:https://www.cnblogs.com/mjgw/p/12392806.html
Copyright © 2011-2022 走看看