/Electronics/PSUHack.foocad
I bought 2nd hand HP server power supply, just to use it as a 12V supply. So I want a small housing on one end to cover the connector.
These PSUs are cheap (2nd hand), very efficient, and very powerful. My first one will be for the 12V lighting in the garden (the PSU is inside!)
FYI, To turn the PSU on, connect pins 33 and 36 (Some PSUs require a resistor, others a short is fine. YMMV).
class PSUHack : Model { var size = Vector3(86.4, 39.7, 50.0) var endWidth = 10 var thickness = 1.6 @Piece fun end() : Shape3d { return Cube( size.x, size.y, endWidth ).center() - Cube( size - Vector3( thickness, thickness, endWidth+1 ) * 2 ) .center().translateZ( thickness ) } @Piece fun main() : Shape3d { val outside = Cube( size + Vector3( thickness, thickness, 0 ) * 2 ).centerXY() val inside = Cube( size ) .centerXY().translateZ( thickness ) val padHoles = Cylinder( 10, 1.5 ).center() and Cylinder( 100, 3 ).translate(7,7,-100).mirrorX().also().mirrorY().also() and Cylinder( 100, 4 ).rotateX(90).translate(6,10,-4).mirrorX().also() val pad = (Cube(25, 25, 6 ).centerXY() remove padHoles) .rotateX(90).bottomTo(0).translateY(6-size.y/2) .translateX(-size.x/4) // Layout3d doesn't play nicely with Cavity3d :-( Nor does "also" // So we've had to avoid using them. // Hopefully this will be fixed in a later version of foocad. val pads = pad and pad.mirrorX() return (outside-inside) and pads } override fun build() = main() }