/Kitchen/CanCoasterCosy.foocad

Gives a more stable base for drink cans, and acts as a coaster. Useful for rough surfaces. Anyone for a picnic?
Has the option to add a brim for cans that are too skinny (that value style over function).
Can also be used to create a can-cosy, which keeps your hand warm, and the drink cold by adding a layer of insulation. Consider using thin perimeters, and low infill to trap air.
I used PETG, as it slightly flexible, rather than brittle.
NOTE. If you make the diamter a good fit, and have sufficient height, the coaster lifts up due to low preasure (as air cannot get in fast enough). Fun/annoying depending your mentality ;-)
Consider using fuzzy skin for a can-cozy. It gives a nicer textured feel, and extra grip.
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.*
import uk.co.nickthecoder.foocad.cup.v1.*
import static uk.co.nickthecoder.foocad.cup.v1.Cup.*
class CanFoot : Model {
// 54 for RedBull cans.
@Custom( about="Internal diameter and height" )
var diameter = 66.8
@Custom
var height = 15
@Custom( about="Wall and base thickness" )
var thickness = 1.7
@Custom( about="Additional width at the base" )
var brim = 0
@Custom
var holeDiameter= 0
@Piece
meth sizeTest() : Shape3d {
val inside = Circle( diameter / 2 )
val outside = inside.offset( thickness )
return (outside - inside).extrude(0.8)
}
@Slice( fillDensity=5, perimeters=2 )
@Piece
meth coaster() : Shape3d {
val inside = Circle( diameter / 2 )
val outside = inside.offset( thickness )
val cup = Cup( outside, height, thickness )
.baseThickness( thickness - 0.01 )
.top( Chamfer( thickness / 4 ) )
.insideBottom( Fillet( 3 ) )
val base = inside.offset( brim + thickness )
.smartExtrude( thickness )
.top( Fillet( thickness/3 ) )
.bottom( roundedChamfer( thickness/3 ) )
val fillet = ( outside.offset(brim - thickness) - outside )
.smartExtrude( brim -thickness -0.1 )
.outsideTop( Cove( brim-thickness ) )
.bottomTo( base.top -0.01 )
val can = Circle( diameter/2-0.1 )
.smartExtrude( Math.max(115, height+10) )
.bottom( Cove( 7 ) )
.top( Chamfer( 5, 12 ) )
.bottomTo( thickness )
.previewOnly()
val hole = if (holeDiameter > 0) {
Circle( holeDiameter/2 )
.smartExtrude( thickness + 0.02 )
.edges( roundedChamfer( thickness / 3 ).reverse() )
.bottomTo(-0.01)
} else {
null
}
if (brim > 0) {
return cup + fillet + base - hole + can
} else {
return cup.outsideBottom( roundedChamfer( thickness*2 ) ) + can
}
}
func variety() : Shape3d {
val coke = CanFoot().apply {
diameter = 66.8
}.coaster()
val cokeCosy = CanFoot().apply {
diameter = 66.8
height = 97
thickness = 6
}.coaster()
val redBull = CanFoot().apply {
diameter = 54
brim = 10
}.coaster()
val redBullCosy = CanFoot().apply {
diameter = 54
height = 124
}.coaster()
return arrangeX( coke, cokeCosy, redBull, redBullCosy )
}
@Piece( printable=false )
override fun build() = variety()
}