Skip to content

Conversation

@mkeblx
Copy link
Contributor

@mkeblx mkeblx commented Apr 11, 2025

Description

Followup to: #30868, with a few improvements.

--

UV comparison:

Before:
capsule-before

After:
capsule-after

This contribution is funded by Samsung

mkeblx added 2 commits April 10, 2025 22:02
Change length to height; matching heightSegments and other geometries
@github-actions
Copy link

github-actions bot commented Apr 11, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.49
78.38
336.49
78.38
+0 B
+0 B
WebGPU 542.05
150.13
542.05
150.13
+0 B
+0 B
WebGPU Nodes 541.51
150.03
541.51
150.03
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 465.42
112.22
465.42
112.22
+0 B
+0 B
WebGPU 614.89
166.17
614.89
166.17
+0 B
+0 B
WebGPU Nodes 569.88
155.58
569.88
155.58
+0 B
+0 B

* @augments BufferGeometry
*/
class CapsuleGeometry extends LatheGeometry {
class CapsuleGeometry extends BufferGeometry {
Copy link
Collaborator

@Mugen87 Mugen87 Apr 12, 2025

Choose a reason for hiding this comment

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

I'm glad to see the dependency to LatheGeometry is removed! Using LatheGeometry was a quick way to implement a capsule but this new approach results in more usable and correct vertex data.

@Mugen87 Mugen87 added this to the r176 milestone Apr 12, 2025
@Mugen87 Mugen87 merged commit 92bd89f into mrdoob:dev Apr 12, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants