Skip to main content
February 17, 2014
Question

Shear / Skew using shear angle and axis angle

  • February 17, 2014
  • 2 replies
  • 2689 views

Hi,

I want to skew/shear the selected object using shear angle and axis angle.

I am using below code for shear the object,

var skewMatrix = app.getIdentityMatrix();

skewMatrix..mValueB = .5

But i dont know how to apply the axis angle with this matrix.

any hints?

This topic has been closed for replies.

2 replies

February 18, 2014

Thanks for your response....

This will shear the object horizantaly/Verticaly , but i need to know how to apply axis angle to shear the object.

Update the matrix value c ( im.mValueC ) to Shear the object horizantaly

Update the matrix value b ( im.mValueB) to Shear the object verticaly

But, How to shear the object using axis angle. for example i want to skew the object by shear angle 147 degree with axis angle 18 degree.

Thanks in advance.

Inspiring
February 18, 2014

mCharlesrk wrote:

How to shear the object using axis angle.

Perhaps you want: concatenateRotationMatrix

var doc = app.activeDocument;

var sel = doc.selection[0];

var m = app.getIdentityMatrix();

m.mValueC = .5

var m2 = concatenateRotationMatrix(m, 25);

sel.transform(m2, true, true, true, true, 1, Transformation.CENTER);

Hopefully that helps towards your desired end result?

pixxxelschubser
Community Expert
Community Expert
February 17, 2014

Searching for "shear" gives you the answer.

You can find a script snippet, written by CarlosCanto

http://forums.adobe.com/message/5477878#5477878

// skew or shear selection, carlos canto 07/04/13
// http://forums.adobe.com/message/5475881#5475881

var idoc = app.activeDocument;
var sel = idoc.selection[0];


var im = app.getIdentityMatrix();

//im.mValueB = .5; // skew y 50%
im.mValueC = .5; // skew x 50%


sel.transform (im, true, true, true, true, 1, undefined);

Have fun