import static uk.co.nickthecoder.foocad.chamferedextrude.v1.ChamferedExtrude.* /** Glue to a bolt head, to make it easy to screw by hand. The default values are for an M8 bolt. Print Notes Use a brim due to the small contact area with the bed. */ class RoundBoltHead : Model { @Custom( about="Diameter and thickness of the final part" ) var size = Vector2(22,7) @Custom( about="Diameter of the bolt head between the vertices, not the edges" ) var boltHeadDiameter = 15.5 @Custom var boltHeadThickness = 5 @Custom( about="Default is 6 for a hex shape" ) var sides = 6 override fun build() : Shape3d { val hex = Circle( boltHeadDiameter/2 ).sides(6).roundAllCorners(boltHeadDiameter/16) return Circle( size.x/2 ) .sides(sides).roundAllCorners( size.x/10 ) .chamferedExtrude(size.y,1,0) - hex.extrude(boltHeadThickness+1).bottomTo(size.y - boltHeadThickness) } }