cosmic
cosmic copied to clipboard
Vector Graphics
Currently Cosmic relies on lyon a rust dependency to convert paths/polygons to triangles. The plan is to drop this dependency and to create our own tessellator from scratch. The implementation will use similar techniques to lyon with the main focus of doing triangulation all in one pass for complex polygons.
This ticket will track the progress of that. Things to implement:
- [x] One pass tessellator for any polygon. Output as gpu triangle data.
- [x] Self intersecting polygons.
- [x] Evenodd fill rule.
- [ ] Nonzero fill rule.
- [ ] Explicit holes. Depends on nonzero fill rule.
- [x] Adding child polygons.
- [x] Flatten curves (quadratic, cubic bezier) to polygons.
- [x] Curve strokes.
- [x] Line strokes.
- [x] SVG fill partial support.
- [ ] SVG stroke partial support.
Future:
- Line joins
Note the ones that have been marked complete indicates the main algorithms have been implemented but there still needs to be extensive testing since triangulation can have lots of edge cases.