Skip to content
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

Custom primitives example #13795

Merged
merged 5 commits into from
Jun 10, 2024

Conversation

lynn-lumen
Copy link
Contributor

Objective

  • Add a new example showcasing how to add custom primitives and what you can do with them.

Solution

  • Added a new example custom_primitives with a 2D heart shape primitive highlighting
    • Bounded2d by implementing and visualising bounding shapes,
    • Measured2d by implementing it,
    • Meshable to show the shape on the screen
  • The example also includes an Extrusion<Heart> implementing
    • Measured3d,
    • Bounded3d using the BoundedExtrusion trait and
    • meshing using the Extrudable trait.

Additional information

Here are two images of the heart and its extrusion:
image_2024-06-10_194631194
Screenshot 2024-06-10 194609

@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 10, 2024
@alice-i-cecile alice-i-cecile added C-Examples An addition or correction to our examples A-Math Fundamental domain-agnostic mathematical operations S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 10, 2024
@alice-i-cecile alice-i-cecile removed this from the 0.14 milestone Jun 10, 2024
Copy link
Contributor

@HackerFoo HackerFoo left a comment

Choose a reason for hiding this comment

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

Other than tweaking the shape a bit, it looks good.

examples/math/custom_primitives.rs Show resolved Hide resolved
examples/math/custom_primitives.rs Outdated Show resolved Hide resolved
examples/math/custom_primitives.rs Outdated Show resolved Hide resolved
examples/math/custom_primitives.rs Outdated Show resolved Hide resolved
Co-authored-by: Jakub Marcowski <37378746+Chubercik@users.noreply.github.com>
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 10, 2024
@alice-i-cecile alice-i-cecile 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-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 10, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 10, 2024
Merged via the queue into bevyengine:main with commit c172c3c Jun 10, 2024
32 checks passed
mockersf pushed a commit that referenced this pull request Jun 11, 2024
# Objective

- Add a new example showcasing how to add custom primitives and what you
can do with them.

## Solution

- Added a new example `custom_primitives` with a 2D heart shape
primitive highlighting
  - `Bounded2d` by implementing and visualising bounding shapes,
  - `Measured2d` by implementing it,
  - `Meshable` to show the shape on the screen
- The example also includes an `Extrusion<Heart>` implementing
  - `Measured3d`,
  - `Bounded3d` using the `BoundedExtrusion` trait and
  - meshing using the `Extrudable` trait.

## Additional information

Here are two images of the heart and its extrusion:

![image_2024-06-10_194631194](https://github.com/bevyengine/bevy/assets/62256001/53f1836c-df74-4ba6-85e9-fabdafa94c66)
![Screenshot 2024-06-10
194609](https://github.com/bevyengine/bevy/assets/62256001/b1630e71-6e94-4293-b7b5-da8d9cc98faf)

---------

Co-authored-by: Jakub Marcowski <37378746+Chubercik@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Math Fundamental domain-agnostic mathematical operations C-Examples An addition or correction to our 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
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants