Exit Full View
Up

/Electronics/Grommet.foocad

Grommet
FooCAD Source Code
class Grommet : Model {
    
    var cableD = 7.5

    var holeD = 14.5

    var extra = Vector2(3.0, 2.0)

    var thickness = 10.0

    override fun build() : Shape3d {

        val crossSection = PolygonBuilder().apply {
            moveTo( cableD/2, 0 )
            lineTo( holeD/2 + extra.x, 0 )
            lineBy( 0, extra.y )
            lineBy( -extra.x, 0 )
            lineBy( 0, thickness )
            lineTo( cableD/2, thickness + extra.y )     

        }.build()
    

        val grommet = crossSection.revolve()

        return grommet

    }
}