const jscad = require ( '@jscad/modeling' ) ; const { cuboid , cylinder } = jscad . primitives ; const { rotate , translate } = jscad . transforms ; const { degToRad } = jscad . utils ; const { subtract } = jscad . booleans ; function main ( { width = 40 , length = 20 , height = 10 , hole = 3 , wall = 1 , flip = 0 , } ) { let wallOffset = wall * 2 ; let model = subtract ( cuboid ( { size : [ width , length , height ] } ) , translate ( [ 0 , 0 , wall ] , cuboid ( { size : [ width - wallOffset , length - wallOffset , height + wall ] } ) ) ) ; if ( hole ) { model = subtract ( model , translate ( [ width / 2 - wall / 2 ] , rotate ( [ 0 , degToRad ( 90 ) , 0 ] , cylinder ( { radius : hole / 2 , height : wall } ) ) ) ) ; } return rotate ( [ degToRad ( flip ) , 0 , degToRad ( 90 ) ] , model ) ; } module . exports = { main } ;