p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Adding an option of polygon under the 2d Primitives.

Open Vedant1816 opened this issue 10 months ago • 4 comments

Increasing access

Image Currently under the 2d Primitives there is no option for a polygon. I believe that adding the option to draw a polygon would definitely be useful to the users(especially the beginners) and is one of the basic 2d figures, so the correct place to add would be under the primitives.

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!

Vedant1816 avatar Jan 13 '26 14:01 Vedant1816

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!

welcome[bot] avatar Jan 13 '26 14:01 welcome[bot]

I had already thought of it. Can I work on this ?

Om-A-osc avatar Jan 18 '26 05:01 Om-A-osc

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.

Divyansh013 avatar Jan 24 '26 16:01 Divyansh013

@Vedant1816 Does that resolve your issue or was there anything else you were expecting?

Nishthajain7 avatar Mar 22 '26 09:03 Nishthajain7