FooCAD Source Codeimport static uk.co.nickthecoder.foocad.changefilament.ChangeFilament.*
class Giddyserv : Model, PostProcessor {
var thickness = 0.6
var bump = 0.6
override fun build() : Shape3d {
val style = TextStyle( "DEFAULT_FONT", 7 )
val qr = SVGParser().parseFile("giddyserv-qr.svg").shapes["qr"].scale( 2.5 ).centerX()
val giddyserv = Text( "http://giddyserv", style ).centerX().backTo( qr.front - 5)
val password = Text( "wfWPAp!sbf&f", style ).centerX().frontTo( qr.back + 5)
val router = Text( "WiFi : thomson", style).centerX().frontTo( password.back )
val stuff = qr + giddyserv + router + password
val card = stuff.boundingSquare().offset( 10 ).roundAllCorners( 5 )
return stuff.extrude( thickness + bump ).color( "white" ) +
card.extrude( thickness ).color( "blue" )
}
// This is the main focus of this example! Also not that the class must implement PostProcessor.
override fun postProcess(gcode: GCode) {
//gcode.pauseAtHeight( bottomIndent, "Change Filament" )
//gcode.pauseAtHeight( thickness - topIndent, "Change Filament" )
}
}