frno7 / libpes

Libpes is a portable C library for encoding, decoding and transcoding the PES and SVG based machine embroidery formats.
GNU General Public License v3.0
44 stars 10 forks source link
embroidery pes svg

compilation workflow

libpes

libpes is a portable C library for encoding, decoding and transcoding the PES and SVG based machine embroidery formats. The PES format is a machine embroidery file format for Brother Industries and Bernina International series of embroidery machines, among others. PES files contain sewing coordinates for stitches and corresponding thread colors.

Tools

PES embroidery format description

Check the PES format wiki.

SVG embroidery format

libpes implements a prototype SVG embroidery format with the intention of being a vendor neutral format that is more convenient to display, generate and modify than PES or other proprietary formats. The idea more specifically is to represent machine embroidery instructions in the SVG format, as opposed to general rendering of SVG. As of this particular implementation only path elements are supported with mandatory stroke and d attributes, as shown in the example below.

SVG embroidery example

examples/envelope.svg is an example of SVG embroidery. It contains a single path element with seven (x,y) coordinate pairs forming a shape of an envelope:

<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8.0mm" height="5.0mm" version="1.1"
     viewBox="0.0 0.0 8.0 5.0" xmlns="http://www.w3.org/2000/svg">
  <path stroke="#000000" fill="none" stroke-width="0.4"
        d="M 8.0 0.0 L 0.0 0.0 L 0.0 5.0 L 8.0 5.0
           L 8.0 0.0 L 4.0 2.0 L 0.0 0.0" />
</svg>

Licence

See the LICENCE file.