|
AnyCAD Rapid API 2026
Help you to create a better world!
|
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. 更多...
Public 成员函数 | |
| GDir (global::System.IntPtr cPtr, bool cMemoryOwn) | |
| 仅供内部使用 | |
| void | Dispose () |
| GDir () | |
| Creates a direction corresponding to X axis. | |
| GDir (GVec theV) | |
| Normalizes the vector theV and creates a direction. Raises ConstructionError if theV.Magnitude() <= Resolution. | |
| GDir (GXYZ theCoord) | |
| Creates a direction from a triplet of coordinates. Raises ConstructionError if theCoord.Modulus() <= Resolution from gp. | |
| 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. | |
| void | 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 | 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 | SetX (double theX) |
| Assigns the given value to the X coordinate of this unit vector. | |
| void | SetY (double theY) |
| Assigns the given value to the Y coordinate of this unit vector. | |
| void | SetZ (double theZ) |
| Assigns the given value to the Z coordinate of this unit vector. | |
| void | SetXYZ (GXYZ theCoord) |
| Assigns the three coordinates of theCoord to this unit vector. | |
| double | 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 | Coord (ref double theXv, ref double theYv, ref double theZv) |
| Returns for the unit vector its three coordinates theXv, theYv, and theZv. | |
| double | X () |
| Returns the X coordinate for a unit vector. | |
| double | Y () |
| Returns the Y coordinate for a unit vector. | |
| double | Z () |
| Returns the Z coordinate for a unit vector. | |
| GXYZ | XYZ () |
| for this unit vector, returns its three coordinates as a number triplea. | |
| bool | IsEqual (GDir theOther, double theAngularTolerance) |
| Returns True if the angle between the two directions is lower or equal to theAngularTolerance. | |
| bool | 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). | |
| bool | IsOpposite (GDir theOther, double theAngularTolerance) |
| Returns True if the angle between this unit vector and the unit vector theOther is equal to Pi (opposite). | |
| bool | 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. | |
| double | 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] | |
| double | 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. | |
| void | 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. | |
| 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. | |
| void | CrossCross (GDir theV1, GDir theV2) |
| 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. | |
| double | Dot (GDir theOther) |
| Computes the scalar product | |
| double | 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. | |
| void | Reverse () |
| 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.] | |
| void | Mirror (GDir theV) |
| GDir | Mirrored (GDir theV) |
| Performs the symmetrical transformation of a direction with respect to the direction theV which is the center of the symmetry. | |
| void | Mirror (GAx1 theA1) |
| GDir | Mirrored (GAx1 theA1) |
| Performs the symmetrical transformation of a direction with respect to an axis placement which is the axis of the symmetry. | |
| void | Mirror (GAx2 theA2) |
| 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). | |
| void | Rotate (GAx1 theA1, double theAng) |
| 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. | |
| void | Transform (GTrsf theT) |
| 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. | |
| GDir (Vector3d p) | |
| GDir (Vector3 p) | |
| GDir | Clone () |
| override bool | Equals (object obj) |
| 判断是否相等 | |
| override int | GetHashCode () |
| 返回对象的哈希值 | |
| override string | ToString () |
| 转换成字符串 | |
属性 | |
| double | x [get, set] |
| double | y [get, set] |
| double | z [get, set] |
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.
方向
| override bool AnyCAD.Foundation.GDir.Equals | ( | object | obj | ) |
判断是否相等
| obj | 比较的对象 |
| override int AnyCAD.Foundation.GDir.GetHashCode | ( | ) |
返回对象的哈希值
| override string AnyCAD.Foundation.GDir.ToString | ( | ) |
转换成字符串