- std::shared_ptr<GeomAPI_Lin> aLin1 = aEdge1->line();
- std::shared_ptr<GeomAPI_Lin> aLin2 = aEdge2->line();
-
- std::shared_ptr<GeomAPI_Pnt> aPnt = aLin1->intersect(aLin2);
- double aParam1 = aLin1->projParam(aPnt);
- double aParam2 = aLin2->projParam(aPnt);
-
- GeomAPI_Curve aCurve1(aShp1);
- GeomAPI_Curve aCurve2(aShp2);
- bool isInside1 = (aParam1 >= (aCurve1.startParam() - Precision::Confusion())) &&
- (aParam1 <= (aCurve1.endParam() + Precision::Confusion()));
- bool isInside2 = (aParam2 >= (aCurve2.startParam() - Precision::Confusion())) &&
- (aParam2 <= (aCurve2.endParam() + Precision::Confusion()));
-
- if (!(isInside1 && isInside2))
- aPnt = std::shared_ptr<GeomAPI_Pnt>();
+ GeomShapePtr anInter = aEdge1->intersect(aEdge2);
+ std::shared_ptr<GeomAPI_Pnt> aPnt;
+ if (anInter && anInter->isVertex())
+ aPnt = anInter->vertex()->point();