Sitemap

Amicuk Programming Answers

Use a compound path as clipping mask?

-0001-11-30   Views:0

Advertisement

Hello, I'm trying to use a complex compound path as a clipping mask, but it won't work. I have narrowed down the problem a little in two smaller scripts described below. Using a single path as clipping mask works very well: var doc = app.documents.ad

Hello,
I’m trying to use a complex compound path as a clipping mask, but it won’t work. I have narrowed down the problem a little in two smaller scripts described below.
Using a single path as clipping mask works very well:
var doc = app.documents.add();
var clipGroup = doc.groupItems.add();
var bgItem = clipGroup.pathItems.rectangle(200, 200, 200, 200);
bgItem.position = Array(200, 500);
bgItem.fillColor = doc.swatches[8].color;
var fgItem = clipGroup.pathItems.polygon(144, 288, 72.0, 7);
fgItem.position = Array(220, 480);
fgItem.fillColor = doc.swatches[7].color;
fgItem.zOrder(ZOrderMethod.BRINGTOFRONT);
clipGroup.clipped = true;
alert(clipGroup.clipped); // will alert true
But when trying the simplest form of a compound path, it’s not working:
var doc = app.documents.add();
var clipGroup = doc.groupItems.add();
var bgItem = clipGroup.pathItems.rectangle(200, 200, 200, 200);
bgItem.position = Array(200, 500);
bgItem.fillColor = doc.swatches[8].color;
var compoundItem = clipGroup.compoundPathItems.add();
var fgItem = compoundItem.pathItems.polygon(144, 288, 72.0, 7);
fgItem.position = Array(220, 480);
fgItem.fillColor = doc.swatches[7].color;
compoundItem.zOrder(ZOrderMethod.BRINGTOFRONT);
clipGroup.clipped = true;
alert(clipGroup.clipped); // will alert false
Using compound paths as clipping masks is really simple in the Illustrator GUI. So what am I missing here?
Help would be greatly appreciated.

The replay answer
Advertisement
The simplest way, I think, would be to set the white line work as an opacity mask on top of the tan circle. That is not a clipping mask, but does the same thing and it's much easier.
Otherwise, outline white strokes and "Unite" using pathfinder tool, then delete outside path (the circle), from the compound shape. That will leave the appropriate compound object to make the clipping mask:

Go to See the other 5 answers

Use a compound path as clipping mask?

Category:DefaultRelease time:-0001-11-30Views:130

Hello, I'm trying to use a complex compound path as a clipping mask, but it won't work. I have narrowed down the problem a little in two smaller scripts described below. Using a single path as clipping mask works very well: var doc = app.documents.ad[More]

Calling all compound path and clipping mask experts...

Category:DefaultRelease time:-0001-11-30Views:130

I am attempting to get all the white areas in the attached "globe" artwork to knockout to the background color. I have tried making the entire thing a compound path, tried clipping mask and different combinations in pathfinder with no success. T[More]

Why are all paths in Clipping Masks and Compound Paths?

Category:DefaultRelease time:-0001-11-30Views:130

When I open up previous versions of Illustrator files (i.e. CS5), why are all of my paths messed up. Every object is embedded in a Clipping Mask, paths are compounded and in most cases type on a path is expanded into multiple non-editable objects. Th[More]

Compound path vs. clipping path

Category:DefaultRelease time:-0001-11-30Views:130

How do these differ?Totally different features. A compound path is basically an object with a "hole" or "holes" in it. (Like an O or an 8) A clipping path (which can also be a compound) is a mask. Parts of objects that lie outside the[More]

Draw inside disabled, and clipping mask workaround loses information

Category:DefaultRelease time:-0001-11-30Views:130

I want to use my compound paths, with styles, fills and strokes applied to "draw inside", but that command is greyed out when I select them. However, if I "cheat" and instead use the compound paths as clipping masks first, I accomplish[More]

Clipping mask is clipping my lines and not the actual object.

Category:DefaultRelease time:-0001-11-30Views:130

