/inkscapeboundingbox

Simple Inkscape Bounding Box Extension

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

Bounding Box Extension for Inkscape

This Inkscape extension allows users to create a bounding box around selected objects or the entire page. The extension provides various options to customize the bounding box, including creating a new layer for bounding box, adjustments for size, addition of guides, and styling options for fill and stroke.

Installation

  1. Download the Extension: Download the files bounding_box.inx and bounding_box.py from this repository.
  2. Install the Extension: Copy these files into your Inkscape extensions directory. You will find this in the 'User Extensions' option under the System section at Edit-Preferences in Inkscape.
  3. Restart Inkscape: Close and reopen Inkscape to load the new extension.

Features

This extension provides the following features:

  • Dynamic Bounding Box: Create a bounding box that adjusts based on the selected objects or the entire page.
  • Adjustable Size: Increase or decrease the size of the bounding box.
  • Guides: Optionally add horizontal and/or vertical guides from the center of the bounding box.
  • Layer Options: Choose to add the bounding box to a new layer or the current layer.
  • Style Customization: Specify fill and stroke colors for the bounding box.

Usage

After installation, the extension can be accessed from the Inkscape menu under Extensions > Render > Add Bounding Box.

Options

  • Bounding Box Type: Choose to create the bounding box around the Selection or the entire Page.
  • Grow/Shrink: Enter a percentage to grow or shrink the bounding box relative to the selected objects or page.
  • New Layer: Check this option to create the bounding box in a new layer. If unchecked, the bounding box will be added to the current layer.
  • Horizontal Guide: Add a horizontal guide across the middle of the bounding box.
  • Vertical Guide: Add a vertical guide across the middle of the bounding box.
  • Add Fill: Enable or disable filling the bounding box with color.
  • Fill Color: Choose a color for the bounding box fill. This option is enabled only if Add Fill is checked.
  • Add Stroke: Enable or disable the stroke outline for the bounding box.
  • Stroke Color: Choose a color for the bounding box stroke. This option is enabled only if Add Stroke is checked.

Examples

  • Creating a Bounding Box for Selected Objects:

    1. Select the objects in Inkscape.
    2. Go to Extensions > Render > Add Bounding Box.
    3. Choose Selection under Bounding Box Type, adjust other settings as needed, and click Apply.
  • Creating a Bounding Box for the Entire Page:

    1. Go to Extensions > Render > Bounding Box.
    2. Choose Page under Bounding Box Type, adjust other settings as needed, and click Apply.

License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.