Twist

From Evil Mad Scientist Wiki
Jump to: navigation, search
eggbottiny.jpg This wiki page is part of the documentation for the Egg-Bot kit. Click here to return to the Egg-Bot overview.
The specifics of this portion assume that you have version 2.1.0 or higher of the Eggbot extensions installed.
Click here if you need help determining which version you have installed.


<<< Stretch || Twist


extensions-twist-01.png

The Twist extension provides a coding example which illustrates some common tasks: evaluating graphical elements of a SVG document, reducing each graphical element into sequences of points, generating new graphical elements, and inserting the new elements into the SVG document. The source files for this extension are eggbot_twist.py and eggbot_twist.inx and can be found in your extensions directory. The former file is the Python source code for the extension while the latter is the menu description for the extension itself. The other Eggbot extensions are also good sources of example code. Also, don't neglect to look at or search through all the other extensions in the Inkscape extensions directory: they too provide many coding examples.

The Inkscape project provides some limited documentation on writing extensions at their wiki site. See the "Extensions" topic under the "Developer tutorials" section at their main wiki page.

Usage

To use the Twist extension, select the figure or figures you wish to "twist". Then select the "Twist..." item from the "EggBot Contributed" section of the "Extensions" menu. You can specify how many iterations of the twist to perform as well as a "step ratio". The step ratio is the fractional distance along an existing edge to start the next, twisted edge. In the figure below, a step ratio of 0.1 was used for the triangle and a step ratio of 0.2 for the square.

extensions-twist-02.png

extensions-twist-03.png

Where to find the extensions on your system

The location of the Eggbot extensions on your system varies with your operating system. They may be found in the following, platform specific directories

  • Mac OS X: /Applications/Inkscape.app/Contents/Resources/share/inkscape/extensions/
  • Windows: C:\Program Files\Inkscape\share\extensions\
  • Linux: ~/.config/inkscape/extensions/

Note that on Linux systems, the extensions distributed with Inkscape are stored in a system-wide directory. The location of this directory varies with different Linux distributions.


<<< Stretch || Twist