-
Notifications
You must be signed in to change notification settings - Fork 105
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
chores #833
chores #833
Changes from 11 commits
ea5dcf7
0ad9657
5871752
df00c1b
1f748ad
d1edf3b
f337243
fd014b6
94bfe23
b33f8d8
dca5365
a16b20b
b4bddf5
97d91a4
9620c59
32e4e80
86e2b5d
486a6b0
1988a67
68681a4
a8591b6
8648a57
a446e0d
80b83fd
eeefbea
84ba93c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ struct nb::detail::type_caster<glm::vec<N, T, Q>> { | |
int size = PyObject_Size(src.ptr()); // negative on failure | ||
if (size != N) return false; | ||
make_caster<T> t_cast; | ||
for (size_t i = 0; i < size; i++) { | ||
for (int i = 0; i < size; i++) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems backwards? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, should fix this. Thanks. |
||
if (!t_cast.from_python(src[i], flags, cleanup)) return false; | ||
value[i] = t_cast.value; | ||
} | ||
|
@@ -155,7 +155,7 @@ struct nb::detail::type_caster<std::vector<glm::vec<N, T, Q>>> { | |
size_t num_vec = vec.size(); | ||
T *buffer = new T[num_vec * N]; | ||
nb::capsule mem_mgr(buffer, [](void *p) noexcept { delete[](T *) p; }); | ||
for (int i = 0; i < num_vec; i++) { | ||
for (size_t i = 0; i < num_vec; i++) { | ||
for (int j = 0; j < N; j++) { | ||
buffer[i * N + j] = vec[i][j]; | ||
} | ||
|
@@ -298,7 +298,8 @@ NB_MODULE(manifold3d, m) { | |
nb::ndarray<float, nb::shape<nb::any>> array; | ||
std::vector<float> vec; | ||
if (nb::try_cast(result, array)) { | ||
if (array.ndim() != 1 || array.shape(0) != newNumProp) | ||
if (array.ndim() != 1 || | ||
array.shape(0) != static_cast<size_t>(newNumProp)) | ||
throw std::runtime_error("Invalid vector shape, expected (" + | ||
std::to_string(newNumProp) + ")"); | ||
for (int i = 0; i < newNumProp; i++) newProps[i] = array(i); | ||
|
@@ -384,7 +385,7 @@ NB_MODULE(manifold3d, m) { | |
"sharpened_edges.size() != edge_smoothness.size()"); | ||
} | ||
std::vector<Smoothness> vec(sharpened_edges.size()); | ||
for (int i = 0; i < vec.size(); i++) { | ||
for (size_t i = 0; i < vec.size(); i++) { | ||
vec[i] = {sharpened_edges[i], edge_smoothness[i]}; | ||
} | ||
return Manifold::Smooth(mesh, vec); | ||
|
@@ -517,7 +518,7 @@ NB_MODULE(manifold3d, m) { | |
.def_ro("run_original_id", &MeshGL::runOriginalID) | ||
.def_ro("face_id", &MeshGL::faceID) | ||
.def_static( | ||
"level_set", | ||
"level_set", | ||
[](const std::function<float(float, float, float)> &f, | ||
std::vector<float> bounds, float edgeLength, float level = 0.0) { | ||
// Same format as Manifold.bounding_box | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to build WASM with exceptions off? Maybe better to test one of the nix builds since they're fast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If testing generally exceptions off is the test. then it could be linux.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fire I think your earlier comment mentioned you do build WASM with exceptions off - that requires special CMake instructions which I was considering removing since JS is generally exceptions-based. But if WASM sans exceptions is actually useful to someone, then @pca006132 has it set up properly now. Do you build for WASM without exceptions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect to build Godot Engine WASM without exceptions since the Godot Engine editor and Godot Engine game templates build without exceptions in the default configuration on all platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Okay, let's leave it as is in this PR then.