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

Is it possible to identify if path item or group are mirrored?

Explorer ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

Hi,

I hope someone can help 🙂

Is there a way to get information about whether the path item or group has been flipped at some point? Or is it possible to determine if one of two identical path items/groups are mirrored?

TOPICS
Scripting

Views

457

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
Adobe
Guide ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

There is no direct built-in way to test whether two path items are reflections of each other. 

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 ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

Yes, this is also the way I´m thinking, but I wanted to be sure, that there is no smarter way 🙂

 

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 ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

you'll probably need to do the comparison yourself, try reflecting one of the paths, place it on top of the other and see if anything matches (width, height, number of anchors, their positions, etc)

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 ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

hmm...reflecting an object does create a BBAccumRotation Tag with a value of Pi (standard vertical reflect 90 degrees).

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 ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

hmm,  yes....true...maybe I can figure out how I can use it.

If the path is reflected and then rotated?

 

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 ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

May I ask, these tags are arrays. What else is in them?
tags[1], what is it?

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 ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

Tags are name/value pairs you can assign to objects to store information. 

 

Illustrator creates it's own tags as well. Like in this case.

 

If an object is reflected and rotated you're probably out of luck since the the same tag is used for rotation.

 

 

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
Guide ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

@CarlosCanto  The BBAccumRotation tag was the first thing I tried. I get one for rotation, but not reflection. 

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 ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

that's strange, I get it consistently. Win 10, v25.2

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 ,
Apr 17, 2021 Apr 17, 2021

Copy link to clipboard

Copied

I also have one, when reflecting. With Pi value as Carlos said. But it changes if the item is rotated. Flip horizontally gives a value of 0.

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
Guide ,
Apr 20, 2021 Apr 20, 2021

Copy link to clipboard

Copied

LATEST

Just for the sake of sharing, I don't get a BBAccumRotation tag for reflection, whether using the reflect tool or the transform submenu. If I rotate an item and then reflect it, the tag (which I get for rotation) is the same before and after reflection. I can only assume that this is because I'm using CS6.

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 ,
Apr 18, 2021 Apr 18, 2021

Copy link to clipboard

Copied

I believe I found the method I can work with. With some adjustments, this function may work.

 
function ifPathReflected(myPath){
var A = myPath.pathPoints[0].anchor;
var B = myPath.pathPoints[1].anchor;
var C = myPath.pathPoints[2].anchor;
var Ax = A[0];
var Ay = A[1];
var Bx = B[0];
var By = B[1];
var Cx = C[0];
var Cy = C[1];
var d = [Bx - Ax, By - Ay];
var f = [Cx - Ax, Cy - Ay];
alert ( d[0] * f[1] - d[1] * f[0] );
};

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