Add drawStar() function to draw customizable star shapes#7816
Open
XTC917 wants to merge 1 commit intoprocessing:mainfrom
Open
Add drawStar() function to draw customizable star shapes#7816XTC917 wants to merge 1 commit intoprocessing:mainfrom
XTC917 wants to merge 1 commit intoprocessing:mainfrom
Conversation
|
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page! |
Collaborator
|
Hi, really sorry for the delay in review and really thanks for your work. Is your feature related to any issue? If not, it would be great to open up an issue and let the community discuss if we really want this feature or we have any alternatives? Does that sounds okay? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
star(x, y, radius1, radius2, npoints)top5.prototypeinsrc/core/shape/2d_primitives.js.test-star.htmlandtest-star-interactive.htmlto illustrate basic and interactive usage.Description:
I found that the project didn’t have a clearly documented or easily accessible star-drawing function, so I contributed
p5.prototype.star, located around line 1490-1517 insrc/core/shape/2d_primitives.js.Implementation details:
x,y— center position of the starradius1— outer radiusradius2— inner radiusnpoints— number of star points (default 5)beginShape().radius1andradius2.endShape(CLOSE)to complete the star.This function enhances the creative capabilities of p5.js, especially for users working in visual arts and design.
Screenshots of the change:
(Add screenshots here if available, e.g. result of test-star.html)
PR Checklist
npm run lintpasses