Exit Full View
Up

/Misc/BatteryCap.foocad

BatteryCap

A cap for a lithium ion battery, with a slot for the wire. Designed to be press-fitted into place.

FooCAD Source Code
class BatteryCap : Model {

    @Custom
    var diameter = 21

    @Custom
    var height = 16

    @Custom
    var thickness = 0.75

    override fun build() : Shape3d {
        val profile = Circle( diameter/2 )

        val outside = profile.offset(thickness)
            .extrude(height)

        val inside = profile.extrude(height)
            .bottomTo( thickness )

        val slot = Cube( 2, 100, 100 )
            .bottomTo( thickness ).centerX()

        return outside - inside - slot
    }
}