AnyCAD Rapid API 2026
Help you to create a better world!
载入中...
搜索中...
未找到
AnyCAD.Foundation.GTrsf2d类 参考
类 AnyCAD.Foundation.GTrsf2d 继承关系图:

Public 成员函数

 GTrsf2d (global::System.IntPtr cPtr, bool cMemoryOwn)
 仅供内部使用
 
void Dispose ()
 
 GTrsf2d ()
 Returns identity transformation.
 
 GTrsf2d (GTrsf theT)
 Creates a 2d transformation in the XY plane from a 3d transformation .
 
void SetMirror (GPnt2d theP)
 Changes the transformation into a symmetrical transformation. theP is the center of the symmetry.
 
void SetMirror (GAx2d theA)
 Changes the transformation into a symmetrical transformation. theA is the center of the axial symmetry.
 
void SetRotation (GPnt2d theP, double theAng)
 Changes the transformation into a rotation. theP is the rotation's center and theAng is the angular value of the rotation in radian.
 
void SetScale (GPnt2d theP, double theS)
 Changes the transformation into a scale. theP is the center of the scale and theS is the scaling value.
 
void SetTransformation (GAx2d theFromSystem1, GAx2d theToSystem2)
 Changes a transformation allowing passage from the coordinate system "theFromSystem1" to the coordinate system "theToSystem2".
 
void SetTransformation (GAx2d theToSystem)
 Changes the transformation allowing passage from the basic coordinate system {P(0.,0.,0.), VX (1.,0.,0.), VY (0.,1.,0.)} to the local coordinate system defined with the Ax2d theToSystem.
 
void SetTranslation (GVec2d theV)
 Changes the transformation into a translation. theV is the vector of the translation.
 
void SetTranslation (GPnt2d theP1, GPnt2d theP2)
 Makes the transformation into a translation from the point theP1 to the point theP2.
 
void SetTranslationPart (GVec2d theV)
 Replaces the translation vector with theV.
 
void SetScaleFactor (double theS)
 Modifies the scale factor.
 
bool IsNegative ()
 Returns true if the determinant of the vectorial part of this transformation is negative..
 
GTrsfForm Form ()
 Returns the nature of the transformation. It can be an identity transformation, a rotation, a translation, a mirror (relative to a point or an axis), a scaling transformation, or a compound transformation.
 
double ScaleFactor ()
 Returns the scale factor.
 
GXY TranslationPart ()
 Returns the translation part of the transformation's matrix
 
GMat2d VectorialPart ()
 Returns the vectorial part of the transformation. It is a 2*2 matrix which includes the scale factor.
 
GMat2d HVectorialPart ()
 Returns the homogeneous vectorial part of the transformation. It is a 2*2 matrix which doesn't include the scale factor. The coefficients of this matrix must be multiplied by the scale factor to obtain the coefficients of the transformation.
 
double RotationPart ()
 Returns the angle corresponding to the rotational component of the transformation matrix (operation opposite to SetRotation()).
 
double Value (int theRow, int theCol)
 Returns the coefficients of the transformation's matrix. It is a 2 rows * 3 columns matrix. Raises OutOfRange if theRow < 1 or theRow > 2 or theCol < 1 or theCol > 3
 
void Invert ()
 
GTrsf2d Inverted ()
 Computes the reverse transformation. Raises an exception if the matrix of the transformation is not inversible, it means that the scale factor is lower or equal to Resolution from package gp.
 
GTrsf2d Multiplied (GTrsf2d theT)
 
void Multiply (GTrsf2d theT)
 Computes the transformation composed from <me> and theT. <me> = <me> * theT
 
void PreMultiply (GTrsf2d theT)
 Computes the transformation composed from <me> and theT. <me> = theT * <me>
 
void Power (int theN)
 
GTrsf2d Powered (int theN)
 Computes the following composition of transformations <me> * <me> * .......* <me>, theN time. if theN = 0 <me> = Identity if theN < 0 <me> = <me>.Inverse() *...........* <me>.Inverse(). Raises if theN < 0 and if the matrix of the transformation not inversible.
 
void Transforms (ref double theX, ref double theY)
 
void Transforms (GXY theCoord)
 Transforms a doublet XY with a Trsf2d
 
void SetValues (double a11, double a12, double a13, double a21, double a22, double a23)
 

详细描述

Defines a non-persistent transformation in 2D space. The following transformations are implemented : - Translation, Rotation, Scale - Symmetry with respect to a point and a line. Complex transformations can be obtained by combining the previous elementary transformations using the method Multiply. The transformations can be represented as follow :<code> V1 V2 T XY XY | a11 a12 a13 | | x | | x'| | a21 a22 a23 | | y | | y'| | 0 0 1 | | 1 | | 1 |</code> where {V1, V2} defines the vectorial part of the transformation and T defines the translation part of the transformation. This transformation never change the nature of the objects.

成员函数说明

◆ SetValues()

void AnyCAD.Foundation.GTrsf2d.SetValues ( double a11,
double a12,
double a13,
double a21,
double a22,
double a23 )

Sets the coefficients of the transformation. The transformation of the point x,y is the point x',y' with :<code> x' = a11 x + a12 y + a13 y' = a21 x + a22 y + a23</code> The method Value(i,j) will return aij. Raises ConstructionError if the determinant of the aij is null. If the matrix as not a uniform scale it will be orthogonalized before future using.