jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.66k stars 515 forks source link

adding joostn csg.js to openjscad - open questions #74

Closed bebbi closed 8 years ago

bebbi commented 9 years ago
  1. AMF support - says experimental/rudimentary in many places in code - what's the overall status on current support? How well are import, export supported?
  2. STL - there's an addition to toStlBinary func - can you give some context on what this is needed for? I don't fully grasp the comment there: as binary string blobbing gives bad blob in web, we need binary string for CLI perhaps there is a way to make it working (see openjscad for stlb)
Spiritdude commented 9 years ago

@bebbi I thought about it, best is you prepare a pull request with up-to-date csg.js and format.js and all the changes you made, given no changes in functionality is made (I gonna test it too). Add (or I do) in csg.js at the header a visible notice NOT TO EDIT csg.js as part of OpenJSCAD.org repo, but (for now) at joostn' repo (best give clear direction where it resides, it's not that easy to find). This way, it's a 100% working setup with a git pull for others, and also you and joost are free to update csg.js there, and have compatibility with OpenJSCAD.org as second concern until csg.js becomes NPMfied.

I'm too busy with other projects, otherwise I would push the NPMfiying, as I think it would provide a great backend for extensions for OpenJSCAD.org (format export/import, online read/write/backup, new solids, new 2D functionality etc) so the OpenJSCAD.org repo isn't concerned so much of higher level extensions. This of course makes only sense, when the overall API of csg.js becomes more solid to base other libraries on.

@z3dev In case requirejs works well in general, it's ok to drop my include() implementation - it took me quite a while to get include() working due the hidden complexity of it, but if requirejs is alike simple and covers then a proper NPM integration too (and yes, the mentioned namespace issue needs to be addressed), I think it's the way to go.

richievos commented 9 years ago

I'll try and take a pass at what the NPM solution would look like on Sunday if someone doesn't get to it first. The drop a comment in the file solution sounds like a great interim.

z3dev commented 9 years ago

Great! I'm going to start using requireJS in my projects. In addition to the module loading (javascripts), there's optimization (combining/compressing) as well. It looks really good for projects that have maintain javascripts for each page, library, etc. I'll start a mail thread with @richievos and see if we can bang out the NPM solution next week.

From RequireJS...

RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments, like Rhino and Node. Using a modular script loader like RequireJS will improve the speed and quality of your code.

z3dev commented 9 years ago

84 has been created for the NPM work. @richievos and I start discussions there.

bebbi commented 9 years ago

csg.js at joostn fork is now separated into (new) csg.js, with warning message, and formats.js. It's now ready for merging into openjscad.org, adding additional warnings in code/readme as discussed. I wouldn't merge formats.js yet. Let me know how it goes - then we close this issue and take next step?

z3dev commented 8 years ago

CSG.js and formats.js have been merged into OpenJSCAD.org, and all changes from @matthijskooijman CSG.js and formats.js will be tested and merged going forward.

Closing this issue. Any new issues can be addressed in a new thread.