From df6f6dd2f958dd50d07c925945eb739adf550b13 Mon Sep 17 00:00:00 2001 From: azv Date: Mon, 25 Jul 2022 11:49:38 +0300 Subject: [PATCH] 0054774: Wire on sphere is not recognised as laying on sphere without optional parameters --- src/GeomAlgoAPI/GeomAlgoAPI_CanonicalRecognition.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_CanonicalRecognition.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_CanonicalRecognition.cpp index 43a690fb0..e910c0997 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_CanonicalRecognition.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_CanonicalRecognition.cpp @@ -95,6 +95,8 @@ bool GeomAlgoAPI_CanonicalRecognition::isSphere(const GeomShapePtr& theShape, do aSphere.SetLocation(gp_Pnt(theOrigin[0], theOrigin[1], theOrigin[2])); aSphere.SetRadius(theRadius); } + else + aSphere.SetRadius(1.0); ShapeAnalysis_CanonicalRecognition aRecognition(aShape); bool aResult = false; try { @@ -137,6 +139,8 @@ bool GeomAlgoAPI_CanonicalRecognition::isCone(const GeomShapePtr& theShape, doub gp_Ax3 aAx3(aLoc, gp_Dir(theAxis[0], theAxis[1], theAxis[2])); aCone.SetPosition(aAx3); } + else + aCone.SetRadius(1.0); ShapeAnalysis_CanonicalRecognition aRecognition(aShape); bool aResult = false; try { @@ -188,6 +192,8 @@ bool GeomAlgoAPI_CanonicalRecognition::isCylinder(const GeomShapePtr& theShape, aCylinder.SetPosition(aAx3); aCylinder.SetRadius(theRadius); } + else + aCylinder.SetRadius(1.0); ShapeAnalysis_CanonicalRecognition aRecognition(aShape); bool aResult = false; try { @@ -284,6 +290,8 @@ bool GeomAlgoAPI_CanonicalRecognition::isCircle(const GeomShapePtr& theEdge, dou aCircle.SetPosition(aAx2); aCircle.SetRadius(theRadius); } + else + aCircle.SetRadius(1.0); ShapeAnalysis_CanonicalRecognition aRecognition(aShape); bool aResult = false; try { @@ -337,6 +345,8 @@ bool GeomAlgoAPI_CanonicalRecognition::isEllipse(const GeomShapePtr& theEdge, do gp_Dir(theDirX[0], theDirX[1], theDirX[2])); aElips = gp_Elips(aAx2, theMajorRadius, theMinorRadius); } + else + aElips.SetMajorRadius(1.0); ShapeAnalysis_CanonicalRecognition aRecognition(aShape); bool aResult = false; try { -- 2.39.2