The official PyValentina Home Page is located at http://fabricesalvaire.github.io/PyValentina
The latest documentation build from the git repository is available at readthedocs.org
Written by Fabrice Salvaire.
PyValentina is a python implementation of the Valentina Pattern Drafting software, which only focus to the core engine and not to the graphical user interface.
A pattern in flat pattern design is build from geometrical operations which can be turned to a computer program and is thus a field of applications of Computer Aided Design. It corresponds more precisely to parametric modelling with dedicated features to fashion modelling and manufacturing.
The core functionality of a CAD system for pattern drafting consists of these two software components :
The XML language is a natural candidate to define an open file format to store and exchange the pattern. Valentina uses XML to sore measurements in .vit files and patterns in .val files.
Another solution to define and store a pattern is to use a programming language, it can be a dedicated language or any programming language associated to a dedicated API. Many graphical languages was invented for specific usages, e.g. PostScript for printer, Metafont and MetaPost for publishing, G-code for machining etc.
Usually the geometrical operations of a pattern are simple in comparison to the requirements of a mechanical or electronic CAD software. In first hand it is only 2D and the number of operations should be handled smoothly by a computer of these days, whereas it is still challenging for other domains. A pattern drafting software only need a good geometrical engine to be designed efficiently.
Finally, a pattern drafting software requires an efficient graphical user interface so as to be used by fashion designers and not only by computer scientists. This software component is more challenging in therms of software engineering, i.e. in therms of design and cost.
The Python language has a large audience in engineering, due to its canonical syntax and richness of its ecosystem (scientific libraries).
Python is a high level language and thus more productive.
Python is used as scripting language to extend many software, in particular the famous open source 3D creation suite Blender, the parametric 3D modeller FreeCad as well as the SVG editor Inkscape. Moreover the 3D human model generator MakeHuman is written in Python.
Python can be easily extended by C libraries using CFFI and C++ libraries using SWIG.
This library could serve several purposes :
The answer is yes we can! since Qt has as a nice binding so called PyQt (if we consider Qt is superior to GTK and WxWidgets).
But up to now Python as of course some drawbacks!
Its main drawback is due to the fact the standard interpreter cannot execute more than one Python bytecode thread in true parallelism (multi-core), this limitation so called Global Interpreter Lock is required for implementation simplicity. Consequently we can do multi-threading, even on multi-core in some cases, but less easily than in Java or Cxx11.
Despite a GUI implemented in PyQt is almost of the time more faster than the human perception on a computer of these days. It can be sometime difficult to overcome some latency arising from the software stack. Thus yes we can do it, but it could requires some tricks to achieve the performance of a C++ application.
The features of PyValentina are :
The installation of PyValentina by itself is quite simple. However it will be easier to get the dependencies on a Linux desktop.
PyValentina requires the following dependencies:
Also it is recommanded to have these Python modules:
- pip
- virtualenv
For development, you will need in addition:
PyValentina is made available on the PyPI repository at https://pypi.python.org/pypi/PyValentina
Run this command to install the last release:
pip install PyValentina
The PyValentina source code is hosted at https://github.com/FabriceSalvaire/PyValentina
To clone the Git repository, run this command in a terminal:
git clone git@github.com:FabriceSalvaire/PyValentina.git
Then to build and install PyValentina run these commands:
python setup.py build python setup.py install