Merged
Conversation
mweatherley
suggested changes
May 23, 2024
Contributor
mweatherley
left a comment
There was a problem hiding this comment.
I like this quite a lot! Mostly I just want more documentation (both user-facing and internal) about how the process is expected to work.
Specifically:
- I think the
MeshBuilderconstraint is reasonable, and adding it to everything should be fine (if anything, I think making these uniform is good). - I think that encoding the perimeter of two-dimensional meshes in a trait on the builder seems like the right approach.
- I think that the way that flat and interpolated normals are computed seems quite reasonable.
The only things I'm kind of iffy about are the way that UVs are constructed (not a big deal anyhow) and the reimplementations of resolution on extruded builders.
Co-authored-by: Matty <weatherleymatthew@gmail.com>
mweatherley
approved these changes
May 24, 2024
mweatherley
reviewed
May 27, 2024
Co-Authored-By: Matty <2975848+mweatherley@users.noreply.github.com>
alice-i-cecile
approved these changes
Jun 4, 2024
Member
alice-i-cecile
left a comment
There was a problem hiding this comment.
I'm happy with this API, and this functionality seems like a reasonable way to use extrusions.
Like always, docs and code quality are excellent.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jun 4, 2024
# Objective - Implement `Extrudable` for all meshbuilders of shapes that have been added after #13478 was created ## Solution - Implemented meshing for extrusions of `CircularSector`, `CircularSegment` and `Rhombus` ## Testing - The correctness of these was confirmed visually. ## Additional information Here is an image of what they look like :)  Co-authored-by: Lynn Büttgenbach <62256001+solis-lumine-vorago@users.noreply.github.com>
Member
|
Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1363 if you'd like to help out. |
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.
Objective
MeshableforExtrusion<T>Solution
MeshablerequiresMeshable::Output: MeshBuildernow. This means that allsome_primitive.mesh()calls now return aMeshBuilder. These were added for primitives that did not have one prior to this.Extrudable: MeshBuilderhas been added. This trait allows you to specify the indices of the perimeter of the mesh created by thisMeshBuilderand whether they are to be shaded smooth or flat.Extrusion<P: Primitive2d + Meshable>is nowMeshableaswell. The associatedMeshBuilderisExtrusionMeshBuilderwhich is generic overPand uses theMeshBuilderof its baseshape internally.ExtrusionMeshBuilderexposes the configuration functions of its base-shapes builder.3d_shapesexample to includeExtrusionsMigration Guide
.mesh().build()on primitives where you have previously called.mesh()Outputtype of customMeshableimplementations must now deriveMeshBuilder.Additional information
+Z) is in the area between(0, 0)and(0.5, 0.5),-Z) is in the area between(0.5, 0)and(1, 0.5)(0, 0.5)and(1, 1). EachPerimeterSegmentyou specified in theExtrudableimplementation will be allocated an equal portion of this area.Here is an example of what that looks like on a capsule:
Extrusion.UVs.mp4
This is the texture used:
The
3d_shapesexample now looks like this: