Menu

Render to 2D vectors (Cairo)

2008-09-24
2013-05-28
  • Stuart Axon

    Stuart Axon - 2008-09-24

    I wonder how difficult it would be to render to the 2d library cairo, it would open up lots of possibilities.  For instance shoebot, (a python implementation of nodebox) uses cairo, and has integration with inkscape.

    If the 3d could be rendered to 2d vectors using cairo, and a library was provided then integrating structure synth into shoebot would be very simple @ that point we get to use structure synth to generater graphics straight into a 2d graphics program.

    (if an early version just put bitmaps into cairo, the above would be possibly too, it'd be pretty nice, but not as nice as putting the vectors in).

     
    • Stuart Axon

      Stuart Axon - 2008-09-24

      Update:  Have contacted the cairo mailing list
      http://lists.cairographics.org/archives/cairo/2008-September/015153.html

      Who pointed me at gl2ps which converts opengl to postscript, svg and others.

      Also made some initial contact with the author of of pantograph, which renders 3d from blender into svg using cairo - asking about making pantograph standalone.

       
    • Mikael Hvidtfeldt Christensen

      Hi,

      It is not that difficult to output the drawing primitives to 2D (since you can get the projection matrix from OpenGL), but the big problem is the depth-sorting, where OpenGL relies on a z-buffer, which restricts the output resolution to that of the framebuffer.

      Properly handling these things without a z-buffer requires some funky stuff like cutting up drawing primitives (two of the links you provided uses a simple painter algorithm, which will not produce very good images. Gl2PS seems more sophisticated, though).

      But why try to produce 2D vector graphics? I do not believe the picture quality will better than the bitmaps? I think the way to go for high-resolution images are by ray-tracing at large resolutions.

      But of course, if anyone wants to try to implement some of the above stuff, just contact me. New developers are always welcome :-).

      Regards, Mikael.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.