Affine2
from OpenCAD2D import Affine2
class Affine2(System.ValueType) ยท Affine2 in the .NET reference
A transformation of the plane, x' = A x + C y + E and y' = B x + D y + F: how the entities of a block are placed in the drawing when an INSERT is drawn, kept as one matrix whatever the depth of the blocks.
Constructors
__init__
def __init__(self, a: float, b: float, c: float, d: float, e: float, f: float) -> None
Makes a transformation from its six numbers.
Properties and fields
A
@property
def A(self) -> float
Gets the X part of the image of the X axis.
B
@property
def B(self) -> float
Gets the Y part of the image of the X axis.
C
@property
def C(self) -> float
Gets the X part of the image of the Y axis.
D
@property
def D(self) -> float
Gets the Y part of the image of the Y axis.
Determinant
@property
def Determinant(self) -> float
Gets the determinant: negative when the transformation mirrors.
E
@property
def E(self) -> float
Gets the X shift.
F
@property
def F(self) -> float
Gets the Y shift.
Identity
Identity: ClassVar[Affine2]
Gets the identity: nothing moves.
IsIdentity
@property
def IsIdentity(self) -> bool
Gets whether the transformation is the identity.
IsSimilarity
@property
def IsSimilarity(self) -> bool
Gets whether the transformation turns, mirrors and scales alike in both directions, so that a circle stays a circle and an arc stays an arc.
Rotation
@property
def Rotation(self) -> float
Gets the angle the X axis turns to, in radians.
Scale
@property
def Scale(self) -> float
Gets the factor by which lengths change, for a similarity.
Methods
ScaleRotate
@staticmethod
def ScaleRotate(sx: float, sy: float, rotation: float) -> Affine2
Makes the scales of the axes followed by a turn about the origin.
Then
def Then(self, then: Affine2) -> Affine2
Gets the transformation that does this one first and then another.
Translation
@staticmethod
def Translation(dx: float, dy: float) -> Affine2
Makes a translation.
X
def X(self, x: float, y: float) -> float
Gets the X of a point after the transformation.
Y
def Y(self, x: float, y: float) -> float
Gets the Y of a point after the transformation.