-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add JS bindings for CrossSection #360
Comments
@geoffder Any interest in trying this one? I made it a lot easier to develop and test our WASM: https://github.com/elalish/manifold/tree/master/bindings/wasm#local-development - it would be awesome to use crossSection in manifoldCAD.org! |
I've been a bit busier lately, but I can add that to my manifold TODO slate. The spare time I've put into coding stuff lately has been spent tidying up the OManifold library a bit more (particularly the build) in preparation for finally releasing it on opam (ocaml package manager). Also been meaning to add MeshIO import to the C bindings. Should have a bit more time to knock these things off soon. |
I guess the non-member functions like |
That's a good point. Honestly, shouldn't they be static members of |
Now that I think about it a bit more, the empty list case for the batch booleans would be a bit sketchy with the polymorphic route (could be an empty Manifold, empty CrossSection, or an exception). |
Yeah, I'm realizing now that all the places we wrote things like |
Yea I think it's reasonable. Technically not required for constructors like |
Is there a particular reason why Also, RE the Something like: function debug(shape: Manifold | CrossSection, map: Map<number, Mesh>) {
const manifold = (shape instanceof module.CrossSection) ? shape.extrude(1) : shape;
const result = manifold.asOriginal();
map.set(result.originalID(), result.getMesh());
return result;
}; |
Those are only added for our editor, not part of the manifold API, so let's not worry about them for now. If you think of a good way to visualize 2D stuff, great, but I'll probably punt on it. |
Right, that's why I thought simply extruding them to a thickness of 1 to show them like a manifold (how OpenSCAD shows 2d shapes in preview mode) might be good enough. |
Not a bad idea; we can probably make the editor-specific functions polymorphic, but let's save that for a follow-on PR to simplify review. |
Ah well, I've already added the above, but it is just a single line slipped into |
There's also a few other APIs missing, like
Split
andTrim
.The text was updated successfully, but these errors were encountered: