import static uk.co.nickthecoder.foocad.screws.v1.Screws.* class HoseClip : Model { @Custom( about="Slightly larger than the diameter of the pipe. 15.5 to 17 for half inch hose pipes." ) var innerD = 15.5 @Custom( about="Thickness of the ring. Too thin and it will break, but fat will mean it will not bend" ) var thickness = 3.5 @Custom( about="Width of the ring. The base is slightly wider than the ring." ) var width = 9 override fun build() : Shape3d { val sphere = Sphere( innerD/2 + thickness ) .translateZ(-2) val hole = Cylinder( innerD/2 + thickness * 2 + 2, innerD/2 ).center().rotateX(90) val foo = 2 val flatten = ( Cube( innerD+thickness*2+2, width, innerD ).center() + Cylinder( innerD * 2, width/2 ).center().rotateY(90).translateZ(innerD/2) ).translateZ(-thickness-width/2) val ring = sphere / flatten remove hole val base = Sphere( width ).scale(1,0.7, 1.1) / Cube( width *2 ).center().bottomTo(0) val screwHole = countersink( 4, 8, 3, 30 ).topTo(thickness+3) return (ring.bottomTo(0) and base.bottomTo(0)) remove screwHole } }