Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Transform an object in a trapezoidal way

New Here ,
Dec 06, 2017 Dec 06, 2017

Hey all,

The last days, I was trying to find my way into scripting to automatize some workflows.

I don’t really know where to start on this specific project, so I finally take a shortcut and try to find some answers from more experienced people. 😉

Basically I’m trying to change the width of an object/group.

The width should be changed in two different values — one width-change on the top, another one on the bottom. The values are calculated by: width*cos(y). Where Y is the Y-Value of the maximum or minimum. All points between the maximum and minimum should be changed in a linear way. Similar to a trapezoid.

A bit like it can be done manually with the free-transform-tool:

(The shapes are representing the transformation, not the actual paths!)

I’m not sure, if that’s even possible. Maybe someone could give me a hint where to start or share some experiences.

Merci beaucoup and have a great Day!

Raul

(Sorry, I’m totally struggling to describe this in english... )

TOPICS
Scripting
922
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Dec 06, 2017 Dec 06, 2017

Sorry, but your image is not visible.

It's not clear for me what you really want.

But perhaps this old snippet by CarlosCanto will point you to the right direction

// skew or shear selection, carlos canto 07/04/13

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

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%

nsform (im, true, true, true, true, 1, undefined);

Have fun

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Dec 06, 2017 Dec 06, 2017

That's supposed to be 'transform'?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2017 Dec 06, 2017
LATEST

Oops. Is there a black hole in the near?

the last line should be:

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines