*ShapeJS subtraction script storage example

by MrNib
  • White

    White nylon plastic with a matte finish and slight grainy feel.

    $11.97
Buy Now
Throw a "// less-than br greater-than" at the end of every script line to allow script storage here in the description box.
http://shapejs.shapeways.com/creator?example=subtraction

function cross3D(size, thickeness){ //
var union = new Union(); //
var boxX = new Box(0,0,0,size,thickeness, thickeness); //
var boxY = new Box(0,0,0, thickeness, size, thickeness); //
var boxZ = new Box(0,0,0,thickeness, thickeness,size); //
union.add(boxX); //
union.add(boxY); //
union.add(boxZ); //
return union; //
} //
//
function main(args) { //
var size = args[0]; //
var thickness = args[1]; //
var grid = createGrid(-16*MM,16*MM,-16*MM,16*MM,-16*MM,16*MM,0.1*MM); //
var diff = new Subtraction(new Sphere(15*MM), cross3D(size, thickness)); //
var maker = new GridMaker(); //
maker.setSource(diff); //
maker.makeGrid(grid); //
return grid; //
} //
//

Dimensions

IN: 1.109 w x 1.109 d x 1.109 h
CM: 2.818 w x 2.818 d x 2.818 h

Comments

Sign In or Join to comment.
 
 
Logo

Hello.

We're sorry to inform you that we no longer support this browser and can't confirm that everything will work as expected. For the best Shapeways experience, please use one of the following browsers:

Click anywhere outside this window to continue.