/Bike/BungeeClip.foocad
A clip for bungee cord, to attach to my bike's pannier. The basic shape was copied from ../Bike/pannierClip.svg
Each clip has three holes. Use them as you see fit.
For a simple cord, only 1 hole is required.
Notes
They get tangled very easily! I no longer use them, as I've changed the way I use my pannier rack.
import static uk.co.nickthecoder.foocad.layout.v1.Layout2d.* import static uk.co.nickthecoder.foocad.layout.v1.Layout3d.* import static uk.co.nickthecoder.foocad.chamferedextrude.v1.ChamferedExtrude.* class BungeeClip : Model { @Custom var thickness = 14 @Custom var chamfer = 1.5 @Custom var holeSize = Vector2( 3, 3 ) @Custom var holeCount = 3 override fun build() : Shape3d { val doc = SVGParser().parseFile( "bungeeClip.svg" ) val fiveShape = doc.shapes["fivecm"] // A 5cm rectangle. Used to scale to the correct size. val scale = 50.0 / fiveShape.size.x val mainShape = doc.shapes["main"].scale(scale) val holeShape = doc.shapes["hole"].scale(scale) val main = mainShape.chamferedExtrude( thickness, 1 ) val hole = holeShape .scaleY( holeSize.y / holeShape.size.y ) .centerTo( holeShape.middle ) .extrude( holeSize.x ) val holes = hole.repeatZ( holeCount, (thickness-chamfer)/holeCount ).centerZTo(main.middle.z ) return (main - holes).centerXY() } }