3d effects and gradient fill produces raster images in Illustrator

I have a collection of some arbitrary shapes that I deform with Effect > 3D > Rotate. I want to apply a gradient to some of those shapes. The problem is that Illustrator, trying to preserve the 3d correctness, will rasterize and segment the gradient for each individual shape affected and when I export the project as svg, the svg will contain an actual image for every shape. Also it’s extremely unoptimized and for lots shapes in a group, it takes a lot of time.

Is there a way to the make the gradient simply overlay?

The same effect I achieve manually by deforming the initial collection with the Free Transform Tool so that it matches the 3D Effect, but that is a destructive manipulation and I’d like to keep it procedural and work with the Appearance window. (In that line of though, can I save Free Transform manipulations as a preset?)

EDIT – added sample images

1) Initial image (length is 2182 characters): https://svgshare.com/i/7Qp.svg

2) 3D effect (length is 79394 characters): https://svgshare.com/i/7Rh.svg

3) Manual distort (length is 3358 characters): https://svgshare.com/i/7Po.svg

As you see, in (2) due to the rasterized gradient effect, size goes crazy.

Answer

  • To apply the same transformation to different shapes you can record an Action with all the transformation applied to the first shape and play this action to the others.

At the example, the action include the creation of a rectangle 310px x 310px, an applied Style for the colors and a Stop to type the text. After this stop, all the transform steps. At the end, the perspective effect made with an Envelope Distort. SVG length 4223 characters. Codepen.

transform action

With the same vectors but using just a gradient and a Clipping Mask with the three slanted squares as a Compound Shape, the final SVG is optimized to 3356 characters length. Codepen.

clipping mask

Attribution
Source : Link , Question Author : hrs , Answer Author : Community

Leave a Comment