最近點用pickPoint來計算,垂點用lastPoint計算. 一般AcDbCurve類可以用AcGe類的 getClosestPointTo 來實現計算需要的點值. 下麵是代碼示例: case AcDb::kOsModeNear: { AcGeLine3d line3d(m_ptA,m_ptC) ...
最近點用pickPoint來計算,垂點用lastPoint計算.
一般AcDbCurve類可以用AcGe類的 getClosestPointTo 來實現計算需要的點值.
下麵是代碼示例:
case AcDb::kOsModeNear: { AcGeLine3d line3d(m_ptA,m_ptC); AcGePointOnCurve3d tmpPt; line3d.getClosestPointTo(pickPoint,tmpPt); AcGePoint3d pt=tmpPt.point();
snapPoints.append(AcGePoint3d(pt)); line3d.set(m_ptB,m_ptD); line3d.getClosestPointTo(pickPoint,tmpPt); pt=tmpPt.point(); snapPoints.append(AcGePoint3d(pt)); } break; case AcDb::kOsModePerp: { AcGeLine3d line3d(m_ptA,m_ptC); AcGePointOnCurve3d tmpPt; line3d.getClosestPointTo(lastPoint,tmpPt); AcGePoint3d pt=tmpPt.point();
snapPoints.append(AcGePoint3d(pt)); line3d.set(m_ptB,m_ptD); line3d.getClosestPointTo(lastPoint,tmpPt); pt=tmpPt.point(); snapPoints.append(AcGePoint3d(pt)); } break;
|