evanw / csg.js

Constructive solid geometry on meshes using BSP trees in JavaScript
http://evanw.github.com/csg.js/
MIT License
1.79k stars 264 forks source link

Added transformations (scale, rotate, translate) #6

Closed joostn closed 12 years ago

joostn commented 12 years ago

Hi Evan,

Thanks for creating csg.js! I've added affine transformations for translation, rotation, scaling and arbitrary matrix transform. See tests/index.html where I've added an example.

I'm planning to add STL output as well, this would make it a great alternative to OpenSCAD for generating models for 3D printing.

Joost

joostn commented 12 years ago

And STL output is now implemented as well. I've included a quick demo at tests/stl.html.

joostn commented 12 years ago

I've added support for 2D shapes, and extrusion into a 3D mesh. See tests/index.html for a demo

evanw commented 12 years ago

I meant for csg.js to be a simple, readable implementation of the algorithm and not to be a production-quality CAD library for 3D geometry generation. Matrix transformations and STL output do not aid in understanding the algorithm and so I would rather keep them out of csg.js. You're welcome to use csg.js as the starting point for such a library, just keep in mind the limitations I mentioned on your other pull request.

joostn commented 12 years ago

That's fine, I'll keep working on my port then.