We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › geomerative - load and draw svg file
Page Index Toggle Pages: 1
geomerative - load and draw svg file (Read 838 times)
geomerative - load and draw svg file
Jun 8th, 2008, 2:55pm
 
Hi, I am trying to use geomerative to draw an svg file..
Unfortunately I couldn't find any example of how to do this, so I am trying to guess.. but no results yet...

Hers's my code:
Quote:


import geomerative.*;
RSVG prova;

void setup()
{
size(400,400);
prova=new RSVG(this);
}


void draw()
{

        prova.draw("prova1.svg",g);
       
}




And here's my svg:
Quote:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
  xmlns:svg="http://www.w3.org/2000/svg"
  xmlns="http://www.w3.org/2000/svg"
  version="1.0"
  width="64"
  height="64"
  id="svg2158">
 <defs
    id="defs2160" />
 <g
    id="layer1">
   <rect
      width="24"
      height="19.181818"
      x="19.09091"
      y="19"
      style="fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-lin
ecap:butt;stroke-linejoin:miter;stroke-opacity:1"
      id="rect2166" />
 </g>
</svg>



Anybody have a hint on how to do this? (The reasing I am not using the candy lib is that I wanted to use geomerative functions for shape and polygon conversion)

TIA
sergio
Re: geomerative - load and draw svg file
Reply #1 - Jun 9th, 2008, 8:56am
 
use the latest version:
http://ricardmarxer.com/geomerative/


Code:

import geomerative.*;

RSVG svg;

void setup()
{
size(400,400);
frameRate( 5 );

RGeomerative.init(this);

svg = new RSVG( );
}

void draw()
{
background(255);

svg.draw("prova1.svg");
}


F
Re: geomerative - load and draw svg file
Reply #2 - Jun 12th, 2008, 1:19am
 
Works great.. Thank you very much
sergio
Page Index Toggle Pages: 1