判断两条线段是否共线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("\n共线1"));
}
else
{
acutPrintf(_T("\n不共线"));
}
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("\n共线2"));
}
else
{
acutPrintf(_T("\n不共线"));
}
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("\n共线3"));
}
else
{
acutPrintf(_T("\n不共线3"));
}
页:
[1]