#################################################################### # # Name: wheeltruss.scl # Author: Tim Jacobs # July 26, 1996 # Description: make wheel truss for railroad cars # #################################################################### { { innertrusswidth = 2.9; sidetrusslength = 3.0; bottrusswidth = innertrusswidth + 1.5; bottrusslength = 4.0; bottrussthick = 0.35; steerholeradius = 0.35; hubwidth = 0.34; huboffset = sidetrusslength/60; axleholeradius = 0.105; axleholedepth = 0.25; } # Wheel springs { springcrv = curve( 3, "ec_open", "kv_uniform", { pt( 0.1, 0, -0.04 ), pt( 0.1, 0, 0.01 ), pt( 0.07071, 0.07071, 0.01 ), pt( 0, 0.1, 0.02 ), pt( -0.07071, 0.07071, 0.03 ), pt( -0.1, 0, 0.04 ), pt( -0.07071, -0.07071, 0.05 ), pt( 0, -0.1, 0.06 ), pt( 0.07071, -0.07071, 0.07 ), pt( 0.1, 0, 0.08 ), pt( 0.07071, 0.07071, 0.09 ), pt( 0, 0.1, 0.10 ), pt( -0.07071, 0.07071, 0.11 ), pt( -0.1, 0, 0.12 ), pt( -0.07071, -0.07071, 0.13 ), pt( 0, -0.1, 0.14 ), pt( 0.07071, -0.07071, 0.15 ), pt( 0.1, 0, 0.16 ), pt( 0.07071, 0.07071, 0.17 ), pt( 0, 0.1, 0.18 ), pt( -0.07071, 0.07071, 0.19 ), pt( -0.1, 0, 0.20 ), pt( -0.07071, -0.07071, 0.21 ), pt( 0, -0.1, 0.22 ), pt( 0.07071, -0.07071, 0.23 ), pt( 0.1, 0, 0.24 ), pt( 0.07071, 0.07071, 0.25 ), pt( 0, 0.1, 0.26 ), pt( -0.07071, 0.07071, 0.27 ), pt( -0.1, 0, 0.28 ), pt( -0.07071, -0.07071, 0.29 ), pt( 0, -0.1, 0.30 ), pt( 0.07071, -0.07071, 0.31 ), pt( 0.1, 0, 0.32 ), pt( 0.07071, 0.07071, 0.33 ), pt( 0, 0.1, 0.34 ), pt( -0.07071, 0.07071, 0.35 ), pt( -0.1, 0, 0.36 ), pt( -0.07071, -0.07071, 0.37 ), pt( 0, -0.1, 0.38 ), pt( 0.07071, -0.07071, 0.39 ), pt( 0.1, 0, 0.40 ), pt( 0.1, 0, 0.45 ) } ); spring1 = objTransform( circTubeConstantWidth( springcrv, 0.03, true ), { rx( 90 ), ry( 45 ), sxyz( 1, 1, 1 ) } ); spring2 = objTransform( spring1, tx( 0.3 ) ); springset = group( spring1, spring2 ); springsetside = objTransform( springset, { ry( 180 ), txyz( 1.65, -0.175, 0.125 ) } ); springset1 = objTransform( springset, txyz( 0.55, -0.02, 0.375 ) ); springset2 = objTransform( springset, { ry( 180 ), txyz( 0.85, -0.02, bottrusswidth - 0.375 ) } ); } # Solid substitute for springs to be used in stereo lithography { springcylprofile1 = uniOpCrv( 3, array( pt( 0.1, 0.02, 0 ), pt( 0.13, -0.035, 0 ), pt( 0.1, -0.09, 0 ) ) ); springcylprofile2 = uniOpCrv( 3, array( pt( 0.1, -0.09, 0 ), pt( 0.13, -0.145, 0 ), pt( 0.1, -0.2, 0 ) ) ); springcylprofile3 = uniOpCrv( 3, array( pt( 0.1, -0.2, 0 ), pt( 0.13, -0.255, 0 ), pt( 0.1, -0.31, 0 ) ) ); springcylprofile4 = uniOpCrv( 3, array( pt( 0.1, -0.31, 0 ), pt( 0.13, -0.365, 0 ), pt( 0.1, -0.42, 0 ) ) ); springcylprofile6 = crvConcat( array( springcylprofile1, springcylprofile2, springcylprofile3, springcylprofile4 ), 3 ); springcyl1 = srfOfRevolution( yaxis, springcylprofile6, true ); springcyl2 = objTransform( springcyl1, tx( 0.3 ) ); springcylset = group( springcyl1, springcyl2 ); springcylset1 = objTransform( springcylset, txyz( 0.55, -0.02, 0.375 ) ); springcylset2 = objTransform( springcylset, { ry( 180 ), txyz( 0.85, -0.02, bottrusswidth - 0.375 ) } ); } # Side Truss { # first make top surface topcurve1 = uniOpCrv( 3, { pt( sidetrusslength, 0, 0 ), pt( 2*sidetrusslength/3, 0.2, 0 ), pt( sidetrusslength/3, 0.2, 0 ), pt( 0, 0, 0 ) } ); topcurve2 = objTransform( reverseObj( topcurve1 ), ty( 0.2 ) ); topcurve3 = profile( pt( 0, 0, 0 ), pt( 0, 0.2, 0 ) ); topcurve4 = objTransform( reverseObj( topcurve3 ), tx( 3 ) ); topcurve5 = crvConcat( { topcurve3, topcurve2, topcurve4, topcurve1 }, 3 ); topsurface1 = extrudeDir( topcurve5, vec( 0, 0, 0.25 ), true ); # make bottom surface botcurve1 = reverseObj( profile( pt( sidetrusslength/2, -0.6, 0 ), pt( sidetrusslength/2.5, -0.6, 0 ), pt( sidetrusslength/2.5, 0.2, 0 ), pt( sidetrusslength/3, 0.2, 0 ), pt( sidetrusslength/3, -0.3, 0 ), pt( sidetrusslength/3.75, -0.5, 0 ), pt( sidetrusslength/10, -0.25, 0 ), pt( sidetrusslength/10, 0.1, 0 ), pt( 0.0005, 0.001, 0 ), pt( 0, -0.3, 0 ), pt( sidetrusslength/3, -0.8, 0 ), pt( sidetrusslength/2, -0.8, 0 ) ) ); botcurve2 = reverseObj( objTransform( botcurve1, { ry( 180 ), tx( 3 ) } ) ); botcurve3 = crvConcat( { botcurve1, botcurve2 } ); botsurface1 = extrudeDir( botcurve3, vec( 0, 0, 0.249 ), true ); botsurface2 = objTransform( botsurface1, txyz( 0.000, 0, 0.0005 ) ); # build axle hub hubcurve1 = profile( pt( 0, 0.001, 0.001 ), pt( 0, -0.5, 0.001 ), pt( 0, -0.45, 0.5 ), pt( 0, -0.04, 0.4 ), pt( 0, 0.001, 0.001 ) ); hubsurf1 = extrudeDir( hubcurve1, vec( hubwidth, 0, 0 ), true ); subcurve1 = profile( pt( 0.01, 0.101, -0.001 ), pt( 0.01, -0.601, -0.001 ), pt( 0.01, -0.601, 0.6 ), pt( 0.01, 0.101, 0.6 ), pt( 0.01, 0.101, -0.001 ) ); subsurf = extrudeDir( reverseObj( subcurve1 ), vec( -0.2, 0, 0 ), true ); subsurf1 = objTransform( subsurf, ry( 5 ) ); hubsurface1 = combineShells( hubsurf1, subsurf1, "-" ); subsurf2 = objTransform( subsurf, { ry( -5 ), tx( hubwidth + 0.2 - 0.002 ) } ); hubsurface2 = combineShells( hubsurface1, subsurf2, "-" ); hubsurface3 = objTransform( hubsurface2, txyz( -huboffset - 0.002, -0.01, 0 ) ); # make other axle hub hubsurface4 = objTransform( hubsurface3, tx( sidetrusslength - hubwidth + 2*huboffset) ); # make axle holes for hub axlehole1 = reverseObj( srfOfRevolution( lineThru2Pts( pt( hubwidth/2 - huboffset, -0.331, -0.01 ), pt( hubwidth/2 - huboffset, -0.331, 1.002 ) ), profile( pt( hubwidth/2 - huboffset + axleholeradius, -0.331, -0.01 ), pt( hubwidth/2 - huboffset + axleholeradius, -0.331, axleholedepth ) ), true ) ); axleholeold = hole( anchor( pt( hubwidth/2 - huboffset, -0.331, -0.002 ), xdir, ydir, zdir ), 2 * axleholeradius, axleholedepth, 0, false ); axlehole2 = objTransform( axlehole1, tx( sidetrusslength - hubwidth + 2*huboffset ) ); } { # combine into complete side truss botsurface3 = combineShells( botsurface2, springsetside, "-" ); sidetrusstemp1 = combineShells( botsurface3, hubsurface3, "+" ); sidetrusstemp2 = combineShells( sidetrusstemp1, axlehole1, "-" ); sidetrusstemp3 = combineShells( sidetrusstemp2, hubsurface4, "+" ); sidetrusstemp4 = combineShells( sidetrusstemp3, axlehole2, "-" ); sidetrusstemp5 = objTransform( sidetrusstemp4, { sxyz( 0.996, 0.996, 0.996 ), txyz ( 0.002, 0.002, 0.002 ) } ); sidetruss = combineShells( sidetrusstemp5, topsurface1, "+" ); sidetruss1 = objTransform( sidetruss, txyz( -0.801, 0.149, bottrusswidth - 0.50 ) ); sidetruss2 = objTransform( sidetruss, { ry( 180 ), txyz( 2.201, 0.149, 0.50 ) } ); } # Bottom truss { curve1 = profile( pt( 0.0, 0, 1.75 ), pt( 0.0, 0, 1.5 ), pt( 0.4, 0, 1.2 ), pt( 0.4, 0, 0 ), pt( 1.0, 0, 0 ), pt( 1.0, 0, 1.2 ), pt( 2.5, 0, 1.2 ), pt( 2.5, 0, 1.6 ), pt( 4.0, 0, 1.6 ), pt( 4.0, 0, 1.75 ) ); curve2 = reverseObj( objTransform( curve1, { rx( 180 ), tz( 3.5 ) } ) ); curve3 = crvConcat( { curve1, curve2 } ); curve4 = objTransform( curve3, sxyz( bottrusslength/4.0, 1, bottrusswidth/3.5 ) ); surface1 = extrudeDir( curve4, vec( 0, bottrussthick, 0 ), true ); anchor1 = anchor( pt( 0.45, 0.25, 0 ), xdir, ydir, vec( 0, 0, -1 ) ); anchor2 = anchor( pt( 0, 0, 0 ), xdir, ydir, zdir ); pocket1 = rectangularPocket( anchor2, 0.225, 0.20, 0.2, 0, 0, 0, 0 ); twopockets1 = linearPattern( anchor1, pocket1, 2, 0.275, true ); anchor3 = offsetAnchor( rotateAnchor( anchor1, 0, 180, 0 ), 0.5, 0, bottrusswidth ); twopockets2 = linearPattern( anchor3, pocket1, 2, 0.275, true ); steerhole = hole( anchor( pt( 0.7, 0, bottrusswidth/2 ), xdir, zdir, ydir ), steerholeradius * 2, 0.35, 0, true ); } { # combine into single bottom truss temptruss = combineShells( surface1, twopockets1, "-" ); bottomtruss = combineShells( temptruss, twopockets2, "-"); # take out overlap between bottom and sides bottomtruss1 = combineShells( bottomtruss, sidetruss1, "-" ); bottomtruss2 = combineShells( bottomtruss1, sidetruss2, "-" ); bottomtruss3 = combineShells( bottomtruss2, springset1, "-" ); bottomtruss4 = combineShells( bottomtruss3, springset2, "-" ); # take out for steering axle bottomtruss5 = combineShells( bottomtruss4, steerhole, "-" ); } #combine into a complete truss wheeltruss = group( bottomtruss5, sidetruss1, sidetruss2, springset1, springset2 ); wheeltruss_stl = group( bottomtruss5, sidetruss1, sidetruss2, springcylset1, springcylset2 ); setSq( wheeltruss, "Plastic" ); setColor( wheeltruss, "DarkSlateGray" ); include "wheels.scl"; wheelset1 = objTransform( wheelset, { ry( 90 ), txyz( -0.67, -0.20, bottrusswidth/2 ) } ); wheelset2 = objTransform( wheelset1, tx( sidetrusslength - hubwidth + 2*huboffset - 0.01 ) ); wheelsandtruss1 = group( wheeltruss, wheelset1, wheelset2 ); wheelsandtruss = objTransform( wheelsandtruss1, { txyz( -0.7, 0, -bottrusswidth/2 ) } ); }