#################################################################### # # Name: caboose.scl # Author: Tim Jacobs # July 26, 1996 # Description: Main file for model of caboose # #################################################################### # The caboose consists of the following components: # Main walls (all one piece) (includes windows and doors) # Main roof # Top walls (all one piece) (includes windows and doors) # Top roof # Base (includes stairs and rails) # 2 wheel trusses with wheels { { # variables # center of caboose basecenter = pt( 0, 0, 0 ); # width, height, distance to front, back, left, and right # of main caboose walls. mainwidth = 4.6; mainheight = 4.5; mainback = -6.0; mainfront = 6.0; mainleft = - ( mainwidth / 2.0 ); mainright = ( mainwidth / 2.0 ); # distance of center of wheel truss to center of cabooses trussoffset = 1.9; # amount roof extends forward and behind walls roofextend = 0.89; # distance to center of truss (wheelradius + flange - 0.2 + clearance) wheeltrussheight = 1.02; # distance to top of truss (trussheight - trussthick - clearance) wheeltrusstop = wheeltrussheight - 0.35 - 0.02; # radius of column on which wheeltruss rotates (radius of hole - clearance) wheelcolumnradius = 0.345; # base rib height baseribheight = 0.35; } # make base of caboose { # rails and stairs are incorporated into base include "rail-stairs.scl"; { baseprofile = profile( pt( 0, 0.005, mainleft + 0.07 ), pt( 0, 0.005, mainright - 0.07 ), pt( 0, 0.07, mainright - 0.07 ), pt( 0, 0.07, mainleft + 0.07 ), pt( 0, 0.005, mainleft + 0.07 ) ); base1 = extrude( baseprofile, pt( mainback - 1, 0, 0 ), pt( mainfront + 1, 0, 0 ), true ); # Need a column for the wheel trusses to turn on wheelcolumntemp = rightCirCylinder( pt( 0, -baseribheight + 0.02, 0 ), vec( 0, -wheeltrussheight + baseribheight - 0.17, 0 ), wheelcolumnradius ); wheelcolumnstop = rightCirCylinder( pt( 0, -wheeltrusstop, 0 ), vec( 0, 0.15, 0 ), wheelcolumnradius + 0.2 ); wheelcolumn = combineShells( wheelcolumntemp, wheelcolumnstop, "+" ); wheelcolumnholdtemp1 = objTransform( wheelcolumnstop, ty( -wheeltrussheight - 0.149 + wheeltrusstop ) ); wheelcolumnhold = combineShells( wheelcolumnholdtemp1, wheelcolumntemp, "-" ); wheelcolumnhold1 = objTransform( wheelcolumnhold, tx( mainfront - trussoffset ) ); wheelcolumnhold2 = objTransform( wheelcolumnhold1, ry( 180 ) ); wheelcolumnholdgroup = group( wheelcolumnhold1, wheelcolumnhold2 ); # make ribs to support base ribprofiletmp = profile( pt( 0, 0.007, mainleft + 0.068 ), pt( 0, 0.007, mainright - 0.068 ), pt( 0, -baseribheight, wheelcolumnradius + 0.1 ), pt( 0, -baseribheight, -wheelcolumnradius - 0.1 ), pt( 0, 0.007, mainleft + 0.068 ) ); ribprofile = reverseObj( ribprofiletmp ); wheeltrussribtemp = extrude( ribprofile, pt( -wheelcolumnradius - 0.1, 0, 0 ), pt( wheelcolumnradius + 0.1, 0, 0 ), true ); wheeltrussrib = combineShells( wheeltrussribtemp, wheelcolumn, "+" ); centerrib = extrude( ribprofile, pt( -0.10, 0, 0 ), pt( 0.10, 0, 0 ), true ); wheeltrussrib1 = objTransform( wheeltrussrib, tx( mainfront - trussoffset ) ); wheeltrussrib2 = objTransform( wheeltrussrib, tx( mainback + trussoffset ) ); centerrib1 = objTransform( centerrib, tx( -0.7 ) ); centerrib2 = objTransform( centerrib, tx( 0.7 ) ); longribprofile = profile( pt( mainfront - trussoffset, 0.008, 0 ), pt( mainback + trussoffset, 0.008, 0 ), pt( mainback + trussoffset, -baseribheight + 0.002, 0 ), pt( mainfront - trussoffset, -baseribheight + 0.002, 0 ), pt( mainfront - trussoffset, 0.008, 0 ) ); longrib = extrude( reverseObj( longribprofile ), pt( 0, 0, -0.10 ), pt( 0, 0, 0.10 ), true ); longrib1 = objTransform( longrib, tz( -wheelcolumnradius + 0.052 ) ); longrib2 = objTransform( longrib, tz( wheelcolumnradius - 0.052 ) ); ribgroup = group( wheeltrussrib1, wheeltrussrib2, centerrib1, centerrib2, longrib1, longrib2 ); # stairs go on each corner of the base. Make a place for the stairs by # subtracting out part of the base. stairsub1 = objTransform( stairsub, txyz( mainback - 1 + 0.004, 0.07, 0 ) ); stairset1 = objTransform( stairset, txyz( mainback - 1 + 0.004, 0.077, 0.04 ) ); stairsub2 = objTransform( stairsub, txyz( mainfront + 1 - stairsetwidth - 0.004, 0.07, 0 ) ); stairset2 = objTransform( stairset, txyz( mainfront + 1 - stairsetwidth - 0.004, 0.077, 0.04 ) ); stairsubgroupa = group( stairsub1, stairsub2 ); stairsetgroupa = group( stairset1, stairset2 ); stairsubgroupb = objTransform( stairsubgroupa, ry( 180 ) ); stairsetgroupb = objTransform( stairsetgroupa, ry( 180 ) ); stairsubgroup = group( stairsubgroupa, stairsubgroupb ); stairsetgroup = group( stairsetgroupa, stairsetgroupb ); # make a rail for each end of the base rail1 = objTransform( rail, txyz( mainback - 1 + railradius + 0.002, 0.07, 0 - 0.002 ) ); rail2 = objTransform( rail1, ry( 180 ) ); } # Now put all the parts of the base together. base2 = combineShells( base1, stairsubgroup, "-" ); base3 = combineShells( base2, rail1, "+" ); base4 = combineShells( base3, rail2, "+" ); base5 = combineShells( base4, wheeltrussrib1, "+" ); base6 = combineShells( base5, wheeltrussrib2, "+" ); base7 = combineShells( base6, centerrib1, "+" ); base8 = combineShells( base7, centerrib2, "+" ); base9 = combineShells( base8, longrib1, "+" ); base10 = combineShells( base9, longrib2, "+" ); base = combineShells( base10, stairsetgroup, "+" ); # Build a profile of the base to subtract from the walls basesubprofile = profile( pt( 0, -1.005, mainleft + 0.07 ), pt( 0, -1.005, mainright - 0.07 ), pt( 0, 0.07, mainright - 0.07 ), pt( 0, 0.07, mainleft + 0.07 ), pt( 0, -1.005, mainleft + 0.07 ) ); basesub = extrude( basesubprofile, pt( mainback - 1, 0, 0 ), pt( mainfront + 1, 0, 0 ), true ); } # make main roof { # roof profile roofcurve1 = crvFromArc( arcThru3Pts( pt( 0, mainheight - 0.7, mainleft + 0.06 ), pt( 0, mainheight, 0 ), pt( 0, mainheight - 0.7, mainright - 0.06 ) ) ); roofcurve2 = profile( pt( 0, mainheight - 0.7, mainright - 0.06 ), pt( 0, mainheight - 0.74, mainright - 0.06 ), pt( 0, mainheight - 0.82, mainright + 0.03 ), pt( 0, mainheight - 0.86, mainright + 0.03 ) ); roofcurve3 = crvFromArc( arcThru3Pts( pt( 0, mainheight - 0.86, mainright + 0.03 ), pt( 0, mainheight - 0.10, 0 ), pt( 0, mainheight - 0.86, mainleft - 0.03 ) ) ); roofcurve4 = profile( pt( 0, mainheight - 0.86, mainleft - 0.03 ), pt( 0, mainheight - 0.82, mainleft - 0.03 ), pt( 0, mainheight - 0.74, mainleft + 0.06 ), pt( 0, mainheight - 0.7, mainleft + 0.06 ) ); mainroofprofile = crvConcat( array( roofcurve1, roofcurve2, roofcurve3, roofcurve4 ), 3 ); # roof surface mainroof1 = reverseObj( extrude( mainroofprofile, pt( mainback - roofextend, 0, 0 ), pt( mainfront + roofextend, 0, 0 ), true ) ); } # build solid with same bottom as roof to subtract from walls { roofsubcurve1 = profile( pt( 0, mainheight - 0.86, mainleft - 0.03 ), pt( 0, mainheight + 1, mainleft - 0.03 ), pt( 0, mainheight + 1, mainright + 0.03 ), pt( 0, mainheight - 0.86, mainright + 0.03 ) ); roofsubprofile = reverseObj( crvConcat( { roofcurve3, roofsubcurve1 }, 3 ) ); roofsub = extrude( roofsubprofile, pt( mainback - roofextend, 0, 0 ), pt( mainfront + roofextend, 0, 0 ), true ); } # build solid with same top as roof to subtract from top walls { roofsubcurve2 = profile( pt( 0, mainheight - 0.7, mainright - 0.06 ), pt( 0, mainheight - 1.7, mainright -0.06 ), pt( 0, mainheight - 1.7, mainleft + 0.06 ), pt( 0, mainheight - 0.7, mainleft + 0.06 ) ); roofsub2profile = crvConcat( { roofcurve1, roofsubcurve2 }, 3 ); roof2sub = extrude( roofsub2profile, pt( mainfront + roofextend, 0, 0 ), pt( mainback - roofextend, 0, 0 ), true ); } # make walls of main caboose body { include "doors-windows.scl"; mainprofile = profile( pt( mainback, 0, mainleft ), pt( mainfront, 0, mainleft ), pt( mainfront, 0, mainright ), pt( mainback, 0, mainright ), pt( mainback, 0, mainleft ) ); mainoutwall = extrude( mainprofile, pt( 0, -0.1, 0 ), pt( 0, mainheight,0 ), true ); maininwall = objTransform( mainoutwall, { sxyz( 0.98, 1.5, 0.95 ), ty( -0.5 ) } ); setColor( maininwall, "Black" ); # Position the windows and doors { mainwindow1anchor = anchor( pt( mainback + 4.0, mainheight - 1.4, mainright ), xdir, ydir, zdir ); mainwindow1in1 = alignPosnAndZ( window2in1, windowanchor, mainwindow1anchor ); mainwindow1in2 = alignPosnAndZ( window2in2, windowanchor, mainwindow1anchor ); mainwindow1out = alignPosnAndZ( window2out, windowanchor, mainwindow1anchor ); mainwindow2anchor = anchor( pt( mainback + 7.5, mainheight - 1.4, mainright ), xdir, ydir, zdir ); mainwindow2in1 = alignPosnAndZ( window2in1, windowanchor, mainwindow2anchor ); mainwindow2in2 = alignPosnAndZ( window2in2, windowanchor, mainwindow2anchor ); mainwindow2out = alignPosnAndZ( window2out, windowanchor, mainwindow2anchor ); mainwindow3anchor = anchor( pt( mainback + 10.0, mainheight - 1.4, mainright ), xdir, ydir, zdir ); mainwindow3in1 = alignPosnAndZ( window2in1, windowanchor, mainwindow3anchor ); mainwindow3in2 = alignPosnAndZ( window2in2, windowanchor, mainwindow3anchor ); mainwindow3out = alignPosnAndZ( window2out, windowanchor, mainwindow3anchor ); mainwindow4anchor = anchor( pt( mainback + 4.0 + windowwidth, mainheight - 1.4, mainleft ), vec( -1, 0, 0 ), vec( 0, -1, 0 ), vec( 0, 0, -1 ) ); mainwindow4in1 = alignPosnAndZ( window2in1, windowanchor, mainwindow4anchor ); mainwindow4in2 = alignPosnAndZ( window2in2, windowanchor, mainwindow4anchor ); mainwindow4out = alignPosnAndZ( window2out, windowanchor, mainwindow4anchor ); mainwindow5anchor = anchor( pt( mainback + 7.5 + windowwidth, mainheight - 1.4, mainleft ), vec( -1, 0, 0 ), vec( 0, -1, 0 ), vec( 0, 0, -1 ) ); mainwindow5in1 = alignPosnAndZ( window2in1, windowanchor, mainwindow5anchor ); mainwindow5in2 = alignPosnAndZ( window2in2, windowanchor, mainwindow5anchor ); mainwindow5out = alignPosnAndZ( window2out, windowanchor, mainwindow5anchor ); mainwindow6anchor = anchor( pt( mainback + 10.0 + windowwidth, mainheight - 1.4, mainleft ), vec( -1, 0, 0 ), vec( 0, -1, 0 ), vec( 0, 0, -1 ) ); mainwindow6in1 = alignPosnAndZ( window2in1, windowanchor, mainwindow6anchor ); mainwindow6in2 = alignPosnAndZ( window2in2, windowanchor, mainwindow6anchor ); mainwindow6out = alignPosnAndZ( window2out, windowanchor, mainwindow6anchor ); mainwindow7anchor = anchor( pt( mainback + 0.5 + windowwidth, mainheight - 1.4, mainleft ), vec( -1, 0, 0 ), vec( 0, -1, 0 ), vec( 0, 0, -1 ) ); mainwindow7in1 = alignPosnAndZ( window2in1, windowanchor, mainwindow7anchor ); mainwindow7in2 = alignPosnAndZ( window2in2, windowanchor, mainwindow7anchor ); mainwindow7out = alignPosnAndZ( window2out, windowanchor, mainwindow7anchor ); mainwindow8anchor = anchor( pt( mainback + 5.5 + windowwidth, mainheight - 1.4, mainleft ), vec( -1, 0, 0 ), vec( 0, -1, 0 ), vec( 0, 0, -1 ) ); mainwindow8in1 = alignPosnAndZ( window2in1, windowanchor, mainwindow8anchor ); mainwindow8in2 = alignPosnAndZ( window2in2, windowanchor, mainwindow8anchor ); mainwindow8out = alignPosnAndZ( window2out, windowanchor, mainwindow8anchor ); maindoor1anchor = anchor( pt( mainback, mainheight - 1.4, 0 - doorwidth / 2.0 ), vec( 0, 0, 1 ), vec( 0, -1, 0 ), vec( -1, 0, 0 ) ); maindoor1in1 = alignPosnAndZ( door2in1, windowanchor, maindoor1anchor ); maindoor1in2 = alignPosnAndZ( door2in2, windowanchor, maindoor1anchor ); maindoor1out = alignPosnAndZ( door2out, windowanchor, maindoor1anchor ); maindoor2anchor = anchor( pt( mainfront, mainheight - 1.4 - 0.001, 0 + doorwidth / 2.0 + 0.001), vec( 0, 0, -1 ), vec( 0, 1, 0 ), vec( 1, 0, 0 ) ); maindoor2in1 = alignPosnAndZ( door2in1, windowanchor, maindoor2anchor ); maindoor2in2 = alignPosnAndZ( door2in2, windowanchor, maindoor2anchor ); maindoor2out = alignPosnAndZ( door2out, windowanchor, maindoor2anchor ); windowInGroup1 = group( mainwindow1in1, mainwindow2in1, mainwindow3in1, mainwindow4in1, mainwindow5in1, mainwindow6in1, mainwindow7in1, mainwindow8in1, maindoor1in1, maindoor2in1 ); } # Combine windows and doors into walls; subtract portion of walls # below base and above roof. tempgroup = group( basesub, roofsub ); mainwall1 = combineShells( mainoutwall, maininwall, "-" ); mainwall2 = combineShells( mainwall1, maindoor1out, "+" ); mainwall3 = combineShells( mainwall2, maindoor2out, "+" ); mainwall4 = combineShells( mainwall3, maindoor1in2, "-" ); mainwall5 = combineShells( mainwall4, maindoor2in2, "-" ); mainwall6 = combineShells( mainwall5, tempgroup, "-" ); mainwall7 = combineShells( mainwall6, mainwindow1out, "+" ); mainwall8 = combineShells( mainwall7, mainwindow2out, "+" ); mainwall9 = combineShells( mainwall8, mainwindow3out, "+" ); mainwall10 = combineShells( mainwall9, mainwindow4out, "+" ); mainwall11 = combineShells( mainwall10, mainwindow5out, "+" ); mainwall12 = combineShells( mainwall11, mainwindow6out, "+" ); mainwall13 = combineShells( mainwall12, mainwindow7out, "+" ); mainwall14 = combineShells( mainwall13, mainwindow8out, "+" ); mainwall15 = combineShells( mainwall14, mainwindow1in2, "-" ); mainwall16 = combineShells( mainwall15, mainwindow2in2, "-" ); mainwall17 = combineShells( mainwall16, mainwindow3in2, "-" ); mainwall18 = combineShells( mainwall17, mainwindow4in2, "-" ); mainwall19 = combineShells( mainwall18, mainwindow5in2, "-" ); mainwall20 = combineShells( mainwall19, mainwindow6in2, "-" ); mainwall21 = combineShells( mainwall20, mainwindow7in2, "-" ); mainwall22 = combineShells( mainwall21, mainwindow8in2, "-" ); mainwall = combineShells( mainwall22, windowInGroup1, "-" ); } # make walls of top caboose body { topoffset = -3.5; topback = -1.5; topfront = 1.5; topleft = mainleft + 0.08; topright = mainright - 0.08; topheight = 2.0; tophtoffset = 0.9; topprofile = profile( pt( topback, 0, topleft ), pt( topfront, 0, topleft ), pt( topfront, 0, topright ), pt( topback, 0, topright ), pt( topback, 0, topleft ) ); topoutwall = extrude( topprofile, pt( 0, -0.1, 0 ), pt( 0, topheight,0 ), true ); topinwall = objTransform( topoutwall, { sxyz( 0.94, 1.5, 0.95 ), ty( -0.5 ) } ); # make object with dimensions of wall to remove from roof topsubwall = objTransform( topinwall, txyz( topoffset, mainheight - tophtoffset, 0 ) ); topwall1 = combineShells( topoutwall, topinwall, "-" ); topwall2 = objTransform( topwall1, txyz( topoffset, mainheight - tophtoffset, 0 ) ); # Position doors and windows for top topwindow1anchor = anchor( pt( topoffset + topback + 1.0 - windowwidth, mainheight + ( topheight - tophtoffset ) - 0.2, topright ), xdir, ydir, zdir ); topwindow1in = alignPosnAndZ( window1in, windowanchor, topwindow1anchor ); topwindow1out = alignPosnAndZ( window1out, windowanchor, topwindow1anchor ); topwindow2anchor = anchor( pt( topoffset + topfront - 1.0, mainheight + ( topheight - tophtoffset ) - 0.2, topright ), xdir, ydir, zdir ); topwindow2in = alignPosnAndZ( window1in, windowanchor, topwindow2anchor ); topwindow2out = alignPosnAndZ( window1out, windowanchor, topwindow2anchor ); topwindow3anchor = anchor( pt( topoffset + topback + 1.0, mainheight + ( topheight - tophtoffset ) - 0.2, topleft ), vec( -1, 0, 0 ), vec( 0, -1, 0 ), vec( 0, 0, -1 ) ); topwindow3in = alignPosnAndZ( window1in, windowanchor, topwindow3anchor ); topwindow3out = alignPosnAndZ( window1out, windowanchor, topwindow3anchor ); topwindow4anchor = anchor( pt( topoffset + topfront - 1.0 + windowwidth, mainheight + ( topheight - tophtoffset ) - 0.2, topleft ), vec( -1, 0, 0 ), vec( 0, -1, 0 ), vec( 0, 0, -1 ) ); topwindow4in = alignPosnAndZ( window1in, windowanchor, topwindow4anchor ); topwindow4out = alignPosnAndZ( window1out, windowanchor, topwindow4anchor ); topwindow5anchor = anchor( pt( topoffset + topback, mainheight + ( topheight - tophtoffset ) - 0.2, topleft + 1.0 - windowwidth ), zdir, ydir, vec( -1, 0, 0 ) ); topwindow5in = alignPosnAndZ( window1in, windowanchor, topwindow5anchor ); topwindow5out = alignPosnAndZ( window1out, windowanchor, topwindow5anchor ); topwindow6anchor = anchor( pt( topoffset + topback, mainheight + ( topheight - tophtoffset ) - 0.2, topright - 1.0 ), zdir, ydir, vec( -1, 0, 0 ) ); topwindow6in = alignPosnAndZ( window1in, windowanchor, topwindow6anchor ); topwindow6out = alignPosnAndZ( window1out, windowanchor, topwindow6anchor ); topdoor1anchor = anchor( pt( topoffset + topfront, mainheight + ( topheight - tophtoffset ) - 0.2, topleft + 1.2 ), vec( 0, 0, -1 ), vec( 0, -1, 0 ), vec( 1, 0, 0 ) ); topdoor1in = alignPosnAndZ( door1in, windowanchor, topdoor1anchor ); topdoor1out = alignPosnAndZ( door1out, windowanchor, topdoor1anchor ); topdoor2anchor = anchor( pt( topoffset + topfront, mainheight + ( topheight - tophtoffset ) - 0.2, topright - 1.2 + doorwidth ), vec( 0, 0, -1), vec( 0, -1, 0 ), vec( 1, 0, 0 ) ); topdoor2in = alignPosnAndZ( door1in, windowanchor, topdoor2anchor ); topdoor2out = alignPosnAndZ( door1out, windowanchor, topdoor2anchor ); topdoorsout = group( topdoor1out, topdoor2out ); # Combine top doors with walls topwall3 = combineShells( topdoor1out, topwall2, "+" ); topwall4 = combineShells( topdoor2out, topwall3, "+" ); topwall5 = combineShells( topwall4, roof2sub, "-" ); # Combine top windows with walls topwindowInGroup = group( topwindow1in, topwindow2in, topwindow3in, topwindow4in, topwindow5in, topwindow6in, topdoor1in, topdoor2in ); topwindowOutGroup = group( topwindow1out, topwindow2out, topwindow3out, topwindow4out, topwindow5out, topwindow6out ); topwall6 = combineShells( topwall5, topwindowOutGroup, "+" ); topwall = combineShells( topwall6, topwindowInGroup, "-" ); } # make roof for top { toproofcurve1 = crvFromArc( arcThru3Pts( pt( 0, mainheight + topheight - tophtoffset, topleft ), pt( 0, mainheight + topheight, 0 ), pt( 0, mainheight + topheight - tophtoffset, topright ) ) ); toproofcurve2 = profile( pt( 0, mainheight + topheight - tophtoffset, topright ), pt( 0, mainheight + topheight - tophtoffset, topleft ) ); toproofcurve = crvConcat( { toproofcurve1, toproofcurve2 } ); toproof = objTransform( reverseObj( extrude( toproofcurve, pt( topback, 0, 0 ), pt( topfront, 0, 0 ), true ) ), tx( topoffset ) ); } # Now put it all together. include "wheeltruss.scl"; # Make hole in main roof to get to top mainroof = combineShells( mainroof1, topsubwall, "-" ); # Position wheels frontwheels = objTransform( wheelsandtruss, txyz( mainfront - trussoffset, -wheeltrussheight, 0 ) ); backwheels = objTransform( frontwheels, ry( 180 ) ); # set attributes and combine { setColor( mainwall, "Red" ); setSq( mainwall, "Plastic" ); setColor( mainroof, "DarkSlateGray" ); setSq( mainroof, "Plastic" ); setColor( base, "DarkSlateGray" ); setSq( base, "Plastic" ); setColor( topwall, "Red" ); setSq( topwall, "Plastic" ); setColor( toproof, "DarkSlateGray" ); setSq( toproof, "Plastic" ); setColor( wheelcolumnholdgroup, "DarkSlateGray" ); setSq( wheelcolumnholdgroup, "Plastic" ); } caboose = group( mainwall, mainroof, base, topwall, toproof, frontwheels, backwheels, wheelcolumnholdgroup ); dumpA1File( { caboose }, "caboose.a1" ); dumpGeomFile( { caboose }, "caboose.geom" ); }