focomoso Posted February 6, 2017 Share Posted February 6, 2017 Hi, Has there been any thought of replacing the BSP based CSG model with the much better one used by openjscad (which you can find here: https://github.com/Spiritdude/OpenJSCAD.org/blob/master/csg.js)? The advantages are that it runs faster (usually), uses less memory and creates meshes with many fewer unnecessary polygons. See this: http://www.babylonjs-playground.com/#5BFER#0 as an example of how many extrenious polygons are created with the current (bsp) method for just a simmple union of two spheres. Increase the res variable to see what happens as you increase the resolution of the spheres. Thanks, James Wingnut and iiceman 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 6, 2017 Share Posted February 6, 2017 Hello I see absolutely no problem. Do you want to submit a PR? Quote Link to comment Share on other sites More sharing options...
focomoso Posted February 6, 2017 Author Share Posted February 6, 2017 I'll take a look to see how much work it'll take. Just don't want to step on anyone's toes... Quote Link to comment Share on other sites More sharing options...
Kesshi Posted February 7, 2017 Share Posted February 7, 2017 @focomoso If you want to do this, there are already type definitions for OpenJsCad here:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4869992bc079b88280b9ff91213528904109e8ae/openjscad/index.d.ts This could help you. Quote Link to comment Share on other sites More sharing options...
focomoso Posted January 15, 2018 Author Share Posted January 15, 2018 I'm revisiting this as I have some time now. I'm just collecting a bunch of resources here so I (and hopefully others) can keep them handy: Overview of algorythms: https://github.com/openscad/openscad/wiki/Project%3A-Survey-of-CSG-algorithms c++ CSG (as a .wasm, perhaps): http://opencsg.org/ GPU based csg: https://www.researchgate.net/publication/220184001_Blister_GPU-based_rendering_of_Boolean_combinations_of_free-from_triangulated_shapes https://www.cc.gatech.edu/~jarek/papers/Blister.pdf https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0ahUKEwjS3OHi8NjYAhUCneAKHeYeBwQQFgg2MAE&url=https%3A%2F%2Fwww.cc.gatech.edu%2F~jarek%2Fcourses%2F1050%2Fslides%2FL18Blister.ppt&usg=AOvVaw0Umt9sHnc7eANjD1mr1Web Quote Link to comment Share on other sites More sharing options...
focomoso Posted January 15, 2018 Author Share Posted January 15, 2018 Also, the original csg.js file from OpenJSCad has moved here: https://github.com/jscad/csg.js/blob/master/csg.js Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.