Exit Full View
Up

/Kitchen/MicrowaveCoverHanger.foocad

MicrowaveCoverHanger

Screw the two pieces to the inside top of a cupboard to "hang" a microwave plate cover.

FooCAD Source Code
import uk.co.nickthecoder.foocad.screws.v3.*
import uk.co.nickthecoder.foocad.smartextrusion.v1.*
import static uk.co.nickthecoder.foocad.smartextrusion.v1.SmartExtrusion.*

class MicrowaveCoverHanger : Model {

    var length = 80

    meth cover() = Circle( 180 )
        .smartExtrude( 100 )
        //.scaleBottom( 0.8 )
        .top( ProfileEdge.chamferedStep( 10, 12 ).reverse() )
        .bottom( Fillet( 30 ) )
        
    @Piece
    meth fromSide() : Shape3d {
        val profile = Square( 15, 10 ) -
            Square( 12, 7 ).roundCorner(2,3)

        val main = profile.extrude( length )
            .rotateX(-90).centerY()
            .bottomTo(0)
        val hole = Countersink().topTo( 3 )
            .leftTo(2)
            .centerYTo( main.front + 10 ).mirrorY().also()

        return main - hole
    }

    @Piece
    meth fromAbove() : Shape3d {
        val profile = Square( 15, 23 ) -
            Square( 12, 7 ).roundCorner(2,3) -
            Square( 12, 15 ).translate( 3, 10 ).roundCorner(0,3)

        val main = profile.extrude( length )
    
        val holes = Countersink()
            .rotateY(90)
            .rightTo(3)
            .centerYTo(17)
            .translateZ(10)
            .centerZTo( main.top - 10 ).also()

        return main - holes
    }

    override fun build() : Shape3d {
        val cover = cover().previewOnly()

        val fromSide = fromSide().rotateY(-90)
            .rightTo( cover.right - 3 )
            .topTo( cover.top -10 )

        val fromAbove = fromAbove()
            .rotateY(90).rotateZ(90).centerY()
            .rightTo( cover.left + 3 )
            .bottomTo( fromSide.top - 3 )

        return cover + fromSide + fromAbove
    }

}