/Bedroom/VapePouch.foocad

Simple holders for Vapes.
Glue to the inside of a drawer (or elsewhere!)
import static uk.co.nickthecoder.foocad.arrange.v1.Arrange.*
import uk.co.nickthecoder.foocad.smartextrusion.v1.*
import static uk.co.nickthecoder.foocad.smartextrusion.v1.SmartExtrusion.*
class VapePouch : AbstractModel() {
@Custom( about="Total height, including the thickness of the base" )
var height = 30
@Custom( about="Thickness of the wall and the base" )
var thickness = 1.2
@Custom( about="A small chamfer at the base")
var chamfer = 0.8
@Custom( about="Only print a tiny ring to test the fit?" )
var test = false
fun makeCup( shape : Shape2d ) : Shape3d =
shape.offset(thickness)
.smartExtrude( height + thickness )
.bottom( Chamfer( chamfer ) ) -
shape.smartExtrude( height + thickness )
.bottom( Chamfer( chamfer ) )
.translateZ( thickness )
@Piece
fun vaptio() : Shape3d {
val r = 24/2
val profile = Circle(r).leftTo(0) hull Circle(r).rightTo(36)
// Offset needed, because I designed it for the base, but mod gets wider further up. :-(
return makeCup( profile.offset(0.5) )
}
@Piece
fun coolfireZ50() : Shape3d {
val r = 27/2
val profile = (
Circle(r) hull
Circle(r).translateX(4) hull
Square( 20 ).roundAllCorners(2).centerX().backTo(r).translateX( 2 )
) +
Square( 8, 17 ).centerY().leftTo( r ).roundAllCorners(1) +
Square( 4, 8 ).centerY().roundAllCorners(1).centerY().leftTo( r + 5.5 )
return makeCup( profile )
}
/*
Ok, this isn't a vape pouch, but it shares the same form, and I designed it at the same time,
for the same location.
*/
@Piece
fun remote() : Shape3d {
val rect = Square( 51,21 ).center().roundAllCorners(4)
val buttons = Square(34, 3).center().backTo(rect.front).roundCorner(1,2).roundCorner(0,2)
return makeCup( rect + buttons )
}
override fun build() : Shape3d {
return arrangeX( vaptio(), coolfireZ50(), remote() )
}
}

