On Tue, 2014-02-25 at 19:17 +0100, Krzysztof Kosiński wrote:
Hello
As promised, here is a description of the project I could do as a student.
The end goal of my MSc project is to write an OpenGL-based 2D scene graph library usable by Inkscape which is capable of displaying most of SVG. Unlike the Cairo OpenGL backend, this library would keep the data on the GPU as long as it's used, and only control points of the curves would be submitted to the GPU, which should give very good performance.
However, this project has several prerequisites. The OpenGL drawing algorithm I'm thinking about (Loop-Blinn) handles only quadratic and cubic Bezier fills, so it would require substantial support from 2Geom to render SVG. http://http.developer.nvidia.com/GPUGems3/gpugems3_ch25.html
For this GSoC, my proposal would be to implement boolean operations and the stroke-to-fill transformation in 2Geom (since I think the latter depends on the former). Some of the required code is already present, for example the code to compute the offset of a single curve, but it's not exposed in an usable form. The project would be both about implementing the missing parts and providing an easy to use API.
Here are the potential work-items:
- Convert Geom::PathVector to a real class.
- Investigate whether it is possible to store curve data in a more
efficient format that does not store every curve endpoint point twice (as a start point and as an end point). 3. Provide and document an API to the existing intersection code. 4. Provide and document an API to the existing curve offset code. 5. Implement path uncrossing and monotonization. 6. Implement boolean operations, based on the algorithm used in CGAL. If necessary, add CGAL as a dependency - this is now acceptable, because CGAL in Debian no longer depends on Qt. 7. Implement stroke-to-path.
This looks like a great project!
Two comments:
It would be nice if one could do boolean operations with paths with arcs and not have them turn into Beziers. It looks like CGAL supports this.
It would also be nice to be able to support CSS3 3d transforms (which already have some browser support for SVG), just as shown in the example in section 25.7 of the Nvidia GPUGems you referenced.
Tav