Skip to content

Update docs for custom shapes and related features #7734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: dev-2.0
Choose a base branch
from

Conversation

GregStanton
Copy link
Collaborator

@GregStanton GregStanton commented Apr 14, 2025

Issues

Addresses #6560
Addresses #6766

Pull requests

Changes

This PR updates docs for user-facing changes to custom shapes and related features.

Custom shapes:

  • Move vertex.js into custom_shapes.js
  • Update vertex() docs
    • New signature x, y, u, v
    • There's an example of this in ref page for texture(), but not yet documented on ref page for vertex()
    • relevant PR: #7373
  • Document bezierOrder()
    • Might update examples in quadraticVertex() and move them here
    • relevant PR: #7373
    • relevant issue: #6766
  • Update bezierVertex() docs
    • located in custom_shapes.js (after removal of vertex.js)
    • new x, y, u, v and x, y, z, u, v signatures
    • maybe just show default usage, link to docs for bezierOrder()?
    • relevant PRs: #7373, #7600
    • relevant Issues: #6560, #6766
  • Remove quadraticVertex() docs (if needed)
    - relevant PRs: #7373, 7600
    - relevant Issue: #6766
  • Document splineVertex()
  • Remove curveVertex() (it's already supported by the 1.x compatibility add-on for shapes)
  • Review vertexProperty() docs
    • located in custom_shapes.js (after removal of vertex.js)
    • relevant PR: #7276
  • Document splineProperty()
    • might start from existing docs for vertexProperty(), curveTightness()
    • relevant PR: #7471
    • relevant Issue #6766
  • Document splineProperties()
  • Update beginShape() docs
    • remove reference to quadraticVertex()
    • PATH is the new name for the default shape kind
    • composite paths can now be made from mixed vertex types
    • relevant PR: #7373
  • Update beginContour() docs
    • contours are now general subshapes, essentially
    • they can now be created with a kind parameter, just like shapes.
    • PATH is the default kind.
    • composite shapes can be made from mixed contour types
    • Mixing contour kinds might not work in WebGL yet
    • relevant PR: #7373
  • Document new endShape/Contour(CLOSE) behavior for splines
    • splines now close smoothly (may just want to mention this and link to splineVertex()?)
    • relevant PRs: #7373, #7583, #7601
    • relevant issues: #6560, #6766
  • Update endContour(CLOSE) docs
    • see custom_shapes.js
    • Contours are now open by default (default is OPEN)
    • relevant PRs: #7373
    • relevant issues: #6560, #6766
      Curves:
  • Update curve() docs to reflect name change to spline() (if needed)
  • Remove curveTightness() docs if needed
  • Update curvePoint() docs to reflect name change to splinePoint() (if needed)
  • Update curveTangent() docs to reflect name change to splineTangent() (if needed)
  • Update curveDetail() docs, possibly incorporating adapted examples from bezierDetail() docs
    • Replaces count with density, so that it works more generally (including for custom shapes, I think?)
    • See visitors for Béziers and splines in custom_shapes.js
    • Note that the user-facing function is currently located in 3d_primitives.js (it should be moved to curves.js)
    • relevant PR: #7373
  • Remove bezierDetail() docs (if needed)

3D:

  • remove beginGeometry()/endGeometry() docs (if needed)
    • Removed from 3d_primitives.js, in favor of buildGeometry().
    • Summary from the PR: "Removing beginGeometry()/endGeometry() eliminates an inconsistency with beginShape()/endShape(), reduces the size of the user-facing API, and prevents confusion (endGeometry() is effectively used as a constructor, in contrast with how objects are usually created in p5)."
    • relevant PR: #7373

Notes

  • Except where noted above, reference dependencies1 can be updated in a separate PR.
  • A simple change to behavior of endShape(CLOSE) for Bézier curves was discussed; decided we can implement this for 2.0

Screenshots

[Reminder] Might be helpful to provide screenshots of top-level listings from main reference page.

PR Checklist

Footnotes

  1. Here, reference dependency refers to a reference page that depends on one of the new or changed features mentioned under the Changes section, either because it mentions it or because it uses it in a code example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant