Repository navigation
Conversation
geom2.reverse built a new geometry from the reversed sides and dropped every other field, so mirroring a colored geom2 (transform with a negative determinant goes through reverse) lost its color and any user fields. Copy the input's fields and replace only sides and transforms. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
z3dev
requested changes
Sep 27, 2026
| t.true(compareVectors(another.transforms, mat4.create())) | ||
| }) | ||
|
|
||
| test('reverse: mirroring a geom2 keeps its fields', (t) => { |
Member
There was a problem hiding this comment.
Can you move this to transform.test.js? It's probably better in that suite.
| const newsides = oldsides.map((side) => [side[1], side[0]]) | ||
| newsides.reverse() // is this required? | ||
| return create(newsides) | ||
| return Object.assign({}, geometry, create(newsides)) |
Member
There was a problem hiding this comment.
We could save a function call and multiple object creation by using...
return Object.assign({}, geometry, { sides: newsides })
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.
geom2.reversebuilt a new geometry from the reversed sides and dropped every other field. Mirroring a geom2 (a transform with a negative determinant) goes throughreverse, so a colored geom2 lost itscolorand any user fields when mirrored. This copies the input's fields and replaces onlysidesandtransforms.Tests
New tests in
reverse.test.js:reversekeepscolorand a user field, returns newsides, and resetstransformsto identitygeom2.transformwith a negative X scale keepscolorand a user fieldAll Submissions:
packages/modeling: 595 passed;standardxclean on the changed files.No build files are included.
🤖 Generated with Claude Code