import static uk.co.nickthecoder.foocad.chamferedextrude.v1.ChamferedExtrude.* import static uk.co.nickthecoder.foocad.screws.v1.Screws.* import static uk.co.nickthecoder.foocad.extras.v1.Extras.* /* This is a port of one of my earliest OpenSCAD model. After many years, the tiny piece of PLA broke, and so I needed to print another one. Rather than get the old version working (it used 3 imports ("use") who's files have gone astray), I rewrote it in foocad. FYI, this version is about 1/3 the size, and is much more readable ;-) Print Notes The originals were printed in white PLA, but the replacement was printed in transparent PETG which is hopefully stronger, as PETG flexes a little more. I had to add a large brim (7mm) because without it, I just got a sticky mass on the print head. */ class CurtainRodClip : Model { var holeD=9.6 var thickness=2 var extra=5 var depth=10 var angle=240 var screw=Vector2(4,8) var chamfer = 0.5 override fun build() : Shape3d { val width = holeD + thickness * 2 val profile = Segment( width/2, -angle/2, angle/2 ).hull( Square( extra, width ).centerY().translateX(width/2) ) - Circle( holeD/2 ) val screwHole = countersink( screw.x, screw.y, holeD/2,30 ).rotateY(-90) .translateZ( depth/2 ) return profile.chamferedExtrude( depth, chamfer ) - screwHole } }