.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Transformation matrix understanding

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Luigi71
967 Views, 2 Replies

Transformation matrix understanding

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? 

 

Thanks in advance.

2 REPLIES 2
Message 2 of 3
artc2
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.

Message 3 of 3
Luigi71
in reply to: artc2

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

 

Thanks & regards.

 

Luigi Ballotta

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost