From 01421722a720e09c9ba9e6400a002f2a6722f13a Mon Sep 17 00:00:00 2001 From: skl Date: Fri, 20 Jun 2008 09:09:41 +0000 Subject: [PATCH] Update for bug 0019891 from Mantis. --- doc/salome/gui/GEOM/input/tui_measurement_tools.doc | 7 +++++++ doc/salome/gui/GEOM/input/using_measurement_tools.doc | 6 ++++-- src/GEOM_SWIG/geompyDC.py | 9 +++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/salome/gui/GEOM/input/tui_measurement_tools.doc b/doc/salome/gui/GEOM/input/tui_measurement_tools.doc index 1b4941394..ff70d793a 100644 --- a/doc/salome/gui/GEOM/input/tui_measurement_tools.doc +++ b/doc/salome/gui/GEOM/input/tui_measurement_tools.doc @@ -286,6 +286,13 @@ if math.fabs(Angle - 45.0) > 1e-05: print " Error: returned angle is", Angle, "while must be 45.0" pass +Angle = geompy.GetAngleRadians(OX, OXY) + +print "\nAngle between OX and OXY in radians = ", Angle +if math.fabs(Angle - math.pi/4) > 1e-05: + print " Error: returned angle is", Angle, "while must be pi/4" + pass + # not in one plane OXY_shift = geompy.MakeTranslation(OXY,10,-10,20) Angle = geompy.GetAngle(OX, OXY_shift) diff --git a/doc/salome/gui/GEOM/input/using_measurement_tools.doc b/doc/salome/gui/GEOM/input/using_measurement_tools.doc index 4793b9299..506fe2cff 100644 --- a/doc/salome/gui/GEOM/input/using_measurement_tools.doc +++ b/doc/salome/gui/GEOM/input/using_measurement_tools.doc @@ -148,9 +148,11 @@ distance is computed. \anchor angle_anchor

Angle

-\n Returns the angle between two lines or linear edges +\n Returns the angle between two lines or linear edges in degrees \n TUI Command: geompy.GetAngle(shape1, shape2), where -Shape1 and Shape2 are shapes between which the angle is computed. +Shape1 and Shape2 are shapes between which the angle is computed. +Another TUI command is geompy.GetAngleRadians(shape1,shape2), +which returns the value of angle in radians. \image html angle.png diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index cdb8854ed..29d14debf 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -2414,9 +2414,9 @@ class geompyDC(GEOM._objref_GEOM_Gen): aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]] return aRes - ## Get angle between the given shapes. + ## Get angle between the given shapes in degrees. # @param theShape1,theShape2 Lines or linear edges to find angle between. - # @return Value of the angle between the given shapes. + # @return Value of the angle between the given shapes in degrees. # # @ref tui_measurement_tools_page "Example" def GetAngle(self, theShape1, theShape2): @@ -2424,6 +2424,11 @@ class geompyDC(GEOM._objref_GEOM_Gen): anAngle = self.MeasuOp.GetAngle(theShape1, theShape2) RaiseIfFailed("GetAngle", self.MeasuOp) return anAngle + ## Get angle between the given shapes in radians. + # @param theShape1,theShape2 Lines or linear edges to find angle between. + # @return Value of the angle between the given shapes in radians. + # + # @ref tui_measurement_tools_page "Example" def GetAngleRadians(self, theShape1, theShape2): # Example: see GEOM_TestMeasures.py anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180. -- 2.39.2