inside Adobe Illustrator    in depth insights from Teri Pettit

Fill and Stroke Behavior on Compound Shapes

This page was posted in response to a user who could not understand why changes he was making to fills and strokes of paths inside Pathfinder compound shapes did not seem to "stick". It demonstrates how Pathfinder treats fills and strokes on the component elements of a compound shape.

To the right we see a pair of paths about to be converted into a Compound Shape by clicking on the Add to Shape button.

  

The fill and stroke color of the top path get assigned to the compound shape.

  

But under the hood, each component retains its own fill, stroke and other Appearance attributes. (The circle around the Appearance target in the Layers palette indicates which object's attributes are loaded into the palettes.)

When the compound shape is fully selected, fill and stroke changes are applied to the combined shape that you see.

  

But the component shapes retain their own fill and stroke attributes, as can be seen here on the left path, ...

... and here on the right one.

  

The colors of the component paths can even be edited independently when they are direct-selected, without changing the color of the compound shape.

Why is this done?

Given the potential for confusion, the question arises as to why the Pathfinder buttons don't simply assign the same fill and stroke attributes to all the component paths when the shape is created, and change the fill and stroke attributes of the whole compound shape when the attributes of any component are changed, the way Compound Paths do.

Part of the reason is so that if the Compound Shape is released, the components will return with their original colors. (Unless they've been edited separately.) In fact, sometimes users request that when they make a compound path out of white "holes" on top of colored base shapes, that the inside paths return as white when the compound path is released.

  

 

But a more fundamental reason is that we want to allow the components to maintain separate effects, including effects that turn strokes into outlines like Effects>Path>Outline Stroke. The Pathfinder operations will then be applied to the shapes that result from the effects.

Below we see what happens when we remove the fill from the left oval and make its stroke wide and apply an Outline Stroke effect. The compound shape's fill and stroke get applied to the component shape's outlined stroke! This is a useful effect that could not happen if the paths inside didn't retain separate control over their fill and stroke attributes.

When a Compound Shape is released (using the Release command on the Pathfinder palette's menu), the fills and strokes of the component paths become visible again.

  

When it is expanded (using the Expand button on the Pathfinder palette or the Object>Expand command), the component paths are deleted and the result shape is promoted to ordinary art.