DRG #168's Frame in HOn3, Part1

Metal, or plastic…?

In my previous post you’ll see my original work on fabricating a frame, OSHCut laser-cut 0.02" nickel silver. Compared to the “cut-n-file” method outlined in the Odegard MR articles this was really easy and rendered perfectly-aligned driver boxes. My next step was to fabricate spacers and solder them in place to make an integral frame, but I decided to part with that tack and investigate what it would take to 3D print it. What I’m going to do with this post is try an organization model that breaks the post into two sections, “Modeling” and “Fabrication”. This is also to be Part 1 of a series, as at this date I’m not yet fully on-board with a plastic frame…


Note: Yes this is OpenSCAD. Thing is, I think it’s great for illustrating concepts, and sharing code that others can use. Accordingly, at the end of this section will be a code segment that most anyone can use to make a frame…

The frame was rather easy to model in 2D, and I didn’t think that’d be any different in 3D. Indeed, I think I could have found a path to import the @d .dxf file into OpenSCAD, but I decided instead to model it from scratch. My plan was to model the full frame, both sides connected with a top sill, and the shape was to be pretty much the same as the 2D model, so I just copy-pasted dimensions as I went.

I started with a cube of the frame’s overall dimensions, then put it in a difference() operator to subtract shapes defined from a cube and cylinder to cut out the driver boxes, as well as another cube of slightly smaller dimension to carve out the frame innards. Here’s a screenshot of it:

Frame Demo 1

I’ll post the final demo code at the end of the section. Of note here are a couple of conventions I’ve come to as I’ve built stuff:

So, there’s the basic frame. Now, the prototype has some voids and other truncations that would be good to represent, so I’m going to add them to the union to be subtracted from the frame. To make the voids, I used both standard OpenSCAD cubes and, for the irregular ones, a trapezoid routine I wrote. Here’s a view of the frame with the void visiblity turned on:

Frame Demo 2

and the frame with all the voids subtracted:

Frame Demo 3

Here’s the code that produced it:





