How to effecient generate an array of objects in svg file
Hi,
Suppose, I want to generate an array of dots. Is there any loop structure in SVG that I can use instead of input all the code below the email manually?
Thanks, Peng
<circle cx="50" cy="50" r="2" /> <circle cx="50" cy="150" r="2" /> ... <circle cx="50" cy="550" r="2" />
...
<circle cx="550" cy="50" r="2" /> <circle cx="550" cy="150" r="2" /> ... <circle cx="550" cy="550" r="2" />
there isnt a scripting language built into inkscape yet that you can do this with, but you can generate the array pretty easily. I just made a 10 x 10 grid with 50 px spacing in about 2 minutes. the way i did it was to make one dot with the circle tool (incidentally the circle tool in inkscape wont generate <circle> tags, it uses paths if thats a problem you might want to write a script to generate it in perl or whatever) I then used the tile clones to make a 10x10 grid, not worrying about the spacing as with a 2px radius circle setting a 50px spacing using %ages of tile widths isn't doable. I unlinked the clones, then used the grid arrange dialog to put them in a 10 x 10 grid with the desired spacing. You dont have to unlink them, if you dont you can change all of thems style/size etc at once, if you do they are individually editable. Do whichever is more appropriate for you needs
Cheers
Sim
On 9/8/06, Peng Yu <pengyu.ut@...155...> wrote:
Hi,
Suppose, I want to generate an array of dots. Is there any loop structure in SVG that I can use instead of input all the code below the email manually?
Thanks, Peng
<circle cx="50" cy="50" r="2" /> <circle cx="50" cy="150" r="2" /> ... <circle cx="50" cy="550" r="2" />
...
<circle cx="550" cy="50" r="2" /> <circle cx="550" cy="150" r="2" /> ... <circle cx="550" cy="550" r="2" />
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&da... _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
On Fri, Sep 08, 2006 at 04:20:36PM -0500, Peng Yu wrote:
Hi,
Suppose, I want to generate an array of dots. Is there any loop structure in SVG that I can use instead of input all the code below the email manually?
SVG doesn't do scripting, but as it is part of the grand combine, you can use Javascript to generate SVG. I do quite a bit of programattically generated SVG for my work, but we tend to use C++ or Python for that work, dumping a file that looks similar to the example. The benefit of that over the Javascript version is that you can preview the file in your file manager on Linux, or in Inkscape/GIMP.
On Fri, 8 Sep 2006, Peng Yu wrote:
Date: Fri, 8 Sep 2006 16:20:36 -0500 From: Peng Yu <pengyu.ut@...155...> Reply-To: Inkscape User Community inkscape-user@lists.sourceforge.net To: Inkscape User Community inkscape-user@lists.sourceforge.net Subject: [Inkscape-user] How to effecient generate an array of objects in svg file
Hi,
Suppose, I want to generate an array of dots. Is there any loop
You could use Symbols/Clones to do this in a time efficient manner but just to be clear it will not produce terse markup.
You might be better off using one of the existing dot patterns I created (and your use of the circle markup suggests you might already be trying to do that sicne it is not something inkscape inlcudes) http://www.openclipart.org/cgi-bin/navigate/special/patterns?page=3
Sincerely
Alan Horkan
Inkscape http://inkscape.org Abiword http://www.abisource.com Open Clip Art http://OpenClipArt.org
Alan's Diary http://advogato.org/person/AlanHorkan/
participants (4)
-
Alan Horkan
-
Jeffrey Brent McBeth
-
john cliff
-
Peng Yu