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
Hi experts, SRM 7.0 EHP2 without EP. PO is created with 10 line items and qty of each line item is greater than zero. The qty of one line item is changed to zero and clicked/saved. The system takes the qty as one inspite of original qty more than one [More]
Hi,      I have one query in MIRO tcode.I have activated xref3 field in MIRO tcode using enhancement LMR1MF6Q.Now when i try to post document with some values in xref3 field on screen ,value is not getting populated in BSEG table.Please tell me what [More]
Hej! Organiziser in Photoshop Elements 9 will not start in Windows 8.1. Inkompartibelt programs. What to do? /yoelOk, I had many problems with the installation, but after three attempts I've got it working. This might work with a previously failed in [More]
I have a TC in the front of the house and AP Express in the back of the house.  The two units are ethernetted together.  I was using AP Utility to check something, and noticed my iPhone and iPad (in my office in the front of the house) are connected [More]
I purchased songs that are now labeled as "not authorized on this computer" and won't be sync'd to my iPod. I then go to the store icon, click on authorize this computer and am told that it is already authorized. I have another 169 or so songs I [More]
There is no disc or tape in the machine. I have tried waiting up to 8 hours to no avail. I tried unpluging the machine for a few minutes, and plugging it back in. Same result, please wait, then try again. The machine says this every time I press set [More]
Hi, Are there any component available to display gantt chart in SAPUI5 application? Regards, VinayVinay,  I came across this opensource javascript Gnatt chart - I am going to incorporate it into a UI5 component at some point in time. The source code [More]
what should be the best plan for fire fighting ...in prod down situation...An updated resume? ;-) Keeping calm is the first best answer. You are going to have pointy haired types standing in your cube asking if you are done yet. The urge to push them [More]
Exchange 2013 on Server 2013 R2 stopped working after a reboot.  Latest patches were installed and shortly after the reboot this error started.  I have uninstalled the patches to no avail.  Server is at 100% processor and not working.  This is a VM d [More]
For some reason occasionally when I delete an email while working on the iPhone they get deleted from the Exchange server but not from the phone itself. Subsequently when I try to delete them from the phone I get a message stating that they can not b [More]