Implementation for Flat End Caps on Tube Geometry#19
Open
rfzeg wants to merge 3 commits intoshawn0326:devfrom
Open
Implementation for Flat End Caps on Tube Geometry#19rfzeg wants to merge 3 commits intoshawn0326:devfrom
rfzeg wants to merge 3 commits intoshawn0326:devfrom
Conversation
Owner
|
To avoid confusion with normals and UVs, the cap should generally not share vertices with the sides. I will try to address these issues. |
Owner
|
I submitted another PR. #20 |
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.
This pull request tries to addresses the issues described in #18.
It introduces a prototype for implementing flat end caps on the tube geometry. The end caps are designed to close the ends of the tube geometry, which enhances the overall appearance when using a standard material such as MeshPhongMaterial. However, there are a few issues that need to be addressed before this implementation can be considered complete.
Current Functionality: The current changes successfully add flat end caps to the tube geometry, controlled via a simple boolean option.
Known Issues
Mesh Topology
When switching to wireframe mode, the mesh topology reveals inconsistencies between the first and second end caps.
The second end cap (end) appears correct, featuring 1 center vertex connected to the last radial segment of the tube.
The first end cap (start), however, has redundant vertices. It includes 1 center vertex + (radialSegments + 1) rim vertices, which makes it geometrically inconsistent with the rest of the tube.
UV Textures
The UV mapping for the last segment of the tube (adjacent to the second end cap) is twisted.
The first end cap (start) also displays UV issues, likely caused by the redundant vertices. These issues prevent proper texture mapping on both ends of the tube.
Extensibility
While the current implementation allows toggling flat end caps, it lacks flexibility for future enhancements.
Future end cap types, such as round (semi-hemisphere) end caps, arrow-shaped end caps or squared (plug) end caps, cannot be easily introduced with the current design.
I have thoroughly investigated potential solutions for the issues above but was unable to resolve them with my current (very limited) knowledge level. I also reviewed the TubeBuilder.js code you provided but could not identify the cause of these problems or a way to fix them. I would appreciate if you could address the current issues (mesh topology und UV texture) and maybe make the implementation more robust for adding other types of end caps in the future. 🙏