import static uk.co.nickthecoder.foocad.chamferedextrude.v1.ChamferedExtrude.* import static uk.co.nickthecoder.foocad.layout.v1.Layout2d.* import static uk.co.nickthecoder.foocad.layout.v1.Layout3d.* class TapExtension : Model { @Piece fun straight() : Shape3d { val existing = Circle(14/2).leftTo(0).hull( Circle(6/2).rightTo(24) ) val bigger = Circle(18/2).leftTo(-2).hull( Circle(6/2).rightTo( 60 ) ) val main = bigger.chamferedExtrude( 7, 1, 0 ) - existing.offset(0.1).extrude( 7 ).translateZ(2) return main } @Piece fun right() : Shape3d { val existing = Circle(14/2).leftTo(0).hull( Circle(6/2).rightTo(24) ) val bigger = existing.offset(2) val post = bigger.extrude( 14 ) - existing.extrude( 14 ).translateZ(9) val handleProfile = bigger.hull( Circle(6/2).rightTo( 35 ).rotate(110) ) val handle = handleProfile.extrude( 7 ) return handle + post } @Piece fun left() = right().mirrorY() override fun build() : Shape3d { return layoutY( 2, straight(), right(), right().mirrorY().leftTo(0) ) } }