+ if (anOwnCyl && anOtherCyl)
+ return anOwnCyl->isCoincident(anOtherCyl);
+
+ // compare two swept surfaces of the same type
+ if ((anOwnSurf->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion)) &&
+ anOtherSurf->IsKind(STANDARD_TYPE(Geom_SurfaceOfLinearExtrusion))) ||
+ (anOwnSurf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution)) &&
+ anOtherSurf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution)))) {
+ Handle(Geom_SweptSurface) anOwnSwept = Handle(Geom_SweptSurface)::DownCast(anOwnSurf);
+ Handle(Geom_SweptSurface) anOtherSwept = Handle(Geom_SweptSurface)::DownCast(anOtherSurf);
+
+ const gp_Dir& anOwnDir = anOwnSwept->Direction();
+ const gp_Dir& anOtherDir = anOtherSwept->Direction();
+
+ if (anOwnDir.IsParallel(anOtherDir, Precision::Angular())) {
+ Handle(Geom_Curve) anOwnCurve = anOwnSwept->BasisCurve();
+ Handle(Geom_Curve) anOtherCurve = anOtherSwept->BasisCurve();
+ GeomAPI_ExtremaCurveCurve anExtrema(anOwnCurve, anOtherCurve);
+ return anExtrema.Extrema().IsParallel() &&
+ anExtrema.TotalLowerDistance() < Precision::Confusion();
+ }
+ }