- No dependencies required, only a C++11 complying compiler.
- Create a build directory and enter it
mkdir build && cd build
. - Generate Makefiles using
cmake ..
. - Build the project using
make
(multithreaded compilation using-j <coreNb>
is advised). - Binary is named
packer
. make test
will run the tests.make doc
will generated the documentation (Doxygen required) intobuild/doc/html/
.
- Directory
~/.config/inkscape/extensions/
must exist. - Run
make install
to install packer as an Inkscape extension.
- Require package
mingw-w64
. - Create a build directory and enter it
mkdir build-win && cd build-win
. - Configure Cmake project :
cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw-w64.cmake -DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32/ -Dtarget-os="windows" ..
. - Build it using
make
. - Executable name is
packer.exe
.
- Copy files
packer.exe
andpacker.in
to your Inkscape's extension folder. - It is usually located in
C:\users\:user_name:\appData\Roaming\Inkscape\extensions
. :user_name:
is the name of your current windows session.
- Basic usage :
./packer inputFile.svg > outputFile.svg
moves all the original shapes and pack them to fit the document's size. - Run
./packer --help
for a complete list of options. --width X
and--height Y
can be used to specify the wanted size of bin (in px).- The
--dup [01]
enables the duplication of the original shapes, thus only the duplicates are moved. - The default behavior is to pack all shapes. If the user specifies IDs of shapes using
--id ID
(can be used multiple times), only those will be packed. - For the purpose of laser cutting, the
buffer X
can be used to force a minimal distance (in px) between the packed shapes.
- Located in
Extensions->Packer
in the Inkscape menus. - The default behavior is to pack every shape. However if the user makes a selection of shapes beforehand, only those will be packed.
- For now, the parameters must be specified in pixels.
- Every
path
description. - Structural elements
svg
andg
. - Primitives
rect
,ellipse
,line
,polygon
,polyline
andcircle
. - Attributes
id
,height
,width
andtransform
(every format).
- A shape can contain multiple paths that will be moved jointly or a single path.
- Only the most atomic SVG groups (i.e. groups without subgroups) will be considered as shapes. Paths located outside of such groups will be considered as shapes containing a single path.
- Inside a multiple-path shape, a path completely covered by another will be processed as a hole.