-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
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
ShapePrimitivefor arcs and ellipses - Updating the
PrimitiveToPath2DVisitorto be able to convert those new primitives back into path drawing commands - Also updating the
PrimitiveToVerticesVisitorto 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