AnyCAD Rapid API 2023
Help you to create a better world!
载入中...
搜索中...
未找到
GDir类 参考

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() [1/4]

GDir.GDir ( )

Creates a direction corresponding to X axis.

◆ GDir() [2/4]

GDir.GDir ( GVec  theV)

Normalizes the vector theV and creates a direction. Raises ConstructionError if theV.Magnitude() <= Resolution.

◆ GDir() [3/4]

GDir.GDir ( GXYZ  theCoord)

Creates a direction from a triplet of coordinates. Raises ConstructionError if theCoord.Modulus() <= Resolution from gp.

◆ GDir() [4/4]

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.

成员函数说明

◆ Angle()

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]

◆ AngleWithRef()

double GDir.AngleWithRef ( GDir  theOther,
GDir  theVRef 
)

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.

◆ Coord() [1/2]

void GDir.Coord ( double[]  theXv,
double[]  theYv,
double[]  theZv 
)

Returns for the unit vector its three coordinates theXv, theYv, and theZv.

◆ Coord() [2/2]

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.

◆ Cross()

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.

◆ CrossCrossed()

GDir GDir.CrossCrossed ( GDir  theV1,
GDir  theV2 
)

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.

◆ Crossed()

GDir GDir.Crossed ( GDir  theRight)

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.

◆ Dot()

double GDir.Dot ( GDir  theOther)

Computes the scalar product

◆ DotCross()

double GDir.DotCross ( GDir  theV1,
GDir  theV2 
)

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.

◆ IsEqual()

boolean GDir.IsEqual ( GDir  theOther,
double  theAngularTolerance 
)

Returns True if the angle between the two directions is lower or equal to theAngularTolerance.

◆ IsNormal()

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

◆ IsOpposite()

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

◆ IsParallel()

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.

◆ Mirrored() [1/3]

GDir GDir.Mirrored ( GAx1  theA1)

Performs the symmetrical transformation of a direction with respect to an axis placement which is the axis of the symmetry.

◆ Mirrored() [2/3]

GDir GDir.Mirrored ( GAx2  theA2)

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

◆ Mirrored() [3/3]

GDir GDir.Mirrored ( GDir  theV)

Performs the symmetrical transformation of a direction with respect to the direction theV which is the center of the symmetry.

◆ Reversed()

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

◆ Rotated()

GDir GDir.Rotated ( GAx1  theA1,
double  theAng 
)

Rotates a direction. theA1 is the axis of the rotation. theAng is the angular value of the rotation in radians.

◆ SetCoord() [1/2]

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.

◆ SetCoord() [2/2]

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.

◆ SetX()

void GDir.SetX ( double  theX)

Assigns the given value to the X coordinate of this unit vector.

◆ SetXYZ()

void GDir.SetXYZ ( GXYZ  theCoord)

Assigns the three coordinates of theCoord to this unit vector.

◆ SetY()

void GDir.SetY ( double  theY)

Assigns the given value to the Y coordinate of this unit vector.

◆ SetZ()

void GDir.SetZ ( double  theZ)

Assigns the given value to the Z coordinate of this unit vector.

◆ Transformed()

GDir GDir.Transformed ( GTrsf  theT)

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.

◆ X()

double GDir.X ( )

Returns the X coordinate for a unit vector.

◆ XYZ()

GXYZ GDir.XYZ ( )

for this unit vector, returns its three coordinates as a number triplea.

◆ Y()

double GDir.Y ( )

Returns the Y coordinate for a unit vector.

◆ Z()

double GDir.Z ( )

Returns the Z coordinate for a unit vector.