.NET

## .NET

Contributor
Posts: 22
Registered: ‎08-30-2011
Message 1 of 3 (152 Views)

# Transformation matrix understanding

152 Views, 2 Replies
09-06-2013 12:17 AM

Hi everyone.

I'm using a transformation matrix to adjust objects scale.

Sub Scale()

[...]

''Definition of the matrix

Dim ScaleMatrix(0 To 15) As Double

ScaleMatrix(0) = X_ScaleFactor
ScaleMatrix(1) = 0
ScaleMatrix(2) = 0
ScaleMatrix(3) = 0
ScaleMatrix(4) = 0
ScaleMatrix(5) = Y_ScaleFactor
ScaleMatrix(6) = 0
ScaleMatrix(7) = 0
ScaleMatrix(8) = 0
ScaleMatrix(9) = 0
ScaleMatrix(10) = Z_ScaleFactor
ScaleMatrix(11) = 0
ScaleMatrix(12) = 0
ScaleMatrix(13) = 0
ScaleMatrix(14) = 0
ScaleMatrix(15) = 1

Dim acScaleMatrixt3d As Matrix3d = New Matrix3d(ScaleMatrix)

[...]

''Perform scale of a polyline

acPoly.TransformBy(acScaleMatrixt3d)

[...]

End Sub

If X_ScaleFactor = Y_ScaleFactor all works fine, but if X_ScaleFactor <> Y_ScaleFactor (e.g. X_ScaleFactor = 2 and Y_ScaleFactor = 4  I get the following exception: eCannotScaleNonUniformly

It isn't possible to define different scale factors for X and Y axis? It seems a strange thing.

Any suggestion?

Employee
Posts: 175
Registered: ‎06-08-2010
Message 2 of 3 (126 Views)

# Re: Transformation matrix understanding

09-06-2013 09:49 AM in reply to: Luigi71

Polylines don't allow non-uniform scaling because they can have arc segments which would become ellipise segments if the scaling is not uniform and ellipse segments are not supported by polylines.

You'd have the same problem trying to non-uniformly scale an arc or a circle.

Contributor
Posts: 22
Registered: ‎08-30-2011
Message 3 of 3 (85 Views)

# Re: Transformation matrix understanding

09-08-2013 11:36 PM in reply to: artc2

Yes artc2, later I discovered that polylines do not accept this type of scaling.

Thanks & regards.

Luigi Ballotta

Recently Solved