mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-01 04:10:34 +05:00
Update for bug 0019891 from Mantis.
This commit is contained in:
parent
4941fff010
commit
01421722a7
@ -286,6 +286,13 @@ if math.fabs(Angle - 45.0) > 1e-05:
|
|||||||
print " Error: returned angle is", Angle, "while must be 45.0"
|
print " Error: returned angle is", Angle, "while must be 45.0"
|
||||||
pass
|
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
|
# not in one plane
|
||||||
OXY_shift = geompy.MakeTranslation(OXY,10,-10,20)
|
OXY_shift = geompy.MakeTranslation(OXY,10,-10,20)
|
||||||
Angle = geompy.GetAngle(OX, OXY_shift)
|
Angle = geompy.GetAngle(OX, OXY_shift)
|
||||||
|
@ -148,9 +148,11 @@ distance is computed.
|
|||||||
\anchor angle_anchor
|
\anchor angle_anchor
|
||||||
<br><h2>Angle</h2>
|
<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
|
\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
|
\image html angle.png
|
||||||
|
|
||||||
|
@ -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]]
|
aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
|
||||||
return aRes
|
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.
|
# @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"
|
# @ref tui_measurement_tools_page "Example"
|
||||||
def GetAngle(self, theShape1, theShape2):
|
def GetAngle(self, theShape1, theShape2):
|
||||||
@ -2424,6 +2424,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
|
|||||||
anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
|
anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
|
||||||
RaiseIfFailed("GetAngle", self.MeasuOp)
|
RaiseIfFailed("GetAngle", self.MeasuOp)
|
||||||
return anAngle
|
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):
|
def GetAngleRadians(self, theShape1, theShape2):
|
||||||
# Example: see GEOM_TestMeasures.py
|
# Example: see GEOM_TestMeasures.py
|
||||||
anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
|
anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
|
||||||
|
Loading…
Reference in New Issue
Block a user