* navigation Mainpage|Main page Special:CreateAccount|Create an account Four_freedoms|Four freedoms Modular_construction_systems|Modular construction :Category:Materials|Materials :Category:Transformations|Transformations :Category:Parts|Parts :Category:Techniques|Techniques :Category:Projects|Projects Development_Roadmap|Roadmap Reading|Reading Video|Video Software|CAD / Software Naming|Naming Classes|Classes Badges|Badges Outreach|Outreach Events|Events Local_groups|Local groups Land|Land Printable_file_hosts|Printable file hosts developers|Developers Project_History|Project history donations|Donations https://www.replimat.org/store/|Store * Meta recentchanges-url|recentchanges Special:Categories|Categories Templates|Templates helppage|Help Special:Statistics|Statistics * SEARCH * LANGUAGES * AD1 * AD2
title=Battery v3 CAD|code= // Here we define the user editable parameters: function getParameterDefinitions() { return [ { type: 'float', name: 'nozzle_width', caption: 'Nozzle width', default: 0.4 }, { type: 'float', name: 'walls', caption: 'Walls', default: 2 }, ]; } function shell(params){ return CSG.cylinder({ start: [0, 0, 0], end: [0, 0, 65], radius: (19+wall_thickness*2)/2, resolution: params.cylresolution }); } function batteryyyyyyy(params){ return CSG.cylinder({ start: [0, 0, -1], end: [0, 0, 66], radius: 19/2, resolution: params.cylresolution }); } function battery() { var cube = CSG.cube({ center: [beam_width/2, beam_width/2, (length*beam_width)/2], radius: [beam_width/2, beam_width/2, (length*beam_width)/2] }); var holes = []; for (var i = 0; i < length; i++) { holes.push(xHole(i)); holes.push(yHole(i)); } var beam = cube.subtract(holes); beam.properties.myConnector = new CSG.Connector([10, 0, 0], [1, 0, 0], [0, 0, 1]); return beam; } function zBeam(length) { var cube = CSG.cube({ center: [beam_width/2, beam_width/2, (length*beam_width)/2], radius: [beam_width/2, beam_width/2, (length*beam_width)/2] }); var holes = []; for (var i = 0; i < length; i++) { holes.push(xHole(i)); holes.push(yHole(i)); } var beam = cube.subtract(holes); beam.properties.myConnector = new CSG.Connector([10, 0, 0], [1, 0, 0], [0, 0, 1]); return beam; } function main(params) { params.cylresolution=(params.quality == "1")? 64:16; var nozzle_width=params.nozzle_width; var walls=params.walls; var wall_thickness=nozzle_width*walls*2; //for (var j = 0; j < 4; j++){ //return CSG.cylinder({r: 19/2, h: 69}).rotateX(90); return CSG.cylinder({r: 9.5, h: 65}).rotateX(90); }