Most appropriate sub-area of p5.js?
p5.js version
2.x
Web browser and version
All
Operating system
All
Steps to reproduce this
Not exactly a bug, but, in debugging #7903, we noticed that while some drawing functions end up going through our internal p5.Shape representation, others manually apply drawing commands like ctx.ellipse(centerX, centerY, radiusX, radiusY, 0, 0, 2 * Math.PI). This works for now, but:
- we have more code paths to consider when we need to make changes to rendering, and more to maintain
- in the future, if we want to be able to expose p5.Shape to users (e.g. via a future
loadSVG() function), we won't have primitives ready to turn those shape components into
It would be great if we could add support for those primitives in p5.Shape, which involves:
- Making a subclass of
ShapePrimitive for arcs and ellipses
- Updating the
PrimitiveToPath2DVisitor to be able to convert those new primitives back into path drawing commands
- Also updating the
PrimitiveToVerticesVisitor to be able to convert those to vertices in WebGL
- Updating the code that renders arcs and ellipses to now use p5.Shape instead of manually issuing drawing commands
Most appropriate sub-area of p5.js?
p5.js version
2.x
Web browser and version
All
Operating system
All
Steps to reproduce this
Not exactly a bug, but, in debugging #7903, we noticed that while some drawing functions end up going through our internal p5.Shape representation, others manually apply drawing commands like
ctx.ellipse(centerX, centerY, radiusX, radiusY, 0, 0, 2 * Math.PI). This works for now, but:loadSVG()function), we won't have primitives ready to turn those shape components intoIt would be great if we could add support for those primitives in p5.Shape, which involves:
ShapePrimitivefor arcs and ellipsesPrimitiveToPath2DVisitorto be able to convert those new primitives back into path drawing commandsPrimitiveToVerticesVisitorto be able to convert those to vertices in WebGL