import static uk.co.nickthecoder.foocad.layout.v1.Layout2d.* import static uk.co.nickthecoder.foocad.layout.v1.Layout3d.* import static uk.co.nickthecoder.foocad.screws.v1.Screws.* import static uk.co.nickthecoder.foocad.chamferedextrude.v1.ChamferedExtrude.* /** Simple feet to be screwed to the bottom of garden furniture's legs so that the wooden leg is raised off the ground, and therefore less prone to rotting. The default size is quite small (too small when placed on grass or soil???). Print Notes I used PETG, as it is slipery, so hopefully less friction than PLA. Assembly The screws must be recessed (unless you are ok with them scratching along the ground). */ class Foot : Model { @Custom var diameter = 35 @Custom var thickness = 4 @Custom( about="Must be smaller than the thickness" ) var chamfer = 2.5 @Custom( about="The diameter of the hole and the screw head" ) var screwSize = Vector2( 3, 8 ) var screwCount = 3 override fun build() : Shape3d { val main = Circle( diameter / 2 ).chamferedExtrude( thickness, 0, chamfer ) val hole = countersink( screwSize.x, screwSize.y ) .translateX( if (screwCount == 1) 0 else diameter * 0.45 - screwSize.y/2 - chamfer ) .repeatAroundZ( screwCount ) .topTo( main.top+0.1) // Makes the first layer as simple as possible (no holes). Without this, the fine details // on the first layer sometimes lift while being printed, and then stick to the hot end, // which then ruins the print. val firstLayer = Cylinder( 0.2, diameter / 2 ) return main - hole + firstLayer } }