2. Features

Patro implements several components:

  • a 2D Geometry Engine
  • a Pattern Engine
  • a Graphic Engine to export drawing to screen display, SVG, PDF and DXF file
  • a submodule to read/write SVG file
  • import/export of the Valentina file format
  • import of SVG pattern (as well as PDF using a conversion tools like Inkscape)
  • digitalisation of patterns acquired with a camera ACTUALLY NOT RELEASED WITH OPEN SOURCE LICENCE

Note

Patro is just a core engine actually. It doesn’t implement a full featured GUI similar to Valentina.

Note

Patro doesn’t implement 3D feature actually, like automatic clothe fitting on avatar and tension map.

2.1. Geometry Engine

The geometry engine implements:

  • 2D vector and usual transformations
  • usual 2D primitives:
  • point, segment, line, polyline
  • triangle, rectangle, polygon
  • circle and ellipse
  • quadratic and cubic Bézier curve
  • B-spline curve
  • path made of linear segments with an optional bulge at breaks, as well as quadratic and cubic Bézier curve segments.
  • perimeter and area
  • primitive intersection
  • thanks to Sympy, Patro could implement symbolic computations when it is feasible

2.2. Pattern Engine

  • Measurements can be imported from Valentina .vit or a YAML file. We can merge several files to a measurement set.
  • Measurements are lazily evaluated using Sympy symbolic computation, which means we can compute exact values and the order of definition doesn’t matter.

2.3. Graphic Engine

Patro features a basic Qt user interface which can display a graphic scene and features item selection so as to provide the minimum to work with.

The graphic engine implement a 2D graphic scene which is rendered by a painter. A scene contains graphic items like text, image line, circle and Bézier curve.

A painter is responsible to render the scene on the screen or a graphic file format. The graphic engine is able to render on the following:

  • show drawing on screen with : Matplotlib, Qt
  • export drawing to : SVG, PDF, DXF, LaTeX Tikz
  • export tiled pattern on A4 sheets : PDF, LaTeX Tikz

Note

PDF and SVG format are convertible to each other without data loss (font handling require more attention).

Note

The Inkscape free software is able to import from / export to a lot of file formats like SVG, PDF, DXF and to render the drawing to an image format. This job can be done in batch from command line.

Also the graphic engine is able to render a DXF made of these graphic items: line, circle, arc, ellipse, lwpolyline and spline.

For expert, the LaTeX output can be used to modify the drawing using the power of the Tikz (PGF) graphic package.

Implementation details:

  • SVG can be rendered using the SVG and Qt painter
  • PDF export is implemented with the help of the Reportlab package
  • DXF import/export is implemented with the help of the ezdxf package of Manfred Moitzi

2.4. Pattern Format Support

  • Valentina format: read/write .val and .vit file, but partially implemented, cf. supra for details
  • import pattern from SVG and DXF (partially implemented)

Note

PDF and SVG format are convertible to each other without data loss (font handling require more attention).

Note

The Inkscape free software is able to import a lot of file formats like PDF, DXF and to save it to SVG.

2.4.1. Pattern Format Compatibility

For more details on pattern format support, see :

2.5. Digitalisation

  • digitalise pattern acquired with a camera ACTUALLY NOT RELEASED WITH OPEN SOURCE LICENCE