import static uk.co.nickthecoder.foocad.chamferedextrude.v1.ChamferedExtrude.* import static uk.co.nickthecoder.foocad.screws.v1.Screws.* class IroningBoardHanger : Model { var thickness = 25.0 var chamfer = 1.0 override fun build() : Shape3d { val profile = PolygonBuilder().apply { val wall = 8 moveTo(0,0) lineTo(0, 80) radius(wall) lineTo(wall, 80) lineTo(wall, 80-wall) radius(0) lineTo(wall, 80-wall-10) val dx = 28 val dy = -9 val tx = wall + dx val ty = 80-wall-10 + dy circularArcTo( tx, ty, 30/2, false, true ) circularArcTo( tx+5, ty, 2.3, true, false ) bezierTo( Vector2(tx+5,ty-20), Vector2(10,0), Vector2(0,0) ) }.build() val hanger = profile.chamferedExtrude( thickness, chamfer ) val hole = countersink( 3, 10, 30, 36 ).rotateY(90).leftTo(-0.01).translateZ(thickness/2) val holes = hole.frontTo(55).frontTo(10).also() val circle = Circle( 30/2 ).translate(23,61).extrude(1).previewOnly() return hanger + circle - holes } }