Package net.paulhertz.aifile

Package net.paulhertz.aifile provides dual functionality as a display list utility in Processing and as an export tool that writes to an Adobe Illustrator 7.0 file.

See: Description

Package net.paulhertz.aifile Description

Package net.paulhertz.aifile provides dual functionality as a display list utility in Processing and as an export tool that writes to an Adobe Illustrator 7.0 file. AI 7.0 was the last public specification of Adobe's file format. It can still be extremely useful, and can be imported into all current version of Illustrator . Everything in this Flickr set, was generated in Processing with the help of this library.

Graphics consist of Bézier curves and lines, implemented by the class BezShape and its helpers, LineVertex and BezVertex. Text is handled by PointText. Other Illustrator text formats (area text and text on a path) are not (yet) implemented, since there is nothing in Processing that corresponds to them. BezShape and PointText are subclasses of DisplayComponent, the abstract class extended by all components of the document hierarchy. Numerous subclasses of BezShape implement a standard set of graphics primitives such as rectangles, polygons, multiCurves, lines, etc.

DocumentComponent, LayerComponent, and GroupComponent provide the hierarchical structure of the document: a root document instance, any number of layers immediately below the document (but not nested), and groups within the layers nested to any desirable depth. Shapes and text objects may populate layers and groups. The Palette class provides hooks for creating a palette in the AI file, and utilities for managing Processing colors and converting them to AI formats. RGBColor and CMYKColor provide storage and conversion utilities for the RGB and CMYK color models in Illustrator. The CustomComponent class provides facilities for inserting comments and custom data into an AI file.

All subclasses of DisplayComponent implement write(), draw() and transform() methods. Calling the methods anywhere in the document hierarchy will cascade commands to all child components. This is particularly useful when writing to a file: a single call to the DocumentComponent.write() method will write out the file. The draw() method will display the document to screen, using Processing graphics calls for drawing vertices and text. Transform() accepts a matrix to perform geometric transforms on all or part of a document, including, of course, individual shapes. It is possible to capture the Processing's current graphics state, including the fill, stroke, and the current global transform and load them into the attributes of a shape. Sample code shows how to do this.

Processing library IgnoCodeLib by Paul Hertz. (c) 2015