Table of Contents

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__

.NET

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

.NET

@property
def A(self) -> float

Gets the X part of the image of the X axis.

B

.NET

@property
def B(self) -> float

Gets the Y part of the image of the X axis.

C

.NET

@property
def C(self) -> float

Gets the X part of the image of the Y axis.

D

.NET

@property
def D(self) -> float

Gets the Y part of the image of the Y axis.

Determinant

.NET

@property
def Determinant(self) -> float

Gets the determinant: negative when the transformation mirrors.

E

.NET

@property
def E(self) -> float

Gets the X shift.

F

.NET

@property
def F(self) -> float

Gets the Y shift.

Identity

.NET

Identity: ClassVar[Affine2]

Gets the identity: nothing moves.

IsIdentity

.NET

@property
def IsIdentity(self) -> bool

Gets whether the transformation is the identity.

IsSimilarity

.NET

@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

.NET

@property
def Rotation(self) -> float

Gets the angle the X axis turns to, in radians.

Scale

.NET

@property
def Scale(self) -> float

Gets the factor by which lengths change, for a similarity.

Methods

ScaleRotate

.NET

@staticmethod
def ScaleRotate(sx: float, sy: float, rotation: float) -> Affine2

Makes the scales of the axes followed by a turn about the origin.

Then

.NET

def Then(self, then: Affine2) -> Affine2

Gets the transformation that does this one first and then another.

Translation

.NET

@staticmethod
def Translation(dx: float, dy: float) -> Affine2

Makes a translation.

X

.NET

def X(self, x: float, y: float) -> float

Gets the X of a point after the transformation.

Y

.NET

def Y(self, x: float, y: float) -> float

Gets the Y of a point after the transformation.