Hi all,I'm using the latest CC Illustrator. I'm so frustrated and hope someone can help me, I've already spent a few hours trying to figure this out and looked through a number of tutorials and troubleshoot forums and I cant find an answer. How do I[More]

White gaps in black stroke of clipping mask path

Category:DefaultRelease time:2015-10-11Views:130

Drew a path in Illustrator - made it a compound path.  Made a clipping mask with another object inside it.  When saved as a pdf, there are these strange white gaps in the stroke of the path.....file://localhost/Users/wardmorgan/Desktop/Screen%20shot%[More]

Making a clipping group with a compound path

Category:DefaultRelease time:-0001-11-30Views:130

So, as of today I'm new to scripting for Illustrator, I'm using the ExtendScript Toolkit. However I'm not new to scripting my own solutions and I do have some experience with JavaScript already. What I'm trying to do is this: For all selected Items->[More]

Help with creating compound/Clipping Mask

Category:DefaultRelease time:-0001-11-30Views:130

Hello, This is going to be quite hard to explain so bear with me! I recently live traced a hand drawn pattern into illustrator pressing 'Ignore white', Underneath this I have a jpg with a texture I want to use. My aim is to cut out the shape of two l[More]

I need to create a clipping mask that covers the negative space of my created path...

Category:DefaultRelease time:-0001-11-30Views:130

Like in a Circle I need to make the compound path the inner area or negative space of my objects. I have expanded letters and joined their paths so that there are negative space, I was wondering if it were possible to fill in the negative space with[More]

URGH! Make clipping mask/path out of a placed image?!

Category:DefaultRelease time:-0001-11-30Views:130

I'm having major issues. I'm a n00b at Illustrator, though. I need to make a placed photo into a clipping path, and I can't figure out how to do it correctly. It's homework for a college course in Digital Illustration. I need to recreate a photo usin[More]

Hot
My iphone does not recognize saved contact number while having incoming calls due to country and area code as auto prefix. How do i fix the problem. How do i ensure that the phone recognize calls with and without the country and area code. Please tex [More]
Hello, experts! Could you please suggest me how to solve the following issue. I have userdefined multiline container MY_CONTAINER with two elements FIELD (stores name of field) and VALUE (stores value of field). This container is filled in runtime by [More]
when i move the cursor to the top of the page the address bar appears but not the view, tools, history, etc. options. when i move the cursor down the address bar goes away......... a cox tech said they see this happening often with computers using a [More]
I have a question about old software: FrameMaker 6.0 on a Mac. (While Adobe encouraged me to purchase this in 2001 for the chemistry textbook I am writing, I had invested to much to abandon it when Adobe abandoned the Mac version a few years later.) [More]
Dear Experts, When there is a table with NO DATA init, the match records options work diffrently. This could be because matching record allways tries to compare source with destination values. As here the destination table is blank i guess this could [More]
Hello, I'm using the latest version of GMS (2.0.1 Build : 53) All my users are provisioning by LDAP. All works fine .. except for one user where is state stay "Failed". It's like this user is a GroupWise user, but I find him only in the dashboar [More]
Hi, I have a situation where i need to change the Top level navigation i.e the look and feel should be like a website. I had seen some blogs like hovering etc.. but i cant understand the concept. Can any one explain it in a simple and detailed way. T [More]
I have many more songs in my store "purchased" list that are not in my library purchased or playlist.I don't know what happened, but if you're sure Lightroom has the settings you want for them, just save (xmp) metadata to resolve the conflict. e [More]
Is it possible to perform a get() from the cache without deserializing an object, anmd instead request the POF bytes directly? The use case is a middle tier server that is an extend client. It supports legacy downstream clients that should receive pa [More]
I'm running Flash player with chrome under Window 7 home basic 64-bit on a Dell N5010 and have this problem: After viewing a Flash movie, my system slows to a crawl, while CPU usage (per Task Manager) shows nearly 100% -- even after I quit chrome -- [More]