shawn0326 / three.path

three.path is a three.js extension which provides a 3D path geometry builder.
MIT License
124 stars 39 forks source link

Add Optional End Caps to PathTubeGeometry to Prevent Visual Artifacts #18

Open rfzeg opened 3 weeks ago

rfzeg commented 3 weeks ago

Thank you for this library—it's incredibly useful!

I noticed that PathTubeGeometry currently doesn't have an option to include end caps. As a result, visual artifacts can occur when viewing the tube from its open ends. This is probably because the backface of the geometry isn't rendered, leading to this unintended effect, like seeing through the tube. This issue can make the tube appear broken or transparent from certain angles, affecting its visual fidelity.

It would be great if end caps could be an option included in the tube geometry.

Current geometry: TubeGeometryWithoutFlatEndCaps

Desired geometry (as an option):

TubeGeometryWithFlatEndCaps

If you're open to contributions, I could try to provide a pull request for flat end caps, as shown in the second image above.

shawn0326 commented 2 weeks ago

Thank you for your interest in contributing to this repository. Additionally, I recently implemented a tube geometry with caps in another WebGL library (t3d.js, similar to three.js). Feel free to refer to it if you need: https://uinosoft.github.io/t3d.js/examples/#geometry_builder_lines https://github.com/uinosoft/t3d.js/blob/dev/examples/jsm/geometries/builders/TubeBuilder.js