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

Interface Summary
ColorableINF  
Vertex2DINF Interface for line and curve vertices.
Visitable Interface for display components that implement the Visitor design pattern.
 

Class Summary
AIFileWriter Provides a useful subset of Adobe Illustrator 7.0 file tags.
BezCircle Provides factory methods to create a closed circular shape.
BezCurve Provides factory methods to construct a single Bezier curve.
BezCurveShape Provides factory methods to construct a closed path consisting of Bezier curves.
BezEllipse Provides factory methods to construct a closed elliptical BezShape.
BezLine Provides factory methods to construct and operate on a straight line.
BezMultiCurve Provides factory methods to create an open path consisting of multiple Bezier curves.
BezMultiLine Provides factory methods to construct an open path consisting of multiple straight lines.
BezPoly Provides factory methods to construct a closed polygonal path consisting of straight line segments.
BezRectangle Provides factory methods to create and operate on closed rectangular shapes.
BezRegularPoly Provides factory methods to construct a regular polygonal shape consisting of straight lines.
BezShape Implements shapes composed of cubic Bezier curves and lines and methods to draw geometry to a display, perform geometric transforms, and write geometry to an Adobe Illustrator 7.0 file format.
BezTriangle Provides factory methods to create and operate on a triangular shape.
BezVertex Provides storage for a cubic Bezier curves's control points and terminal anchor point.
BoundsCalculationVisitor Implements the ComponentVisitor interface to calculate the bounding rectangle of all geometry visited.
CMYKColor Provides storage and conversion utilities for CMYK colors.
ComponentVisitor Abstract class for concrete Visitors to classes that implement the Visitable interface.
CustomComponent Permits the addition of arbitrary, non-printing, custom information to file output.
DisplayComponent The base class for all components.
DocumentComponent Handles the root level of the document hierarchy.
FindComponentWithIDVisitor  
GroupComponent Groups together geometry (BezShape), text (PointText) and nested groups within a layer or another group.
IgnoCodeLib IgnoCodeLib library initializer, library information source.
LayerComponent Instantiates a Layer component, immediately below the document (root) level.
LineVertex Stores a line vertex consisting of a single point.
Palette Maintains a set of Processing-style colors: alpha, red, green and blue stored as 4 bytes in an 32-bit int.
PointText Implements an Adobe Illustrator 7.0 Point Text object with a subset of the available tags.
RGBColor Provides storage and conversion utilities for an RGBColor.
ShapeAttributeVisitor  
Turtle Implements a basic 2D TurtleGraphics command set that can be used to draw shapes in Processing and export them to Adobe Illustrator.
TurtleState Stores and manages state of a Turtle: location, angle, pen state, visibility.
 

Enum Summary
BezShape.BezType  
 

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) 2013