Update for bug 0019891 from Mantis.

This commit is contained in:
skl 2008-06-20 09:09:41 +00:00
parent 4941fff010
commit 01421722a7
3 changed files with 18 additions and 4 deletions

View File

@ -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)

View File

@ -148,9 +148,11 @@ distance is computed.
\anchor angle_anchor
<br><h2>Angle</h2>
\n Returns the angle between two lines or linear edges
\n Returns the angle between two lines or linear edges in degrees
\n <b>TUI Command:</b> <em>geompy.GetAngle(shape1, shape2),</em> 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 <em>geompy.GetAngleRadians(shape1,shape2),</em>
which returns the value of angle in radians.
\image html angle.png

View File

@ -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.