Skip to content

Conversation

@fallible-algebra
Copy link
Contributor

Explanation for the 2d shapes example, taken from the original HackMD document and edited a bit.

This example is a strange one, it's eye-catching mostly because it's the first example (at time of writing) in the examples page. That being said, the example does a decent amount of teaching utility to it: we can explain the bevy math-shape to mesh pipeline, which illuminates a way of transforming one form of data (abstract, mathematical shape descriptions) into another (meshes) which may be novel or inspirational to some users.

@greeble-dev greeble-dev added C-Docs An addition or correction to our documentation A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels May 16, 2025
//!
//! Thankfully, we can add shape primitives directly to `Assets<Mesh>` because `Mesh` implements `From` for shape primitives and `Assets<T>::add` can be given any value that can be "turned into" `T`!
//!
//! We apply a material to the shape by first making a `Color` then calling `Assets<ColorMaterial>::add` with that color as its argument, which will create a material from that color through the same process `Assets<Mesh>::add` can take a shape primitive.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could these inline code snippets be intra-link doc comments ? That would ensure we don't forget updating them if they change somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

Copy link
Member

@ThierryBerger ThierryBerger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving, but doc links would be neat if possible :)

@fallible-algebra
Copy link
Contributor Author

fallible-algebra commented May 17, 2025

I'm approving, but doc links would be neat if possible :)

I'll get on that! We might need an eye for some further post-processing than what we already do with the docs extraction. As it stands, examples like fixed timestep have to hard-link docs to not appear as "[SomeType]" in the docs, I think?

@fallible-algebra
Copy link
Contributor Author

I'm a bit concerned about the possibility intra-docs will cause too much friction for people doing breaking API changes, as example docs are intended to be discarded if things are too catastrophic wrong and not supposed to get in the way overall. For now, I'll be avoiding them on my examples until there's some more clarity.

@fallible-algebra fallible-algebra marked this pull request as ready for review May 17, 2025 10:44
@ThierryBerger ThierryBerger added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels May 18, 2025
Co-authored-by: theotherphil <phil.j.ellison@gmail.com>
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the tone and target audience: nice stuff!

@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 26, 2025
Merged via the queue into bevyengine:main with commit cedf8d3 May 26, 2025
32 checks passed
@fallible-algebra fallible-algebra deleted the example/2d-shapes branch June 23, 2025 10:00
github-merge-queue bot pushed a commit that referenced this pull request Jul 7, 2025
[Explanation](https://bevyengine.org/learn/contribute/helping-out/explaining-examples/)
for the 3d shapes example.

This shares a lot of detail with the [2d
shapes](#19211) example, so it's
similar in structure. The explanation for why asset handles are not
components has been copied over for now with minor adjustment, I'll do
another editing pass on this to make it match the surrounding context
and focus before taking it out of drafts.

---------

Co-authored-by: theotherphil <phil.j.ellison@gmail.com>
Co-authored-by: Carter Weinberg <weinbergcarter@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Docs An addition or correction to our documentation C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants