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

Added missing JS bindings (from discussion in #317) #320

Merged
merged 12 commits into from
Feb 15, 2023

Conversation

rafern
Copy link
Contributor

@rafern rafern commented Feb 13, 2023

  • Add missing type definitions
  • Exposes MeshJS.transform to JS bindings
  • Added getter for transforms, called matrix. I feel like this is a bad name, any suggestions?

Marking this as a draft since I haven't had the time to test this yet. Will update this PR once I port gypsum and test it with the new API.

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

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

Thanks! Let's fix the naming here at least. If you want to fix it back in the C++ too, you're welcome to, otherwise I'll do that as a follow-up.

bindings/wasm/bindings.js Outdated Show resolved Hide resolved
bindings/wasm/bindings.js Outdated Show resolved Hide resolved
bindings/wasm/bindings.js Outdated Show resolved Hide resolved
bindings/wasm/manifold.d.ts Show resolved Hide resolved
bindings/wasm/manifold.d.ts Outdated Show resolved Hide resolved
bindings/wasm/bindings.cpp Show resolved Hide resolved
@rafern
Copy link
Contributor Author

rafern commented Feb 14, 2023

All done, let me know if you have any more changes. The C++ is already changed and it doesn't throw any compile errors, but I haven't done any testing with real code. I'll probably port gypsum this weekend, but if you want to merge it now that's OK too, and I can test later

@elalish elalish marked this pull request as ready for review February 14, 2023 16:47
@elalish
Copy link
Owner

elalish commented Feb 14, 2023

@rafern So, our CI only runs on non-draft PRs, so I marked yours as ready for review, but Github has a bug where it caches the stale value of "draft" and so still won't run the CI. Can you push some trivial commit to prod it into action?

@rafern
Copy link
Contributor Author

rafern commented Feb 14, 2023

@elalish Should be good now

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

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

Excellent, pretty much there. If you look at the one failing test, it looks like something in cbind hasn't been updated with the rename. Should be an easy fix, but if not, we can take care of it after.

bindings/wasm/manifold.d.ts Show resolved Hide resolved
bindings/wasm/manifold.d.ts Outdated Show resolved Hide resolved
@rafern
Copy link
Contributor Author

rafern commented Feb 14, 2023

Yeah, working on it. I forgot that there were other bindings that needed to be updated. I'll ping you once it's done

@rafern
Copy link
Contributor Author

rafern commented Feb 14, 2023

@elalish Done. I haven't updated the Python bindings though, since I'm not familiar with how that works, but it should be fine for now since there aren't any tests

@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

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

Coverage data is based on head (9565bb5) compared to base (20d7ef9).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #320   +/-   ##
=======================================
  Coverage   91.50%   91.50%           
=======================================
  Files          32       32           
  Lines        3722     3722           
=======================================
  Hits         3406     3406           
  Misses        316      316           
Impacted Files Coverage Δ
src/utilities/include/public.h 74.69% <ø> (ø)
src/manifold/src/impl.cpp 95.35% <100.00%> (ø)
src/manifold/src/manifold.cpp 88.70% <100.00%> (ø)

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.

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

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

Excellent, thank you!

@elalish elalish merged commit 5331b68 into elalish:master Feb 15, 2023
@rafern
Copy link
Contributor Author

rafern commented Mar 10, 2023

@elalish I was supposed to do this 3 weekends ago (sorry), but I just wanted to let you know that I finally ported gypsum to the newer version of Manifold, and got to test the WASM bindings. Everything seems to work fine, and normals get transformed as expected:
image

Tangents need to be transformed manually, but that's OK because there's the runTangent field:
image

Thanks for your work on the new API!

@elalish
Copy link
Owner

elalish commented Mar 10, 2023

@rafern Excellent, great to know it's working! Would you be interested in adding gypsum to our list of users? Also, considering the recent addition of CrossSection for 2D, would you be interested in adding the JS bindings? I really appreciate your help and would be happy to add you as a collaborator if you'd like to stay involved.

@rafern
Copy link
Contributor Author

rafern commented Mar 10, 2023

@elalish Yeah, sure, I'll add to the list of users. I can work on the bindings, but I won't make any promises on a timeline as those haven't gone very well so far 😅

@elalish
Copy link
Owner

elalish commented Mar 10, 2023

@rafern No problem! Just let us know when you get started. I just filed an issue for it: #360

cartesian-theatrics pushed a commit to SovereignShop/manifold that referenced this pull request Mar 11, 2024
* Added missing JS bindings (from discussion in elalish#317)

* Fix formatting

* Add reserveIDs JS bindings

* Use numRun instead of numMatrix

* Make numProp, triVerts and vertProperties required options in Mesh ctor.

* Rename MeshJS originalID to runOriginalID, and transform to runTransform

* Fix formatting with clang-format

* Trigger CI

* Added missing C bindings

* Rename matrix to transform in JS type definitions

* Rename numMatrix to numRun in JS type defs
almost forgot this one again

* JS bindings, transform index -> run
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