PDF exporting ellipses with lots of little lines

Hi everyone, I'm designing this 3D animated logo with processing. The logo is composed by ellipses and when exporting it to PDF the ellipses turn into millions of little lines, making it impossible to edit on illustrator or sketch.

Do you know a way of working this out?

Here is my code:

import java.util.*;
import processing.pdf.*;

float angle = 0;
float t = 0;
float offset;
ArrayList <Ellipse> circles;
PFont f; 
boolean record;

int maxCircles = 100;
float spacing(int index, int maxCircles) {
  float halfMaxCircles = maxCircles / 2.0;
  return - (float)Math.pow((index - halfMaxCircles)/halfMaxCircles, 2) + 1.01;
}


void setup() {
  size(700, 700, P3D);
  textMode(SHAPE);
  background(255);
  frameRate(60);
  noFill();
  offset = random(0.004, 0.01);
  smooth();
  f = createFont("Industry Bold.ttf",80,true);
}


class Ellipse {
  float angle;

  Ellipse (float angle) {
    this.angle = angle;
  }

  void draw () {
    translate ((width/2), height/2);
    rotateX(this.angle);
    rotateY(this.angle * noise(offset + t));
    rotateZ(t * t);
    strokeWeight(1);
    stroke(64, 90, 107);
    ellipse (0,0,160,160);
  }
}


void draw() {
  if (record) {
    beginRaw(PDF, "output-####.pdf");
  } 

  background(255);

  circles = new ArrayList <Ellipse> ();
  for (int i=0; i<maxCircles; i++){
    circles.add(0, new Ellipse(angle + 1.3*(spacing(i, maxCircles))));
  }

  for (Ellipse e: circles) {
    pushMatrix();
    e.draw();
    popMatrix();
  }

  fill(44, 181, 245);
  textFont(f, 80);
  textAlign(CENTER);
  text("U", (width/2), (height/2)+35);
  noFill();

  //saveFrame("shots/shot-####.png"); 
  if (record) {
    endRaw();
    record = false;
  }

  angle += 0.03;
  t += 0.002;
}


void keyPressed() {
  if (key == 'r') {
    record = true;
  }
}

Answers

  • when exporting it to PDF the ellipses turn into millions of little lines

    This is observed using illustrator? Below is what I get when I open the PDF using a PDF viewer, which reflects what is drawn by Processing.

    Kf

    Screenshot (8790)

  • yes, it looks elliptical, but the source will be lots of lines.

    i wonder what the original poster expected...

    have you tried createShape with ELLIPSE? it'll probably do the same thing but it might put all the lines in a group which might be easier to edit. or maybe you can create your own groups using createShape(GROUP)

    https://processing.org/reference/createShape_.html

  • The problem is all the little lines processing is using to draw the ellipses. The PDF gets huge and impossible to edit on illustrator.

  • I'll try the createShape, thanks :)

Sign In or Register to comment.