Adding an option of polygon under the 2d Primitives.
Increasing access
Most appropriate sub-area of p5.js?
- [ ] Accessibility
- [ ] Color
- [x] Core/Environment/Rendering
- [ ] Data
- [ ] DOM
- [ ] Events
- [ ] Image
- [ ] IO
- [ ] Math
- [ ] Typography
- [ ] Utilities
- [ ] WebGL
- [ ] Build process
- [ ] Unit testing
- [ ] Internationalization
- [ ] Friendly errors
- [ ] Other (specify if possible)
Feature request details
I am thinking on adding a feature of polygon under the 2d primitives section. Would it be a useful change? If yes then I would absolutely love to work on the same. Looking forward towards discussion!
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms.
For guidance on contributing, check out our contributing guidelines and other resources for contributors. 💬 If you have questions or need support, feel free to join the Processing Foundation Forum or visit our Community page. 📜 Please also review our Code of Conduct to understand our community standards. Thank You!
I had already thought of it. Can I work on this ?
p5.js already supports drawing arbitrary shapes with existing functions like beginShape(), vertex(), and endShape(). You can make any polygon you want using these.This covers triangles, squares, pentagons, or any custom shape without adding new API.A dedicated polygon() function might just wrap a loop around beginShape() internally.
@Vedant1816 Does that resolve your issue or was there anything else you were expecting?