User:Inge Hoonte/svg

From XPUB & Lens-Based wiki

"There's a certain predictability in that randomness" -- Michael

Balance and a tension between random and defined (?)

Media:square1.svg

Media:square3.svg

CODE

import random, colorsys

print """<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   id="svg2"
   width="10000"
   height="10000"
   version="1.1"
   inkscape:version="0.48.2 r9819"
   sodipodi:docname="New document 1">
  <defs
     id="defs4" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="0.35"
     inkscape:cx="40"
     inkscape:cy="140"
     inkscape:document-units="px"
     inkscape:current-layer="layer1"
     showgrid="false"
     inkscape:window-width="1145"
     inkscape:window-height="747"
     inkscape:window-x="100"
     inkscape:window-y="150"
     inkscape:window-maximized="0" />
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
"""
#none;stroke:#ff000f;stroke-opacity:25"
#(r=random.randomint(0), g=random.randomint(0,255), b=random.randomint(0,255))

#        <animateTransform
#            attributeName="transform"
#            begin="0s"
#            dur="6s"
#            type="rotate"
#            from="0 100 300"
#            to="360 100 300"
#            repeatCount="indefinite />
   
# TO DO: PRINT poetry
       
for x in range(0, 255):
    print """
<rect
    style="fill:none;stroke:rgb({1},{2},{3});stroke-opacity:25"
    id="rect2985"
    width="{0}"
    height="100"
    transform="rotate ({1} {2} {3})"
    x="{1}"
    y="{2}" />
       
""".format(x*random.randint(0,x), x*random.randint(0,x), x*random.randint(0,x), x*random.randint(0,x))

print"""
  </g>
</svg>
"""