Copy link to clipboard
Copied
Hi EveryOne!,
Is this possible to get the corner points value from Quadrilateral?
Thanks in advance.
-yajiv
Another approach would be creating a Working Path from a Selection based on the Layer’s transparency and evaluating that path.
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?
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
Copy link to clipboard
Copied
You misunderstood – the screenshot fails to illustrate if the blue shape is a Shape Layer or something else.
Copy link to clipboard
Copied
Hi c.pfaffenbichle,
It is a pixel layer not a Shape Layer.
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?
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)?
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.
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.
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.
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
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.