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

Explorer ,
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

 

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

TOPICS
Actions and scripting, Windows

Views

78

Likes

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

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

Explorer ,
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

 

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

TOPICS
Actions and scripting, Windows

Views

79

Likes

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

Likes

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
Reply
Loading...
Nov 28, 2020 0
Explorer ,
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

Likes

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
Reply
Loading...
Nov 28, 2020 0
LEGEND ,
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. 

Likes

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
Reply
Loading...
Nov 28, 2020 0
LEGEND ,
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. 

Likes

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
Reply
Loading...
Nov 28, 2020 0
Explorer ,
Nov 28, 2020

Copy link to clipboard

Copied

Hi c.pfaffenbichle,

It is a pixel layer not a Shape Layer.

 

Likes

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
Reply
Loading...
Nov 28, 2020 0
LEGEND ,
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? 

Likes

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
Reply
Loading...
Nov 28, 2020 0
LEGEND ,
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)? 

Likes

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
Reply
Loading...
Nov 28, 2020 1
LEGEND ,
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. 

Likes

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
Reply
Loading...
Nov 28, 2020 1
Explorer ,
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.

Likes

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
Reply
Loading...
Nov 28, 2020 1
LEGEND ,
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. 

Likes

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
Reply
Loading...
Nov 29, 2020 0
Explorer ,
Nov 29, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Nov 29, 2020 1