Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SVG data can also be used in processing, but note that some SVG files may not be supported by processing. Processing can only handle simple SVG graphics, so avoid using radial gradients or complex clipping masks. You can however extend the SVG capabilities of processing using the geomerative library http://www.ricardmarxer.com/geomerative/

When exporting SVGs from illustrator, the following settings should produce working results. This does however depend on your version of illustrator. 

Image Added


Code Block
PShape elShape;
PShape warningShape;
float  rotAngle = 0.0;
 
void setup()
{
  size(600,600);      // def. window size
 
  // Load the svg file
  elShape       = loadShape("High_voltage_warning.svg");
  warningShape  = loadShape("Achtung.svg");
  shapeMode(CENTER);    // the zero point of the SVG object is in the middle
  smooth();
}
 
void draw()
{
  background(255);
 
  pushMatrix();
    translate(width *.5,height *.5);
    rotate(rotAngle);
    shape(elShape,0,0,200,200);
  popMatrix();
  rotAngle+=.01;
 
  shape(warningShape,mouseX,mouseY,100,100);
}

...