0

I've asked this question in the Adobe forums, but I haven't gotten an answer yet, I'm afraid. If this is truly impossible, then shame on Adobe for not making it possible.

I need a script that will check and see if a path fits entirely within another path. In my case, I need to see if a GroupItem fits within a circle/ellipse of a specific size. I don't see any methods available for PageItem that will do it for me, so does anyone know of a workaround? (Preferably without having to check every single PathPoint of every single item in the group.) I am using Illustrator CS6 and do my scripting with Javascript.

I am aware of the visibleBounds property of paths, but that only gives you a top, bottom, left, and right maximum boundaries of a path. It's entirely possible for an object's visibleBounds to be within an ellipse's visibleBounds, but still have parts of it sticking outside of the ellipse. I hope this makes sense and that someone out there has an idea on how to overcome this problem.

Sturm
  • 689
  • 2
  • 23
  • 52

1 Answers1

1

I'm not overly familiar with Illustrator, but does it have a path to selection function similar to Photoshop? I've used that to achieve similar to this. Essentially:

  1. convert your internal path as a selection
  2. subtract the selection based on the outer path from the selection created in step 1
  3. if you don't have any selection left, the internal path is completely contained within the outer selection
Anna Forrest
  • 1,711
  • 14
  • 21