Chapter 11. Shapes

The freedom to do anything, any time, the way you like is one thing that a good vector editor prides itself on. With a small vocabulary of generic object types and generic tools for manipulating them, you can render, or at least approximate, any graphic imaginable.

However, absolute freedom is not always a good thing. For example, a path (Chapter 12) can represent any possible two-dimensional shape. But often, what you need is not “any” shape but some very simple and well-defined geometric entity, such as a rectangle. Of course, a four-node path will give you a perfect rectangle—but isn’t there a faster and more convenient way to do that, specifically for rectangles?

To respond to this need, Inkscape has several object types for commonly used geometric shapes: rectangles, 3D boxes, ellipses, polygons, stars, and spirals. Each shape type has a corresponding creation tool; it also provides an array of numeric parameters, draggable handles, and shortcuts for manipulating these shapes. You cannot do “everything” to such a shape object, but what you can do to it makes perfect sense for that specific shape type.

You can always press to convert a shape to a path (or, in the case of a 3D box, to a group). The reverse conversion, however, is not possible (at least, not automatically). This means that a shape is a higher level of abstraction than a path; converting a shape to a path loses some information and is therefore a one-way, destructive operation.

AI

Surprisingly, shape tools in Inkscape have no direct equivalent in Adobe Illustrator. All AI has in this department is a number of “quick shape” tools that can create some basic shapes—but, once created, the objects forget how they were born and become plain paths without any shape-specific capabilities. The convenience of Inkscape’s “self-conscious” shapes is one of its important advantages over Illustrator.

SVG

Inkscape’s ellipses and stars are significantly more versatile than the shape elements defined by the SVG standard. Therefore, Inkscape uses the generic path element for these shapes, instead of the ellipse and polygon elements provided by SVG (although it can read and display these SVG shape elements too). For spirals, there’s no SVG element at all, so they are also represented by a path element internally. The only shape that uses a non-path element is the rectangle which uses the rect element.