AnyCAD Rapid API 2023
Help you to create a better world!
|
Public 成员函数 | |
GDir () | |
GDir (GVec theV) | |
GDir (GXYZ theCoord) | |
GDir (double theXv, double theYv, double theZv) | |
void | SetCoord (int theIndex, double theXi) |
void | SetCoord (double theXv, double theYv, double theZv) |
void | SetX (double theX) |
void | SetY (double theY) |
void | SetZ (double theZ) |
void | SetXYZ (GXYZ theCoord) |
double | Coord (int theIndex) |
void | Coord (double[] theXv, double[] theYv, double[] theZv) |
double | X () |
double | Y () |
double | Z () |
GXYZ | XYZ () |
boolean | IsEqual (GDir theOther, double theAngularTolerance) |
boolean | IsNormal (GDir theOther, double theAngularTolerance) |
boolean | IsOpposite (GDir theOther, double theAngularTolerance) |
boolean | IsParallel (GDir theOther, double theAngularTolerance) |
double | Angle (GDir theOther) |
double | AngleWithRef (GDir theOther, GDir theVRef) |
void | Cross (GDir theRight) |
GDir | Crossed (GDir theRight) |
void | CrossCross (GDir theV1, GDir theV2) |
GDir | CrossCrossed (GDir theV1, GDir theV2) |
double | Dot (GDir theOther) |
double | DotCross (GDir theV1, GDir theV2) |
void | Reverse () |
GDir | Reversed () |
void | Mirror (GDir theV) |
GDir | Mirrored (GDir theV) |
void | Mirror (GAx1 theA1) |
GDir | Mirrored (GAx1 theA1) |
void | Mirror (GAx2 theA2) |
GDir | Mirrored (GAx2 theA2) |
void | Rotate (GAx1 theA1, double theAng) |
GDir | Rotated (GAx1 theA1, double theAng) |
void | Transform (GTrsf theT) |
GDir | Transformed (GTrsf theT) |
Describes a unit vector in 3D space. This unit vector is also called "Direction". See Also gce_MakeDir which provides functions for more complex unit vector constructions Geom_Direction which provides additional functions for constructing unit vectors and works, in particular, with the parametric equations of unit vectors.
GDir.GDir | ( | ) |
Creates a direction corresponding to X axis.
GDir.GDir | ( | GVec | theV | ) |
Normalizes the vector theV and creates a direction. Raises ConstructionError if theV.Magnitude() <= Resolution.
GDir.GDir | ( | GXYZ | theCoord | ) |
Creates a direction from a triplet of coordinates. Raises ConstructionError if theCoord.Modulus() <= Resolution from gp.
GDir.GDir | ( | double | theXv, |
double | theYv, | ||
double | theZv | ||
) |
Creates a direction with its 3 cartesian coordinates. Raises ConstructionError if Sqrt(theXv*theXv + theYv*theYv + theZv*theZv) <= Resolution Modification of the direction's coordinates If Sqrt (theXv*theXv + theYv*theYv + theZv*theZv) <= Resolution from gp where theXv, theYv ,theZv are the new coordinates it is not possible to construct the direction and the method raises the exception ConstructionError.
double GDir.Angle | ( | GDir | theOther | ) |
Computes the angular value in radians between <me> and <theOther>. This value is always positive in 3D space. Returns the angle in the range [0, PI]
Computes the angular value between <me> and <theOther>. <theVRef> is the direction of reference normal to <me> and <theOther> and its orientation gives the positive sense of rotation. If the cross product <me> ^ <theOther> has the same orientation as <theVRef> the angular value is positive else negative. Returns the angular value in the range -PI and PI (in radians). Raises DomainError if <me> and <theOther> are not parallel this exception is raised when <theVRef> is in the same plane as <me> and <theOther> The tolerance criterion is Resolution from package gp.
void GDir.Coord | ( | double[] | theXv, |
double[] | theYv, | ||
double[] | theZv | ||
) |
Returns for the unit vector its three coordinates theXv, theYv, and theZv.
double GDir.Coord | ( | int | theIndex | ) |
Returns the coordinate of range theIndex : theIndex = 1 => X is returned Ithendex = 2 => Y is returned theIndex = 3 => Z is returned Exceptions Standard_OutOfRange if theIndex is not 1, 2, or 3.
void GDir.Cross | ( | GDir | theRight | ) |
Computes the cross product between two directions Raises the exception ConstructionError if the two directions are parallel because the computed vector cannot be normalized to create a direction.
Computes the double vector product this ^ (theV1 ^ theV2). - CrossCrossed creates a new unit vector. Exceptions Standard_ConstructionError if: - theV1 and theV2 are parallel, or - this unit vector and (theV1 ^ theV2) are parallel. This is because, in these conditions, the computed vector is null and cannot be normalized.
Computes the triple vector product. <me> ^ (V1 ^ V2) Raises the exception ConstructionError if V1 and V2 are parallel or <me> and (V1^V2) are parallel because the computed vector can't be normalized to create a direction.
double GDir.Dot | ( | GDir | theOther | ) |
Computes the scalar product
Computes the triple scalar product <me> * (theV1 ^ theV2). Warnings : The computed vector theV1' = theV1 ^ theV2 is not normalized to create a unitary vector. So this method never raises an exception even if theV1 and theV2 are parallel.
boolean GDir.IsEqual | ( | GDir | theOther, |
double | theAngularTolerance | ||
) |
Returns True if the angle between the two directions is lower or equal to theAngularTolerance.
boolean GDir.IsNormal | ( | GDir | theOther, |
double | theAngularTolerance | ||
) |
Returns True if the angle between this unit vector and the unit vector theOther is equal to Pi/2 (normal).
boolean GDir.IsOpposite | ( | GDir | theOther, |
double | theAngularTolerance | ||
) |
Returns True if the angle between this unit vector and the unit vector theOther is equal to Pi (opposite).
boolean GDir.IsParallel | ( | GDir | theOther, |
double | theAngularTolerance | ||
) |
Returns true if the angle between this unit vector and the unit vector theOther is equal to 0 or to Pi. Note: the tolerance criterion is given by theAngularTolerance.
Performs the symmetrical transformation of a direction with respect to an axis placement which is the axis of the symmetry.
Performs the symmetrical transformation of a direction with respect to a plane. The axis placement theA2 locates the plane of the symmetry : (Location, XDirection, YDirection).
Performs the symmetrical transformation of a direction with respect to the direction theV which is the center of the symmetry.
GDir GDir.Reversed | ( | ) |
Reverses the orientation of a direction geometric transformations Performs the symmetrical transformation of a direction with respect to the direction V which is the center of the symmetry.]
Rotates a direction. theA1 is the axis of the rotation. theAng is the angular value of the rotation in radians.
void GDir.SetCoord | ( | double | theXv, |
double | theYv, | ||
double | theZv | ||
) |
For this unit vector, assigns the values theXv, theYv and theZv to its three coordinates. Remember that all the coordinates of a unit vector are implicitly modified when any single one is changed directly.
void GDir.SetCoord | ( | int | theIndex, |
double | theXi | ||
) |
For this unit vector, assigns the value Xi to: - the X coordinate if theIndex is 1, or - the Y coordinate if theIndex is 2, or - the Z coordinate if theIndex is 3, and then normalizes it. Warning Remember that all the coordinates of a unit vector are implicitly modified when any single one is changed directly. Exceptions Standard_OutOfRange if theIndex is not 1, 2, or 3. Standard_ConstructionError if either of the following is less than or equal to gp::Resolution(): - Sqrt(Xv*Xv + Yv*Yv + Zv*Zv), or - the modulus of the number triple formed by the new value theXi and the two other coordinates of this vector that were not directly modified.
void GDir.SetX | ( | double | theX | ) |
Assigns the given value to the X coordinate of this unit vector.
void GDir.SetXYZ | ( | GXYZ | theCoord | ) |
Assigns the three coordinates of theCoord to this unit vector.
void GDir.SetY | ( | double | theY | ) |
Assigns the given value to the Y coordinate of this unit vector.
void GDir.SetZ | ( | double | theZ | ) |
Assigns the given value to the Z coordinate of this unit vector.
Transforms a direction with a "Trsf" from gp. Warnings : If the scale factor of the "Trsf" theT is negative then the direction <me> is reversed.
double GDir.X | ( | ) |
Returns the X coordinate for a unit vector.
GXYZ GDir.XYZ | ( | ) |
for this unit vector, returns its three coordinates as a number triplea.
double GDir.Y | ( | ) |
Returns the Y coordinate for a unit vector.
double GDir.Z | ( | ) |
Returns the Z coordinate for a unit vector.