Skip to main content
Known Participant
November 20, 2009
Question

Looking for a reliable method of detecting compound paths

  • November 20, 2009
  • 1 reply
  • 559 views

I'm working in the CS3 SDK, and I need the ability to detect compound paths, specificly the areas of the path that are clipping. There seem to be a few diffrent methods in the SDK for example:

AIPathSuite*->GetPathIsClip

AIArtSuite*->IsArtClipping

I have set up parts of artwork that I know are clipping, put the entire tree to find AIArtHandles that contain clipping portions, and everything always comes back clean. What am I missing?

Also, is there some other documentation other than what comes pre-packaged with the SDK?

Thanks,

Jeremy

This topic has been closed for replies.

1 reply

A. Patterson
Inspiring
November 20, 2009

Well, detecting a compound path is easy -- ask for its type (AIArtSuite::GetArtType()) and see if its kCompoundPathArt. There's also an attribute on path art kPartofCompound or something like that you can check for if you have a kPathArt object.

Clipping-wise, I haven't done much with that. I'd throw some debug statements in there and try it with a limited set of art -- I'd be surprised if there wasn't a fairly easy way to detect clipping paths.

zabadorAuthor
Known Participant
November 20, 2009

I think I might be using the wrong terms in my question.

My plugin only works with paths. I need the ability to detect compound paths. Not the fact that they are compound paths, but the parts of that grouping that are masking other parts of that grouping. For example, if i have two circles, one larger than the other and the smaller of the two inside the larger. If I then make the larger filled and declare both to be a compund path, the smaller circle will cut out an area of the larger circles fill. I need a way to detect that the smaller circle is doing that.

Any Ideas?

A. Patterson
Inspiring
November 20, 2009

Yikes. Yeah, I know what you're trying to do because I've had the same exact problem I'm not sure how AI is doing it so easily but if they have a method somewhere tha thelps with this I haven't found it My bit about the attribute can at least tell you if a kPathArt is part of a kCompoundArt (that is a very helpful flag!) but that would just tell you that its a path that you'd need to consider for this problem. I don't think they have anything (at least that I've found) that will tell if you a path is effectively a 'hole' in the art.

The only thing that might help is comparing directions of the paths. If you know one path is the 'shell' and you know its direction, you might be able to infer things by looking at the direction of other paths. Oppositely oriented paths are probably holes, whereas like-oriented paths are probably outside pieces. Of course, nothing prevents there from being multiple 'shells' that have multiple 'holes', so maybe that's not as valuable as I think. Also, I'm not sure that AI requires a particular direction for 'shells' and 'holes'. Where in a lot of vector applciations I suspect they'd insist that 'shells' are a particular direction and 'holes' its opposite, I'm not sure that you'd necessarily find consistency between two different compound path collections in AI. I have a feeling I've seen path collections that had opposite relationships between 'shells' and 'holes', though I think no matter what a 'hole' and a 'shell' in the same collection are opposite directions.