Skip to content

Scene: BufferAttribute.copyAt, as three.js has it - #129

Merged
doodlewind merged 2 commits into
meshy-dev:mainfrom
kvnloo:fix/trt-compat-attribute
Nov 24, 2026
Merged

doodlewind merged 2 commits into
meshy-dev:mainfrom
kvnloo:fix/trt-compat-attribute

Conversation

@kvnloo

@kvnloo kvnloo commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

three.js's BufferAttribute.copyAt(index1, attribute, index2) copies one item's raw components from another attribute, using each attribute's itemSize for the offsets (r187 BufferAttribute.js#L237-L250). packages/scene doesn't have it, so three.js code that calls it throws copyAt is not a function.

Change: BufferAttribute.copyAt in geometry.ts, the same loop. Like three.js it copies stored values without normalization and doesn't bump version.

Adds one method.

Test: one node:test case in a new file, packages/scene/test/three-compat-attribute.test.ts: two copies into a normalized Uint8Array attribute land at itemSize offsets, the method is chainable, and version stays 0.

The test is in its own file so it merges independently of the other open three.js-parity PRs.

Tier T (packages/scene TypeScript; no kernel, IR or export changes).

Merge gate

Runs were on a Linux VM (Node 24.22.1) in a fresh home directory, from a fresh clone and npm ci.

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