diff --git a/doc/sphinx/source/resources/file-format/dxf.rst b/doc/sphinx/source/resources/file-format/dxf.rst new file mode 100644 index 0000000000000000000000000000000000000000..314b0843818793db40bec15a0fb993c2aad0e6b7 --- /dev/null +++ b/doc/sphinx/source/resources/file-format/dxf.rst @@ -0,0 +1,7 @@ +.. include:: /abbreviation.txt + +.. _dxf-ressources-page: + +================= + DXF File Format +================= diff --git a/doc/sphinx/source/resources/file-format/index.rst b/doc/sphinx/source/resources/file-format/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..4c9f1aeaed55b8cfc8da7b85344fb416bf9f837f --- /dev/null +++ b/doc/sphinx/source/resources/file-format/index.rst @@ -0,0 +1,18 @@ +.. include:: /abbreviation.txt + +.. _file-format-ressources-page: + +============== + File Formats +============== + +This section contains resource on file format. + +Contents: + +.. toctree:: + :maxdepth: 2 + + dxf.rst + svg.rst + valentina.rst diff --git a/doc/sphinx/source/resources/file-format/svg.rst b/doc/sphinx/source/resources/file-format/svg.rst new file mode 100644 index 0000000000000000000000000000000000000000..1194c1ffcffe56c49ed6334e06102569dc9b13af --- /dev/null +++ b/doc/sphinx/source/resources/file-format/svg.rst @@ -0,0 +1,90 @@ +.. include:: /abbreviation.txt + +.. _svg-ressources-page: + +================= + SVG File Format +================= + +Reference Documentations +------------------------ + +* `Scalable Vector Graphics (SVG) W3C Home Page `_ +* `An SVG Primer for Today's Browsers W3C Working Draft — September 2010 `_ +* `Scalable Vector Graphics (SVG) 1.1 (Second Edition) W3C Recommendation 16 August 2011 `_ +* `Mozilla SVG Documentation `_ + +SVG Coordinate System +--------------------- + +SVG uses the screen coordinate system where the X axis points towards the right direction and the Y +axis points towards the bottom direction, thus the origin is at the upper left-hand corner of the +drawing frame. + +Inkscape Software +----------------- + +Inkscape can save a SVG file in several ways: + +* simple: the file will only contains pure SVG +* Inkscape: the file will contains Inkscape extension +* optimised: perform some optimisations on the output +* compressed: file is compressed using the zip algorithm + +**Notes on how Inkscape generates SVG**: + +* As opposite to the SVG Specification, Inkscape set the origin at the bottom of the document, thus + + :math:`\mathbf{Y}_{\mathrm{Inkscape}} = \mathbf{Page\ Height} - \mathbf{Y}_{\mathrm{SVG}}` + + The transformation is a composition of a Y axis parity and a translation on the Y axis of the page height. + + See also https://bugs.launchpad.net/inkscape/+bug/170049 + +* It uses a *group* as top layer and a *transform* +* It uses a mix of absolute and incremental coordinates +* **It spoils in several ways the object's coordinates**: values are transformed and rounded. + Thus **Inkscape should not be be used to make or edit a file which require accurate coordinates.** + +Inkscape SVG example +~~~~~~~~~~~~~~~~~~~~ + +This example uses a margin of 20 and paint + +* an horizontal line of length 100 from the origin (20, 20) +* a vertical line of length 100 from the origin +* a 45° line of length 80 from the origin +* the viewport is (0, 0, 140, 140) + +**Note: this extract is incomplete** + +.. code-block:: text + + + + + + + + + + +This SVG file must be interpreted as follow + +* Draw a line from (20, 276-156) to +(100, 0) (note: l is deduced from m), + + which gives (20, 120) to (120, 120), + + and in Inkscape coordinates (20, 20) to (120, 20) since 140 - 120 = 20 + +* Draw a line from (20, 276-156) to (20, 176-156), + + which gives (20, 120) to (20, 20), + + and in Inkscape coordinates (20, 20) to (20, 120) + +* Draw a line from (20, 276-156) to +(80, -80), + + which gives (20, 120) to (100, 40), + + and in Inkscape coordinates (20, 20) to (100, 100) diff --git a/doc/sphinx/source/resources/file-format/valentina.rst b/doc/sphinx/source/resources/file-format/valentina.rst new file mode 100644 index 0000000000000000000000000000000000000000..b437fd5920448f5ff0157c1142228fd5bb8b710f --- /dev/null +++ b/doc/sphinx/source/resources/file-format/valentina.rst @@ -0,0 +1,7 @@ +.. include:: /abbreviation.txt + +.. _valentina-file-format-ressources-page: + +======================= + Valentina File Format +======================= diff --git a/doc/sphinx/source/resources/index.rst b/doc/sphinx/source/resources/index.rst index b097907e72b45b95fd6b3a9686a5e56a24c9cf6b..c3e6530ff4cc6e802f3d66e39b6c2a229dd56541 100644 --- a/doc/sphinx/source/resources/index.rst +++ b/doc/sphinx/source/resources/index.rst @@ -13,4 +13,5 @@ Contents: .. toctree:: :maxdepth: 2 + file-format/index.rst geometry/index.rst