mode.js an open-sourced project aimed at creating web-based tools for computational design. Our studio is dedicated to building custom parametric models for the web - and this our repository for sharing utility functions and example files.
Mode Lab - main site
Mode Lab tools - sandbox of design tools.
Download the library and include it in your html.
<script src="js/mode.js"></script>
Many of the functions build off of existing libraries. Below is an example using objects from THREE.js. This is a code snippet from the contoured bunny example.
//define bounding box by plane or normal vector
//arguments are THREE.Geometry and THREE.Plane/THREE.Vector3
var bb = new MODE.boundingBox(mesh.geometry, normalVector);
Example files are in the examples directory for this repo. Additional demos are posted periodically on http://executable.io/.
In-progress documentation is currently stored here.
Many of the utility functions are dependent on some of our favorite libraries:
THREE.js - we use THREE for 3D interaction and GPU operations
Three.js is a cross-browser JavaScript library/API used to create and display animated 3D computer graphics in a web browser. Three.js uses WebGL. The source code is hosted in a repository on GitHub.
D3.js - we use D3 for 2D vector graphics and data management/interaction
D3.js is a JavaScript library for manipulating documents based on data. D3 helps you bring data to life using HTML, SVG, and CSS. D3’s emphasis on web standards gives you the full capabilities of modern browsers without tying yourself to a proprietary framework, combining powerful visualization components and a data-driven approach to DOM manipulation.
All mode.js content is protected under the MIT License.