Beginning to write tests for groups

pull/58/head
Michael X. Grey 2018-05-09 17:39:54 -07:00
parent 332e959f52
commit 3512f86968
2 changed files with 151 additions and 0 deletions

143
test/groups.svg Normal file
View File

@ -0,0 +1,143 @@
<?xml version="1.0" ?>
<svg
baseProfile="full"
version="1.1"
viewBox="0 0 365 365"
height="100%"
width="100%"
xmlns="http://www.w3.org/2000/svg"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs/>
<g
id="matrix group"
transform="matrix(1.5 0 0 0.5 -40.0 20.0)">
<path
d="M 183,183 l 0,-50"
fill="black"
stroke="black"
stroke-width="3"/>
<g
id="scale group"
transform="scale(1.25)">
<path
d="M 122,320 l -50,0"
fill="black"
stroke="black"
stroke-width="3"/>
<g
id="nested group - empty transform"
transform="">
<path
d="M 150,200 l -50,25"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
<g
id="nested group - no transform">
<path
d="M 150,200 l -50,25"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
<g
id="nested group - translate"
transform="translate(20)">
<path
d="M 150,200 l -50,25"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
<g
id="nested group - translate xy"
transform="translate(20, 30)">
<path
d="M 150,200 l -50,25"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
</g>
<g
id="scale xy group"
transform="scale(0.5 1.5)">
<path
d="M 122,320 l -50,0"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
<g
id="rotate group"
transform="rotate(20)">
<path
d="M 183,183 l 0,30"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
<g
id="rotate xy group"
transform="rotate(45 183 183)">
<path
d="M 183,183 l 0,30"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
<g
id="skew x group"
transform="skewX(5)">
<path
d="M 183,183 l 40,40"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
<g
id="skew y group"
transform="skewY(5)">
<path
d="M 183,183 l 40,40"
fill="black"
stroke="black"
stroke-width="3"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

8
test/test_groups.py Normal file
View File

@ -0,0 +1,8 @@
from __future__ import division, absolute_import, print_function
import unittest
from svgpathtools import *
class TestGroups(unittest.TestCase):
def test_group_transform(self):
pass