/Bottles/SloeGinLabel.foocad

I make Sloe Gin each year, and I need a label for the bottles. The rings keep the letters in place!
Super glue in place - maybe curve the plastic while it is warm first???
import uk.co.nickthecoder.foocad.layers.v1.Layer
import uk.co.nickthecoder.foocad.layers.v1.Layers
import static uk.co.nickthecoder.foocad.layers.v1.Layers.*
class SloeGinLabel : AbstractModel() {
var width = 70
var filamentOffset = 45
val ringsLayer = Layer( "rings", 0.4, "Black" )
val textLayer = Layer( "text", 1.0, "Red" )
@Custom
var year = "2021"
fun circle(size : double, thickness : double) =
(Circle( size + thickness/2 ) - Circle( size - thickness / 2 ))
@Piece
fun year() : Shape3d {
val year2d = Text( year, BOLD, 11 ).center()
return year2d.extrude( textLayer ) +
year2d.offset(2).extrude( ringsLayer )
}
@Piece
fun main() : Shape3d {
val rings =
circle( width * 0.11, 1 ) +
circle( width * 0.22, 2 ) +
circle( width*0.33, 3) +
circle( width*0.44, 4 )
val fromSVG = SVGParser().parseFile( "sloeGinLabel.svg" )
.shapes["text"]
.center()
val year2d = Text( year, BOLD, 9 ).translate( 9, -6 )
return fromSVG.scale( width / fromSVG.size.x ).extrude( textLayer ) +
rings.extrude( ringsLayer )
}
override fun build() : Shape3d {
return main().frontTo( 5 ) + year().backTo(0)
}
/*
override fun postProcess(piece : String, gcode: GCode) {
postProcess( gcode, ringsLayer, textLayer )
}
*/
}

