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 & HelpSyntax Questions › line()s in PDF have rounded corners no matter what
Page Index Toggle Pages: 1
line()s in PDF have rounded corners no matter what (Read 645 times)
line()s in PDF have rounded corners no matter what
Aug 24th, 2009, 6:33pm
 
Hello,

I've exported a chart to PDF and it looks ok except for lines drawn using the line() function. No matter what I tried, I couldn't get a nice sharp cap at the ends. I ended up using strokeCap(PROJECT) and noSmooth() and still they look rounded.

What am I doing wrong? I'm thinking of using very thin rect()s if I can't figure it out, but I know it's gonna bug me.
Re: line()s in PDF have rounded corners no matter what
Reply #1 - Aug 24th, 2009, 7:31pm
 
Works fine here.
just test this :

import processing.pdf.*;

void setup() {
 size(400, 400);
 noLoop();
 beginRecord(PDF, "filename.pdf");

}

void draw() {
 strokeWeight(10);
 line(150,150, width/2, height);
 strokeCap(SQUARE);
 line(100,100, width/2, height);

 endRecord();
}

if not, update to the latest processing version and try again.

Re: line()s in PDF have rounded corners no matter what
Reply #2 - Aug 25th, 2009, 11:06am
 
Thanks Cedric! What I ended up doing was removing the strokeCap(PROJECT) in the setup() block and instead sticking a strokeCap(PROJECT) at the start of each function that involves drawing a line.
Re: line()s in PDF have rounded corners no matter what
Reply #3 - Aug 25th, 2009, 11:15am
 
maybe that was your problem. it has to be called after beginRecord
Page Index Toggle Pages: 1