8000 JS bindings: convert mesh.triVerts to array of arrays by jirihon · Pull Request #271 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

JS bindings: convert mesh.triVerts to array of arrays #271

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

Closed
wants to merge 1 commit into from
Closed

JS bindings: convert mesh.triVerts to array of arrays #271

wants to merge 1 commit into from

Conversation

jirihon
Copy link
Contributor
@jirihon jirihon commented Nov 7, 2022

Convert the items of mesh.triVerts to plain arrays to match the Vec3 type which is [number, number, number].

Convert the items of mesh.triVerts to plain arrays to match the Vec3 type which is [number, number, number].
@codecov-commenter
Copy link

Codecov Report

Base: 92.10% // Head: 92.10% // No change to project coverage 👍

Coverage data is based on head (5270564) compared to base (af9377d).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #271   +/-   ##
=======================================
  Coverage   92.10%   92.10%           
=======================================
  Files          32       32           
  Lines        3446     3446           
=======================================
  Hits         3174     3174           
  Misses        272      272           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -157,8 +157,9 @@ Module.setup = function() {
const oldHalfedgeTangent = result.halfedgeTangent;
const conversion1 = v => ['x', 'y', 'z'].map(f => v[f]);
const conversion2 = v => ['x', 'y', 'z', 'w'].map(f => v[f]);
const conversion3 = v => [v[0], v[1], v[2]];
Copy link
Owner

Choose a reason for hiding this comment

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

Hmm, I must be missing something; this looks like a no-op, doesn't it? What does this change?

Copy link
Contributor Author
@jirihon jirihon Nov 8, 2022 8000

Choose a reason for hiding this comment

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

This is intended to convert elements of type {0: number, 1: number, 2: number} to elements of type [number, number, number]. If this patch is not applied, the elements of result.triVerts would be generic javascript objects. With this patch, the elements will be javascript arrays. I understand the function looks like no-op, as indexing object has the same syntax as indexing array.

@elalish
Copy link
Owner
elalish commented Nov 8, 2022

Thank you! I believe you're correct, but I also just removed that function entirely in #272. Please take a look and see if the new Mesh API I'm creating for v2.0 of the npm package will meet your needs.

@jirihon
Copy link
Contributor Author
jirihon commented Nov 8, 2022

#272 fixes this problem, so I'm closing the issue.

@jirihon jirihon closed this Nov 8, 2022
@jirihon jirihon deleted the patch-2 branch January 3, 2023 12:52
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.

3 participants
0