/Garden/ChairPigeonDefense.foocad

I place these on the top of my garden chairs to stop birds pirching.
They are a little flimsy, and at least one has broken.
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.*
import static uk.co.nickthecoder.foocad.extras.v1.Extras.*
class ChairPigeonDefense : AbstractModel() {
var width = 420/3
var gap = 2.5
var pointyThickness = 1.2
var baseSize = Vector3( 30, 1.2, 12 )
var overlap = 6
var slack = 0.3
var pointSize = Vector2( 6, 10 )
@Piece
fun pointy() : Shape3d {
val point = Isosceles( pointSize.x, pointSize.y )
val points = point.tileXWithin( width ).scaleXTo( width )
.chamferedExtrude(pointyThickness,pointyThickness*0.4).centerX()
val extra = Square( width, overlap ).centerX().backTo(pointyThickness*0.4)
.extrude( pointyThickness )
return points + extra
}
@Piece
fun base() : Shape3d {
val base = Cube( baseSize.x, baseSize.y*2 + gap + slack, baseSize.z + baseSize.y ).centerXY() +
Cube( baseSize.x, baseSize.y, overlap ).bottomTo( baseSize.z+baseSize.y ).centerXY().frontTo(gap/2+slack/2) -
Cube( baseSize.x+2, gap, baseSize.z + 1 ).centerXY().bottomTo(-1)
return base.rotateY(-90).bottomTo(0)
}
@Piece
fun both() = pointy().frontTo(1) + base().backTo(-1)
override fun build() : Shape3d {
val pointy : Shape3d = pointy().rotateX(90).topTo( 30 ).centerY().color("Green")
val ends = base().rotateY(90).leftTo(pointy.left).mirrorX().also()
return pointy + ends
}
}

