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

Line: Fix index on intersection. #30424

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

jonathanzopes
Copy link
Contributor

@jonathanzopes jonathanzopes commented Jan 29, 2025

Fixed #30414.

Description

Revert to assign line segment index on intersection again.

I'm not sure, if the line loop case is correctly handled.

Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.27
78.29
336.27
78.29
+0 B
+0 B
WebGPU 516.75
143.47
516.75
143.47
+0 B
+0 B
WebGPU Nodes 516.22
143.36
516.22
143.36
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.25
112.13
465.25
112.13
+0 B
+0 B
WebGPU 588.76
159.63
588.76
159.63
+0 B
+0 B
WebGPU Nodes 544.14
149.2
544.14
149.2
+0 B
+0 B

@Mugen87 Mugen87 changed the title Fix index on intersection. Line: Fix index on intersection. Jan 29, 2025
@gkjohnson
Copy link
Collaborator

gkjohnson commented Jan 30, 2025

This looks right, though I haven't tested it (it should be tested with line loop to make sure the index makes sense). One thing to note is that when a line loop is being intersected against it will return the index as end - 1 which represents the implicit final line connecting the first and last vertices and will require special handling by the end user. This is may be worth documenting.

@Mugen87 Mugen87 added this to the r173 milestone Jan 30, 2025
@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 30, 2025

I'll go ahead and merge so we have this in r173. The changes look good to me as well.

@Mugen87 Mugen87 merged commit df85340 into mrdoob:dev Jan 30, 2025
12 checks passed
@jonathanzopes jonathanzopes deleted the fix_line_segment_raycasting_index branch January 30, 2025 09:23
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.

Problems with raycasting on LineSegments after r163
3 participants