Salome HOME
Simplification and refactoring of unit tests for SketchPlugin
[modules/shaper.git] / src / SketchPlugin / Test / TestFillet.py
index a52ce5a5cc37af35de8cbc48f4a854411d880105..9a8319f6a622c9c9a1bc8d9265395f2e1460d803 100644 (file)
@@ -105,7 +105,7 @@ def checkSmoothness(theSketch):
 
 def checkArcLineSmoothness(theArc, theLine):
     aCenter = geomDataAPI_Point2D(theArc.attribute("center_point"))
-    aDistance = distancePointLine(aCenter, theLine)
+    aDistance = model.distancePointLine(aCenter, theLine)
     aRadius = arcRadius(theArc)
     assert(math.fabs(aRadius - aDistance) < TOLERANCE)
 
@@ -142,16 +142,6 @@ def arcRadius(theArc):
     aStart = geomDataAPI_Point2D(theArc.attribute("start_point"))
     return model.distancePointPoint(aCenter, aStart)
 
-def distancePointLine(thePoint, theLine):
-    aLineStart = geomDataAPI_Point2D(theLine.attribute("StartPoint"))
-    aLineEnd = geomDataAPI_Point2D(theLine.attribute("EndPoint"))
-    aLength = model.distancePointPoint(aLineStart, aLineEnd)
-
-    aDir1x, aDir1y = aLineEnd.x() - aLineStart.x(), aLineEnd.y() - aLineStart.y()
-    aDir2x, aDir2y = thePoint.x() - aLineStart.x(), thePoint.y() - aLineStart.y()
-    aCross = aDir1x * aDir2y - aDir1y * aDir2x
-    return math.fabs(aCross) / aLength
-
 
 #=========================================================================
 # Initialization of the test