Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmasson committed Nov 5, 2017
1 parent 9498072 commit d709bbc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build/mathcell.js
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ function isosurface( f, xRange, yRange, zRange, options={} ) {
}

return [ { vertices: vertices, faces: faces, color: color, opacity: opacity,
type: 'surface' } ];
type: 'surface', colors: [] } ];

}

Expand Down
8 changes: 4 additions & 4 deletions docs/examples/sine-wave-3d.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

var omega = +document.getElementById( id + 'omega' ).value;

function z(x,y) { return Math.sin( omega * x * y ); }
function z(x,y) { return [ x, y, Math.sin( omega * x * y ) ]; }

var s = parametric( z, [-1.5,1.5,100], [-1.5,1.5,100], 'pink', 1 );
var s = parametric( z, [-1.5,1.5,100], [-1.5,1.5,100], { color: 'pink' } );

var data = [ s ];

Expand Down Expand Up @@ -61,9 +61,9 @@

var omega = +document.getElementById( id + 'omega' ).value;

function z(x,y) { return Math.sin( omega * x * y ); }
function z(x,y) { return [ x, y, Math.sin( omega * x * y ) ]; }

var s = parametric( z, [-1.5,1.5,100], [-1.5,1.5,100], 'pink', 1 );
var s = parametric( z, [-1.5,1.5,100], [-1.5,1.5,100], { color: 'pink' } );

var data = [ s ];

Expand Down
12 changes: 6 additions & 6 deletions docs/examples/sine-waves.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
var data = [];

if ( combine === true ) {
var p = plot( x => sine1(x) + sine2(x), [0, 2*Math.PI], 'purple' );
var p = plot( x => sine1(x) + sine2(x), [0, 2*Math.PI], { color: 'purple' } );
data = [ p ];
} else {
var p1 = plot( x => sine1(x), [0, 2*Math.PI], 'rgb(0,127,255)' );
var p2 = plot( x => sine2(x), [0, 2*Math.PI], 'red' );
var p1 = plot( x => sine1(x), [0, 2*Math.PI] );
var p2 = plot( x => sine2(x), [0, 2*Math.PI], { color: 'red' } );
data = [ p1, p2 ];
}

Expand Down Expand Up @@ -89,11 +89,11 @@
var data = [];

if ( combine === true ) {
var p = plot( x => sine1(x) + sine2(x), [0, 2*Math.PI], 'purple' );
var p = plot( x => sine1(x) + sine2(x), [0, 2*Math.PI], { color: 'purple' } );
data = [ p ];
} else {
var p1 = plot( x => sine1(x), [0, 2*Math.PI], 'rgb(0,127,255)' );
var p2 = plot( x => sine2(x), [0, 2*Math.PI], 'red' );
var p1 = plot( x => sine1(x), [0, 2*Math.PI] );
var p2 = plot( x => sine2(x), [0, 2*Math.PI], { color: 'red' } );
data = [ p1, p2 ];
}

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/superellipsoid.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

}

var s = isosurface( f, [-1,1], [-1,1], [-1,1], 'purple' );
var s = isosurface( f, [-1,1], [-1,1], [-1,1], { color: 'purple' } );

var data = [ s ];

Expand Down Expand Up @@ -71,7 +71,7 @@

}

var s = isosurface( f, [-1,1], [-1,1], [-1,1], 'purple' );
var s = isosurface( f, [-1,1], [-1,1], [-1,1], { color: 'purple' } );

var data = [ s ];

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/tangent.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

var omega = +document.getElementById( id + 'omega' ).value;

var p = plot( x => Math.tan( omega * x ), [-Math.PI, Math.PI], 'rgb(0,255,0)' );
var p = plot( x => Math.tan( omega * x ), [-Math.PI, Math.PI], { color: 'rgb(0,255,0)' } );

var data = [ p ];

Expand Down Expand Up @@ -59,7 +59,7 @@

var omega = +document.getElementById( id + 'omega' ).value;

var p = plot( x => Math.tan( omega * x ), [-Math.PI, Math.PI], 'rgb(0,255,0)' );
var p = plot( x => Math.tan( omega * x ), [-Math.PI, Math.PI], { color: 'rgb(0,255,0)' } );

var data = [ p ];

Expand Down
2 changes: 1 addition & 1 deletion src/march/marching-cubes.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function isosurface( f, xRange, yRange, zRange, options={} ) {
}

return [ { vertices: vertices, faces: faces, color: color, opacity: opacity,
type: 'surface' } ];
type: 'surface', colors: [] } ];

}

Expand Down

0 comments on commit d709bbc

Please sign in to comment.