module trapezoid(bottomline, topline, toplineheight, toplineoffset)
		pts = [
			[toplineoffset, toplineheight],
			[toplineoffset+topline, toplineheight],
			[bottomline, 0]

module slot()
	translate([slotwidth/2, 0.5, slotdepth-slotwidth/2]) rotate([90,0,0])cylinder(d=slotwidth, h=1);
	translate([0,-0.5,0]) cube([slotwidth, 1, slotdepth-slotwidth/2]);

module frame() {
	difference() {  //contains two objects 
					//	1) the part, and 
					//	2) the object to subtract from the part

		translate([0, -0.125, 0]) //scooch it over to center on the X axis
			cube([3.59, 0.25, 0.25]);
		union() {  //subtract all the stuff within the union
			//frame channel:
			translate([-0.2,-(framewidth-framethickness)/2, -0.00001]) 
				cube([4, framewidth-framethickness, framewidth-framethickness/2]);
			//driver boxes:
			translate([frontdriver, 0, -0.00001])
			translate([maindriver,0, -0.00001])
			translate([reardriver, 0, -0.00001]) 
			//inter-driver voids:
			translate([3.60, 0, 0.19]) rotate([90,180,0]) trapezoid(0, 0.3, 0.2, 0); //rear slant
			translate([3.29, 0, 0.05]) rotate([90,0,0]) trapezoid(0, 0.25, 0.15, 0); //rear void
			translate([3.07, 0, 0.20]) rotate([90,180,0]) trapezoid(0, 0.75, 0.15, 0); //main-rear void
			translate([1.73, 0, 0.05]) rotate([90,0,0]) trapezoid(0.35, 0.35, 0.15, 0); //front-main void
			//front-end carvings:
			translate([-0.00001,-0.5,0]) cube([1.45, 1, 0.16]);
			translate([-0.00001,-(framewidth-framethickness*2)/2,.2]) cube([0.45, framewidth-framethickness*2, 0.16]);



I think the frame constructed above would print okay with either a filament or resin printer. But I only have one printer, resin, so with that hammer everything looks like a nail :D That choice does have ramifications, however…

One thing that starts to dominate your thinking as you design such a a thing is, how much do I add to a part? In traditional brass scratchbuilding, that determination largely came from the materials and the tooling used to shape them. The cylinder chest, for example was fabricated separately and usually soldered to the frame.

With 3D printing, one has the option to combine things, and there are good reasons to consider in making combination decisions. For instance, a part printed with the larger part to which it’s attached doesn’t require subsequent drilling and gluing. Another example, if a particular alignment is critical, it’s a lot easier to do that precisely in the CAD software than to do it during attachment. Thinking through that, I decided to incorporate the cylinder chest, which I’d already designed, and the front and back bolsters. This is why I define my parts as modules; to add the cylinder chest, it was as simple as doing this:

use <../CylinderChest/cylinderchest.scad>


translate([0.45,0,0.143]) cylinderchest();

to get this:

168 Frame

Note that I did some additional frame shaping up front, as well as detailing and adding the bolsters pretty much in the same way. Oh, and if you look closely, you’ll see frame crossmembers at various places around the driver slots, this is for supporting brass clip-on plates I’m considering for closing the slots containing the axles (for another post…)

Now, there are some parts of the frame that are rather beefier than their prototype counterparts. I think this is a factor long-established in scale modeling: laws of physics keep us from precisely copying every dimension of a prototype in some small scale like HO. Resin and filament printing have their own constraints regarding this; for instance, I was wondering how those snifter valves on the cylinder chest fronts would survive resin printing, washing, and curing. The beauty of this process is, if something like this doesn’t work, printing it again with a change is relatively cheap. As of today, I’m on my fourth frame print, and I’ve got changes queued for the fifth.

So, I did all the above thinking with respect to my medium, resin. Some of the decisions would be different if I were using a FDM printer.

On to printing. First, this model was created in actual inches, HO scale. The default measurment scale in 3D printing is millimeters, so the model has to be scaled to those dimensions. What I’ve come to do in assembling parts for #168 is to model them in inches, then make a separate .scad file with “forprint” appended to the name, e.g., ‘168_frame-forprint.scad’. The contents of that file look just like the code snippet I described above where the part is scaled by 25.4 in all three axes. That does the inch-millimeter conversion, and is the version that I render for printing.

The renders we’ve been looking at are not printable; instead, a separate render is required to produce the mesh that’s saved to a .stl file, recognized by the slicer software. I just did that on my tablet here, and that render took 2 minutes, 11 seconds. OpenSCAD developers are working on significantly reducing that, thank goodness, the smokebox-boiler-firebox is much worse…

Now, I’m new to this so I’ll take any feedback on my choice of supports. I oriented the model horizontally, based on my bit of experience printing a few small parts; I wanted the layer texture to run horizontal in the cylinders and chests. I did the first print with the auto-generated supports, and I got drooping bolsters and a few wobbly places on the frame bottom edge:

168 Frame First Print

Armed with that information, for the next print I manually placed the supports, all around each edge that presented itself to the build plate and I double-alternating supported the large bolster. Here’s a screenshot of the frame in the slicer:

168 Frame in the Slicer

This time I got good definition in most of the model, still with a bit of waviness in the main-rear void, the slanted one that’ll be under the firebox.

Regarding details, this medium never ceases to amaze me. Here’a a closeup of one of the snifter valves:

Snifter Valve Closeup

There are also bolt heads on the nearby frame members, representing the frame extension made to #168 to accommodate a snowplow, according to folk at the Cumbres & Toltec.

So, I had various other issues in the first four prints, frame too wide, tight driver slots, slots too high putting the drivers against the boiler. I’ve dialed in adjustments for all, which are included in the model demo constructed for this post. What I haven’t yet figured out is that the front part of the frame will cure with a bit of a droop. I added to the vertical frame dimension (lowered the cutout) in the space between the front drivers and the cylinder chest, but I haven’t printed that yet awaiting delivery of an order of “ABS-Like” resin. This design will essentially use the frame itself as driver bearings, so I want to mess with a few different “harder” resins to see how they’ll interact with the spinning axles. The finish-up of the frame with respect to that experimentation, as well as a bit of discussion/demonstration of an alternate nickel-cut frame design (both halves joined at the top by spacers included in the part, frame sides bent down to form the part) will be the topic of Part II.

Frankly, so far I’m very pleased with the frame design and print rendition. I’ll happily take discussion at any of the forums I frequent: Trainboard, MHR, and the Google HOn3 mailing list.