Loading...
Logo
Processing Forum
Hi
 
I've been building a sketch with the OpenGL library.  I've added a button on the sketch to output a PDF image of what's on the screen (using the PDF library and the beginRaw/endRaw facility).  It works  okay but I've found that if I'm drawing polygons with beginShape() ...vertex()...endShape(CLOSE) etc. and I fill those polygons with some colour that has some arbitrary value of alpha (i.e. not 0 or 255) then very fine straight dark lines appear in the filled polygons on the PDF output but not on the screen. 
 
Can anyone advise how I might eliminate those lines?
 
You can see an example in the map of North America below that I've built from polygons (fyi, I've used map data from naturalearthdata.com)
 
Many thanks
 
 

Replies(2)

Yeah, those are triangles.

From: http://processing.org/reference/libraries/pdf/index.html
To create vectors from 3D data, use the beginRaw() and endRaw() commands. These commands will grab the shape data just before it is rendered to the screen. At this stage, your entire scene is nothing but a long list of lines and triangles. This means that a shape created with sphere() method will be made up of hundreds of triangles, rather than a single object.
In another post ( http://forum.processing.org/topic/graph-inside-circle-ellipse) we also talked about this. And I believe we tried an alternative using beginRecord-endRecord in combination with PGraphicsPDF that provided better results. Perhaps this method can help you achieve what you want.
This works beautifully and gives me the pdf file that I need but it throws up an error to the console:
 
isRecording(), or this particular variation of it, is not available with this renderer.
 
It doesn't seem to halt a sketch when run from PDE but an exported application version of the sketch freezes (I'm using Windows 7) which I assume is a consequence of this error.