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

How do we to get the corner points value from Quadrilateral?

Explorer ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

Hi EveryOne!,

 

Is this possible to get the corner points value from Quadrilateral?

Thanks in advance.

-yajiv

 

test.png

 

TOPICS
Actions and scripting , Windows

Views

343

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Nov 28, 2020 Nov 28, 2020

Another approach would be creating a Working Path from a Selection based on the Layer’s transparency and evaluating that path. 

Votes

Translate

Translate
Adobe
Community Expert ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

Nice of you to post a screenshot but please post a meaningful screenshot that includes the pertinent Panels. 

Are you talking about a Shape Layer for example? 

Votes

Translate

Translate

Report

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
Explorer ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

Hi c.pfaffenbichle,

Thank you for the prompt response.

Please find the meaningful screenshot below.

I need to get the cornerpoints value from the selection.

if I use activeDocument.selection.bounds code, It is show as 0,100 for topLeft.

However I need to get the value (100,145) instead of (0,100) viceversa for all sides.

Could yoy please share your suggestion.Inputs?

 

yajiv

 

test.png

Votes

Translate

Translate

Report

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 ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

You misunderstood – the screenshot fails to illustrate if the blue shape is a Shape Layer or something else. 

Votes

Translate

Translate

Report

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
Explorer ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

Hi c.pfaffenbichle,

It is a pixel layer not a Shape Layer.

 

Votes

Translate

Translate

Report

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 ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

And is it definitely always going to be a four sided shape?

So that there is always only going to be one extreme point in all four directions? 

Can there be cases where one or more sides may be perfectly vertical or horizontal? 

 

What is this about anyway? Is it a task that arises often enough that it’s worth automating? 

Votes

Translate

Translate

Report

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 ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

I can’t remember who posted it but in a recent thread someone provided a neat solution by, if I remember correctly, evaluating the bounds and then intersecting row/column selections with the original selection an the four extremes. 

Those resulting four selections can then be evaluated to get the »missing« coordinate for all four extremes. 

 

How experienced are you with JavaScript and Photoshop’s DOM (and maybe AM)? 

Votes

Translate

Translate

Report

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 ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

Another approach would be creating a Working Path from a Selection based on the Layer’s transparency and evaluating that path. 

Votes

Translate

Translate

Report

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
Explorer ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

Hi c.pfaffenbichle,

Thank you for your detailed explanation.

I'm bit familiar with both DOM and AM code.

I'll try with work path method and let you know how it is working.

Votes

Translate

Translate

Report

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 ,
Nov 29, 2020 Nov 29, 2020

Copy link to clipboard

Copied

Depending on the Selection and the Working Path settings the resulting Path may have a lot of »useless« points, so filtering out the corner points might be an interesting challenge. 

Votes

Translate

Translate

Report

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
Explorer ,
Nov 29, 2020 Nov 29, 2020

Copy link to clipboard

Copied

LATEST

Hi c.pfaffenbichle,

Thank you for sharing the idea. My work path is very simple with 4 nodes.

I consider each point as a corner and your Idea working like charm.

Thank you so much.

- yajiv

Votes

Translate

Translate

Report

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 ,
Nov 28, 2020 Nov 28, 2020

Copy link to clipboard

Copied

With a Shape Layer the issue could simply be addressed by getting the PathPoints’ coordinates. 

Other things (a pixel Layer of the object, the object just pixels on a larger Layer, …) would necessitate other approaches. 

Votes

Translate

Translate

Report

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