import static uk.co.nickthecoder.foocad.layout.Layout2d.* import static uk.co.nickthecoder.foocad.layout.Layout3d.* /* A simple lid for food and drink cans. NOTE, this is NOT air tight, especially for the drink cans (pressure will NOT build up). However, if I tip a can over, the liquid does not come out, but may well drip over time. I have two use cases in mind : 1) To cover up a half full can of drink (especially useful when I'm doing DIY) 2) For my Mum - When feeding canned dog food to her small dog, she doesn't use a full can in one sitting. She bought plastic tin can covers, but these weren't a tight fit, and fall off! Note, I don't expect the food to be in contact with the lid, so I don't think the plastic needs to be food grade. (In general do NOT use 3D printed parts for food, because the layer lines are a great place for food scraps to collect, and feed bacteria!) Print Notes. Print using TPU (or other rubbery material). Used all perimeters (e.g. 10) to avoid pockets where water could collect. */ class CanLid : Model { @Custom( about = "The external diameter of the can's lip" ) // Which is the internal diameter of this part (excluding the clip) // 53.8 for aluminum drink cans. // 74.5 for steel food tins var innerD = 53.8 // I've commented out the remaining "@Custom" lines, because I only want to change the diameter. //@Custom( about= "The thickness of the edges" ) var thickness = 3.0 //@Custom( about= "Thickness of the base" ) var baseT = 1.2 //@Custom( about= "The height of the can's lip" ) var lipH = 2.2 //@Custom( about="The height of the chamfered edge which clips onto the can" ) var clipH = 0.8 var extraHeight = 2.6 override fun build() : Shape3d { val profile = PolygonBuilder().apply { moveTo( 0,0 ) lineTo( innerD/2 + thickness, 0 ) lineTo( innerD/2 + thickness, baseT + extraHeight + lipH + clipH*2 ) lineTo( innerD/2, baseT + extraHeight + lipH + clipH*2 ) lineTo( innerD/2 - clipH, baseT + extraHeight+ lipH + clipH ) lineTo( innerD/2, baseT + lipH ) lineTo( innerD/2, baseT ) lineTo( 0, baseT ) }.build() .roundCorner(1,0.4,1) // Add a tiny chamfer and "fix" elephants foot. return profile.revolve() } }