FeatureScript Changes the Game
Speaking of flat cars, what about their loads? Most of the time, these cars would have carried lumber or logs. Without a sawmill on the line, it is unlikely they carried logs in my town, but there is a photo of a flat car of lumber in Pembroke.
Iād always imagined I would create lumber loads out of scale lumber. Rob Kirkham was building some at a recent modelling night, and exclaimed at the amount of scale lumber they consume. Then, at an operating session on Anthony Craigās layout, I noticed he had some nice resin loads, and those donāt consume any scale lumber at all!
Now, I have a way to make resin parts. Itās called a 3D printer. It needs a 3D model to work from. But, how could I get the variation of a hand-stacked load into the perfect world of a computer?
I started out with a drawing with a bunch of random parameters from my head. This was laborious, but not untenable. It would have been helped immeasurably if there were a mod() function in OnShape, and even more if there were a random() function. While looking for these, I stumbled upon the OnShape programming language, FeatureScript.
A few hours later, I had bungled my way through a desert of documentation and into making my first four custom features in OnShape. The last one is a pile of lumber. You simply fill in a form with the values like number of columns and layers of lumber, and a random seed, and you get a stack of lumber, complete with supports for 3D printing!
This new skill completely changes the game of 3D modelling for me. Imagine being able to place rivets along a line with a given pitch and diameter with the stroke of a pen. Imagine being able to introduce micro-variations in thickness. Consider being able to add grain. All of these were difficult or time-consuming before, but now just a few hours of programming away. The game has changed. Again.
The OnShape screen with two piles of lumber generated. The cylinders at the end are for 3D printing supports, and are placed on all the locally lowest boards. The boards are random lengths and widths within a tolerance, and offset from the start by a random amount. Note the feature list on the left contains two references to āPileā which is my custom feature.#333Series #3DPrinting #flatCar #modelRailway #OnShape