diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-10-19 17:49:35 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-10-19 17:49:35 +0000 |
| commit | 30e1225c143c459dd0623f762c8f51425b2d822c (patch) | |
| tree | 3a2d3e5215764b270c981c781a529b9bff58ed23 | |
| parent | Update to trunk r13625 (diff) | |
| download | inkscape-30e1225c143c459dd0623f762c8f51425b2d822c.tar.gz inkscape-30e1225c143c459dd0623f762c8f51425b2d822c.zip | |
Add seamless patern generator to a extension and to a procedural template
(bzr r13341.1.281)
| -rw-r--r-- | share/extensions/seamless_pattern.inx | 20 | ||||
| -rwxr-xr-x | share/extensions/seamless_pattern.py | 213 | ||||
| -rw-r--r-- | share/extensions/seamless_pattern.svg | 85 | ||||
| -rw-r--r-- | share/extensions/seamless_pattern_procedural.inx | 25 |
4 files changed, 343 insertions, 0 deletions
diff --git a/share/extensions/seamless_pattern.inx b/share/extensions/seamless_pattern.inx new file mode 100644 index 000000000..fe4098e05 --- /dev/null +++ b/share/extensions/seamless_pattern.inx @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>Seamless Pattern</_name> + <id>org.inkscape.render.seamless_pattern</id> + <dependency type="executable" location="extensions">seamless_pattern.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + <param name="width" _gui-text="Custom Width (px.):" type="int" min="1" max="99999999">100</param> + <param name="height" _gui-text="Custom Height (px.):" type="int" min="1" max="99999999">100</param> + <_param name="help-info" type="description">This extension overwrite current document</_param> + + <effect needs-live-preview="false"> + <object-type>All</object-type> + <effects-menu> + <submenu _name="Render"/> + </effects-menu> + </effect> + <script> + <command reldir="extensions" interpreter="python">seamless_pattern.py</command> + </script> +</inkscape-extension> diff --git a/share/extensions/seamless_pattern.py b/share/extensions/seamless_pattern.py new file mode 100755 index 000000000..f737c4cbc --- /dev/null +++ b/share/extensions/seamless_pattern.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python + +# Written by Jabiertxof +# V.03 + +import inkex +import re +import os +from lxml import etree + +class C(inkex.Effect): + def __init__(self): + inkex.Effect.__init__(self) + self.OptionParser.add_option("-w", "--width", action="store", type="int", dest="desktop_width", default="100", help="Custom width") + self.OptionParser.add_option("-z", "--height", action="store", type="int", dest="desktop_height", default="100", help="Custom height") + + def effect(self): + + width = self.options.desktop_width + height = self.options.desktop_height + path = os.path.dirname(os.path.realpath(__file__)) + self.document = etree.parse(os.path.join(path, "seamless_pattern.svg")) + root = self.document.getroot() + root.set("id", "SVGRoot") + root.set("width", str(width) + 'px') + root.set("height", str(height) + 'px') + root.set("viewBox", "0 0 " + str(width) + " " + str(height) ) + + xpathStr = '//svg:use[@id="sampleTile"]' + sampleTile = root.xpath(xpathStr, namespaces=inkex.NSS) + if sampleTile != []: + sampleTile[0].set("transform", "translate(" + str(width * 6) + ",-" + str(height) + ")") + + + xpathStr = '//svg:use[@id="clipPathRect"]' + clipPathRect = root.xpath(xpathStr, namespaces=inkex.NSS) + if clipPathRect != []: + clipPathRect[0].set("transform", "translate(" + str((width*3)) + "," + str(height) +")") + + xpathStr = '//svg:tspan[@id="infoText"]' + infoText = root.xpath(xpathStr, namespaces=inkex.NSS) + if infoText != []: + infoText[0].text = infoText[0].text.replace("100x100", str(width) + "x" + str(height)) + + xpathStr = '//svg:use[@id="backgroundPattern"]' + backgroundPattern = root.xpath(xpathStr, namespaces=inkex.NSS) + if backgroundPattern != []: + backgroundPattern[0].set("transform", "translate(-" + str(width * 2) + ",0)") + + xpathStr = '//svg:rect[@id="cuadroPattern"]' + cuadroPattern = root.xpath(xpathStr, namespaces=inkex.NSS) + if cuadroPattern != []: + cuadroPattern[0].set("width", str(width)) + cuadroPattern[0].set("height", str(height)) + cuadroPattern[0].set("y", "-" + str(height*2)) + + xpathStr = '//svg:use[@id="cuadroPatternDisenador"]' + cuadroPatternDisenador = root.xpath(xpathStr, namespaces=inkex.NSS) + if cuadroPatternDisenador != []: + cuadroPatternDisenador[0].set("transform", "translate(" + str(width * 3) + "," + str(height) + ")") + + xpathStr = '//svg:g[@id="designZone"]' + designZone = root.xpath(xpathStr, namespaces=inkex.NSS) + if designZone != []: + designZone[0].set("transform", "translate(" + str((width*5)) + ",0)scale(" + str(((width+height)/2)/100.) + ")") + + xpathStr = '//svg:g[@id="patternResult"]' + patternResult = root.xpath(xpathStr, namespaces=inkex.NSS) + if patternResult != []: + patternResult[0].set("transform", "translate(-" + str((width * 3)) + "," + str(height) + ")") + + xpathStr = '//svg:use[@id="patternTileBackground"]' + patternTileBackground = root.xpath(xpathStr, namespaces=inkex.NSS) + if patternTileBackground != []: + patternTileBackground[0].set("transform", "matrix(3,0,0,3," + str((width * 2)) + "," + str(height * 4) + ")") + patternTileBackground[0].set("width", str(width*3)) + patternTileBackground[0].set("height", str(height*3)) + + xpathStr = '//svg:use[@id="patternGenerated"]' + patternGenerated = root.xpath(xpathStr, namespaces=inkex.NSS) + if patternGenerated != []: + patternGenerated[0].set("width", str(width)) + patternGenerated[0].set("height", str(height)) + + xpathStr = '//svg:use[@id="pattern1"]' + pattern1 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern1 != []: + pattern1[0].set("transform", "translate(" + str(-width) + "," + str(-height) + ")") + + xpathStr = '//svg:use[@id="pattern2"]' + pattern2 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern2 != []: + pattern2[0].set("transform", "translate(0," + str(-height) +")" ) + + xpathStr = '//svg:use[@id="pattern3"]' + pattern3 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern3 != []: + pattern3[0].set("transform", "translate(" + str(width) + "," + str(-height) + ")" ) + + xpathStr = '//svg:use[@id="pattern4"]' + pattern4 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern4 != []: + pattern4[0].set("transform", "translate(" + str(-width) + ",0)" ) + + xpathStr = '//svg:use[@id="pattern5"]' + pattern5 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern5 != []: + pattern5[0].set("transform", "translate(0,0)" ) + + xpathStr = '//svg:use[@id="pattern6"]' + pattern6 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern6 != []: + pattern6[0].set("transform", "translate(" + str(width) + ",0)" ) + + xpathStr = '//svg:use[@id="pattern7"]' + pattern7 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern7 != []: + pattern7[0].set("transform", "translate(" + str(-width) + "," + str(height) + ")" ) + + xpathStr = '//svg:use[@id="pattern8"]' + pattern8 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern8 != []: + pattern8[0].set("transform", "translate(0," + str(height) + ")" ) + + xpathStr = '//svg:use[@id="pattern9"]' + pattern9 = root.xpath(xpathStr, namespaces=inkex.NSS) + if pattern9 != []: + pattern9[0].set("transform", "translate(" + str(width) + "," + str(height) + ")" ) + + xpathStr = '//svg:use[@id="samplePattern1"]' + samplePattern1 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern1 != []: + samplePattern1[0].set("transform", "translate(" + str(-width) + "," + str(-height) + ")") + + xpathStr = '//svg:use[@id="samplePattern2"]' + samplePattern2 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern2 != []: + samplePattern2[0].set("transform", "translate(0," + str(-height) +")" ) + + xpathStr = '//svg:use[@id="samplePattern3"]' + samplePattern3 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern3 != []: + samplePattern3[0].set("transform", "translate(" + str(width) + "," + str(-height) + ")" ) + + xpathStr = '//svg:use[@id="samplePattern4"]' + samplePattern4 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern4 != []: + samplePattern4[0].set("transform", "translate(" + str(-width) + ",0)" ) + + xpathStr = '//svg:use[@id="samplePattern5"]' + samplePattern5 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern5 != []: + samplePattern5[0].set("transform", "translate(0,0)" ) + + xpathStr = '//svg:use[@id="samplePattern6"]' + samplePattern6 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern6 != []: + samplePattern6[0].set("transform", "translate(" + str(width) + ",0)" ) + + xpathStr = '//svg:use[@id="samplePattern7"]' + samplePattern7 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern7 != []: + samplePattern7[0].set("transform", "translate(" + str(-width) + "," + str(height) + ")" ) + + xpathStr = '//svg:use[@id="samplePattern8"]' + samplePattern8 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern8 != []: + samplePattern8[0].set("transform", "translate(0," + str(height) + ")" ) + + xpathStr = '//svg:use[@id="samplePattern9"]' + samplePattern9 = root.xpath(xpathStr, namespaces=inkex.NSS) + if samplePattern9 != []: + samplePattern9[0].set("transform", "translate(" + str(width) + "," + str(height) + ")" ) + + xpathStr = '//svg:g[@id="patternPreview"]' + patternPreview = root.xpath(xpathStr, namespaces=inkex.NSS) + if patternPreview != []: + patternPreview[0].set("transform", "translate(0," + str(height*2) + ")" ) + + xpathStr = '//svg:g[@id="helperLayer"]' + helperLayer = root.xpath(xpathStr, namespaces=inkex.NSS) + if helperLayer != []: + helperLayer[0].set("transform", "scale(" + str(width/100.) + "," + str(height/100.) + ")" ) + + xpathStr = '//svg:rect[@id="fondoGris"]' + fondoGris = root.xpath(xpathStr, namespaces=inkex.NSS) + if fondoGris != []: + fondoGris[0].set("transform", "scale(" + str(width/100.) + "," + str(height/100.) + ")" ) + + xpathStr = '//svg:use[@id="patternGenerator" or id="patternPreviewFast"]' + patternGenerator = root.xpath(xpathStr, namespaces=inkex.NSS) + if patternGenerator != []: + patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-cx", str(width/2)) + patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-cy", str(height/2)) + patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-w", str(width)) + patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-h", str(height)) + patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-x0", str(width)) + patternGenerator[0].set("{http://www.inkscape.org/namespaces/inkscape}tile-y0", str(height)) + patternGenerator[0].set("width", str(width)) + patternGenerator[0].set("height", str(height)) + + namedview = root.find(inkex.addNS('namedview', 'sodipodi')) + if namedview is None: + namedview = inkex.etree.SubElement( root, inkex.addNS('namedview', 'sodipodi') ); + + namedview.set(inkex.addNS('document-units', 'inkscape'), 'px') + + namedview.set(inkex.addNS('cx', 'inkscape'), str((width*8)/2.0) ) + namedview.set(inkex.addNS('cy', 'inkscape'), "0" ) + namedview.set(inkex.addNS('zoom', 'inkscape'), str(0.5 / (((width+height)/2)/100.)) ) + +c = C() +c.affect() diff --git a/share/extensions/seamless_pattern.svg b/share/extensions/seamless_pattern.svg new file mode 100644 index 000000000..e29b52255 --- /dev/null +++ b/share/extensions/seamless_pattern.svg @@ -0,0 +1,85 @@ +<?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:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="100px" height="100px" viewBox="0 0 100 100" id="SVGRoot" version="1.1" inkscape:version="0.91pre2 r13616" sodipodi:docname="seamless_pattern.svg" inkscape:export-xdpi="96" inkscape:export-ydpi="96"> + <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.5" inkscape:cx="400" inkscape:cy="0" inkscape:document-units="px" inkscape:current-layer="backgroundPattern" showgrid="false" units="px" inkscape:window-width="1280" inkscape:window-height="958" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" borderlayer="true" /> + <defs id="defs4"> + <marker inkscape:isstock="true" style="overflow:visible" id="TriangleOutL" refX="0.0" refY="0.0" orient="auto" inkscape:stockid="TriangleOutL"> + <path transform="scale(0.8)" style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" d="M 5.77,0.0 L -2.88,5.0 L -2.88,-5.0 L 5.77,0.0 z " id="path12886" /> + </marker> + <clipPath id="clipPath7370" clipPathUnits="userSpaceOnUse"> + <use height="100%" width="100%" id="clipPathRect" xlink:href="#cuadroPattern" y="0" x="0" transform="translate(300,100)" /> + </clipPath> + </defs> + <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> + <inkscape:_templateinfo id="_templateinfo10"> + <inkscape:_name id="_name12">Pattern</inkscape:_name> + <inkscape:_shortdesc id="_shortdesc14">Pattern</inkscape:_shortdesc> + <inkscape:_keywords id="_keywords16">Pattern</inkscape:_keywords> + </inkscape:_templateinfo> + <g id="pattern" inkscape:groupmode="layer" inkscape:label="Pattern"> + <g id="patternPackage" inkscape:label="Pattern Package"> + <g id="backgroundPattern" inkscape:groupmode="layer" inkscape:label="Background"> + <rect transform="scale(1.0,1.0)" style="color:#000000;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#cccccc;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" id="fondoGris" width="1000" height="1100" x="-100" y="-300" /> + <rect y="-200" x="0" height="100" width="100" id="cuadroPattern" style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#ffff00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:20;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:1.0989;stroke-opacity:1;marker:none;enable-background:accumulate" /> + <use transform="translate(300,100)" sodipodi:insensitive="true" x="0" y="0" xlink:href="#cuadroPattern" id="cuadroPatternDisenador" width="100%" height="100%" /> + </g> + <g inkscape:label="Design" inkscape:groupmode="layer" id="designZone" transform="translate(500,0)scale(1.0)"> + <g transform="matrix(0.8615384,0,0,0.8615384,-77.38926,41.91578)" id="g27683"> + <circle d="M -104.3676,-47.55266 A 32.05479,32.05479 0 0 1 -136.4224,-15.49787 32.05479,32.05479 0 0 1 -168.4772,-47.55266 32.05479,32.05479 0 0 1 -136.4224,-79.60745 32.05479,32.05479 0 0 1 -104.3676,-47.55266 Z" style="color:#000000;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.890411;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" id="path27681" cx="-136.4224" cy="-47.55266" r="32.05479" /> + <g transform="matrix(0.1320681,0.0068838,-0.0068838,0.1320681,-161.0563,-74.64184)" id="g8278" inkscape:transform-center-x="-24.88494" inkscape:transform-center-y="-41.31186"> + <path id="path8280" d="M 163.15,27.83 28.81,165.3 C -16.58,221.51 59.7,214.97 92.4,231.16 104.13,243.15 47.44,252 59.17,264 70.9,275.99 130.1,287.1 141.85,299.09 153.58,311.08 117.84,323.8 129.57,335.79 141.3,347.78 168.43,336.42 173.51,364.1 177.13,383.88 222.4,372.6 244.54,356.4 256.27,344.4 222.1,345.53 233.83,333.54 263,303.71 290.16,322.7 300.14,292.81 305.07,278.04 257.2,270.04 268.95,258.05 302.7,238.34 419.35,225.51 364,170.16 L 224.75,27.83 C 207.72,11.48 179.3,11.3 163.15,27.83 Z M 317.46,292.81 C 317.46,299.63 367.71,304.1 367.71,291.2 360.55,270.48 323.4,271.88 317.46,292.81 Z M 91.1,329.05 C 103,339.34 121.38,326.49 126.89,312.13 115.36,296.81 72.2,312.68 91.1,329.05 Z M 311.16,306.82 C 295.82,320.58 312.88,334.54 328,325.65 331.37,322.23 327.91,310.24 311.16,306.82 Z" inkscape:connector-curvature="0" /> + <path style="fill:#ffffff" id="path8282" d="M 131,238.6 C 134.59,240.83 188.89,251.86 202.16,254.06 206.76,255.03 203.5,259.77 197.16,262.97 182.86,266.77 113.5,238.6 131,238.6 Z" inkscape:connector-curvature="0" /> + <path style="fill:#ffffff" id="path8284" d="M 216.63,37.47 269.78,91.45 C 274.82,96.6 274.75,106.58 271.93,109.45 L 245.54,88.34 240.35,119.6 218.3,107.96 182.99,130.27 171.3,83.24 152.33,116.06 123.33,116.06 C 111.51,116.06 110.12,101.06 120.86,90.32 139.62,70.07 161.15,49.43 172.85,37.47 184.61,25.45 205.1,25.79 216.63,37.47 Z" inkscape:connector-curvature="0" /> + </g> + </g> + <path d="M -137.728,-45.19118 -147.3578,-47.1057 -150.5147,-37.80877 -153.6716,-47.1057 -163.3014,-45.19118 -156.8285,-52.57359 -163.3014,-59.956 -153.6716,-58.04148 -150.5147,-67.33841 -147.3578,-58.04148 -137.728,-59.956 -144.2009,-52.57359 Z" inkscape:randomized="0" inkscape:rounded="0" inkscape:flatsided="false" sodipodi:arg2="1.047198" sodipodi:arg1="0.5235988" sodipodi:r2="6.313778" sodipodi:r1="14.76482" sodipodi:cy="-52.57359" sodipodi:cx="-150.5147" sodipodi:sides="6" id="path27746" style="color:#000000;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" sodipodi:type="star" /> + </g> + <g clip-path="url(#clipPath7370)" inkscape:label="Pattern Result" id="patternResult" transform="translate(-300,100)" inkscape:groupmode="layer"> + <use width="300" height="300" transform="matrix(3,0,0,3,200,400)" id="patternTileBackground" xlink:href="#cuadroPattern" y="0" x="0" /> + <use x="0" y="0" xlink:href="#designZone" transform="translate(-100,-100)" id="pattern1" width="100%" height="100%" sodipodi:insensitive="true" /> + <use x="0" y="0" xlink:href="#designZone" transform="translate(0,-100)" id="pattern2" width="100%" height="100%" sodipodi:insensitive="true" /> + <use x="0" y="0" xlink:href="#designZone" transform="translate(100,-100)" id="pattern3" width="100%" height="100%" sodipodi:insensitive="true" /> + <use x="0" y="0" xlink:href="#designZone" transform="translate(-100,0)" id="pattern4" width="100%" height="100%" sodipodi:insensitive="true" /> + <use transform="translate(0,0)" x="0" y="0" xlink:href="#designZone" id="pattern5" width="100%" height="100%" sodipodi:insensitive="true" /> + <use x="0" y="0" xlink:href="#designZone" transform="translate(100,0)" id="pattern6" width="100%" height="100%" sodipodi:insensitive="true" /> + <use x="0" y="0" xlink:href="#designZone" transform="translate(-100,100)" id="pattern7" width="100%" height="100%" sodipodi:insensitive="true" /> + <use x="0" y="0" xlink:href="#designZone" transform="translate(0,100)" id="pattern8" width="100%" height="100%" sodipodi:insensitive="true" /> + <use x="0" y="0" xlink:href="#designZone" transform="translate(100,100)" id="pattern9" width="100%" height="100%" sodipodi:insensitive="true" /> + </g> + <g transform="translate(0,200)" id="patternPreview" inkscape:label="Pattern Preview" inkscape:groupmode="layer"> + <use inkscape:tile-cx="50" inkscape:tile-cy="50" inkscape:tile-w="100" inkscape:tile-h="100" inkscape:tile-x0="100" inkscape:tile-y0="100" height="100" width="100" id="patternGenerator" xlink:href="#patternResult" y="0" x="0" /> + </g> + <g style="display:inline" inkscape:label="Helpers" id="helperLayer" inkscape:groupmode="layer" sodipodi:insensitive="true"> + <text xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.5752773px;line-height:100%;font-family:Aller;-inkscape-font-specification:Aller;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none" x="-0.80258638" y="-239.81018" id="text7690" sodipodi:linespacing="100%"><tspan sodipodi:role="line" id="tspan7692" x="-0.80258638" y="-239.81018">Background</tspan><tspan id="tspan7314" sodipodi:role="line" x="-0.80258638" y="-220.23491">color</tspan></text> + <text xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.5752773px;line-height:100%;font-family:Aller;-inkscape-font-specification:Aller;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none" x="-1.0266666" y="-29.433338" id="text7694" sodipodi:linespacing="100%"><tspan sodipodi:role="line" id="tspan7696" x="-1.0266666" y="-29.433338">Seamless Pattern</tspan><tspan sodipodi:role="line" x="-1.0266666" y="-13.651999" id="tspan9089" style="font-size:14.666667px">Export as page</tspan></text> + <text sodipodi:linespacing="100%" id="text9148" y="137.06241" x="-0.46967512" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.4925261px;line-height:100%;font-family:Aller;-inkscape-font-specification:Aller;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none" xml:space="preserve"><tspan y="137.06241" x="-0.46967512" id="agsdgsdf445" sodipodi:role="line"><tspan id="tspan13100" style="font-size:15.6558371px">PREVIEW</tspan> -export as multiple of tile size <tspan id="infoText" style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.0902538px;font-family:Aller;-inkscape-font-specification:'Aller Bold'">100x100xROWSxCOLS in px </tspan></tspan><tspan style="font-size:18.7870045px" id="tspan9151" y="155.13837" x="-0.46967512" sodipodi:role="line">Tile it with tiled clones <tspan id="tspan13102" style="font-size:10.1762943px">(edit->clones->tiled clones)</tspan></tspan><tspan style="font-size:18.7870045px" y="173.92537" x="-0.46967512" sodipodi:role="line" id="tspan8868">Or use as pattern. <tspan style="font-size:13.333333px" id="tspan8870">You can copy full patern -grey block- to use on other documents</tspan></tspan></text> + <path inkscape:connector-curvature="0" id="rect11241" d="M 200,-200 200,100 500,100 500,-200 200,-200 Z M 300,-100 400,-100 400,0 300,0 300,-100 Z" style="color:#000000;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.774;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#f0f0f0;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1, 1;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> + <text sodipodi:linespacing="100%" id="text12728" y="-219.74884" x="201.39197" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.5752773px;line-height:100%;font-family:Aller;-inkscape-font-specification:Aller;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none" xml:space="preserve"><tspan y="-219.74884" x="201.39197" sodipodi:role="line" id="tspan12732">Draw inside</tspan></text> + <path inkscape:connector-curvature="0" id="path12736" d="M 45.27282,178.2315 45.27282,186.8525" style="color:#000000;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-end:url(#TriangleOutL);paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" sodipodi:nodetypes="cc" /> + <flowRoot style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:1.25px;line-height:125%;font-family:Verdana;-inkscape-font-specification:Verdana;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" id="flowRoot13104" xml:space="preserve"><flowRegion id="flowRegion13106"><rect y="261.8042" x="-5.004253" height="3.336169" width="10.00851" id="rect13108" /></flowRegion><flowPara id="flowPara13110" /></flowRoot> <text xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:19.5752773px;line-height:100%;font-family:Aller;-inkscape-font-specification:Aller;text-align:start;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none" x="499.40088" y="-223.54277" id="text19137" sodipodi:linespacing="100%"><tspan id="tspan19139" sodipodi:role="line" x="499.40088" y="-223.54277">3x3 Simple translation example</tspan></text> + <text xml:space="preserve" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:73.0882874px;line-height:125%;font-family:Verdana;-inkscape-font-specification:Verdana;letter-spacing:0px;word-spacing:0px;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" x="39.264565" y="-321.01724" id="text8864" sodipodi:linespacing="125%"><tspan sodipodi:role="line" id="tspan8866" x="39.264565" y="-321.01724">SEAMLESS PATTERN</tspan></text> + </g> + <g inkscape:groupmode="layer" id="PreviewSample" inkscape:label="Preview Sample" sodipodi:insensitive="true"> + <use style="display:inline" x="0" y="0" xlink:href="#patternGenerator" id="sampleTile" transform="translate(600,-100)" width="100%" height="100%" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" id="samplePattern1" width="100%" height="100%" transform="translate(-100,-100)" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" transform="translate(0,-100)" id="samplePattern2" width="100%" height="100%" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" transform="translate(100,-100)" id="samplePattern3" width="100%" height="100%" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" transform="translate(-100,0)" id="samplePattern4" width="100%" height="100%" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" id="samplePattern5" width="100%" height="100%" transform="translate(0,0)" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" transform="translate(100,0)" id="samplePattern6" width="100%" height="100%" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" transform="translate(-100,100)" id="samplePattern7" width="100%" height="100%" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" transform="translate(0,100)" id="samplePattern8" width="100%" height="100%" /> + <use style="display:inline" x="0" y="0" xlink:href="#sampleTile" transform="translate(100,100)" id="samplePattern9" width="100%" height="100%" /> + </g> + </g> + </g> +</svg> diff --git a/share/extensions/seamless_pattern_procedural.inx b/share/extensions/seamless_pattern_procedural.inx new file mode 100644 index 000000000..8f11d5746 --- /dev/null +++ b/share/extensions/seamless_pattern_procedural.inx @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"> + <_name>Seamless Pattern Procedural</_name> + <id>org.inkscape.render.seamless_pattern_procedural</id> + <dependency type="executable" location="extensions">seamless_pattern.py</dependency> + <dependency type="executable" location="extensions">inkex.py</dependency> + + <param name="width" _gui-text="Custom Width (px.):" type="int" min="1" max="99999999">100</param> + <param name="height" _gui-text="Custom Height (px.):" type="int" min="1" max="99999999">100</param> + + <effect needs-live-preview="false"> + <object-type>all</object-type> + <effects-menu hidden="true" /> + </effect> + <inkscape:_templateinfo> + <inkscape:_name>Seamless Pattern</inkscape:_name> + <inkscape:author>Jabiertxof</inkscape:author> + <inkscape:_shortdesc>Create seamless patterns.</inkscape:_shortdesc> + <inkscape:date>2014-10-16</inkscape:date> + <inkscape:_keywords>seamless_patterns</inkscape:_keywords> + </inkscape:_templateinfo> + <script> + <command reldir="extensions" interpreter="python">seamless_pattern.py</command> + </script> +</inkscape-extension> |
