Nicole, Mac and I have decided to make a train that can roll on a flat, or downhill, surface. We will need to add in axles in order for the wheels to spin. We believe that this train will use more of the Openscad features than our previous idea of a maze.
Our first draft design:
We tried to use Openscad for the wheels but it was too difficult to get the holes to be equivalent so we ended up using TInkercad to make the wheels and axle. See below.
Next we will be making the cut out hole for the axles and then putting the wheels on.
We decided that we are going to make four trains now. We have made different windows and amount of wheels on each passenger car.
Our biggest challenge that we came across was to get the axles and wheels to be the correct size.
In order to connect the two pieces, we have decided to add a hitch to the back end of the first piece, and the next piece and string them together.
Team bonding while working for hours on this project!
All of our wheel and axle attempts:
Here is our final result:
Our code:
Train Engine
{
//create connecting piece at back of engine
translate([0,22,0]){
union(){
difference(){
cylinder(3,3,3);
cylinder(3,1.5,1.5);
}
}
}
//Create base of engine and customize wheel holes (size, number, spacing)
union(){
difference(){
cube([10,40,10],true);
for (i = [0:4]) {
translate ([0,7.75*i,0]){
rotate([90,0,90]){
translate([-16,-3,-15]){
cylinder(30,1.3,1.3,$fn=10);
}
}
}
}
}
//driving cabin
translate ([0,10,7]) {
cube([10,20,10], true);
}
//top of train cabin
translate ([0,10,5]) {
rotate([90,0,0]) {
cylinder(30,5,5);
}
}
//top of train engine
translate ([0,20,12]) {
rotate([90,0,0]) {
cylinder(20,5,5);
}
}
//smoke stack
translate ([0,-17,5]) {
cylinder(10,2,3);
}
//face of train
translate ([0,-19,5]) {
sphere(4.5);
}
}
}
Train Car
{
//create connection pieces on either side of car
for (i = [0:1]){
translate([0,-44*i,0]){
translate([0,22,0]){
union(){
difference(){
cylinder(3,3,3);
cylinder(3,1.5,1.5);
}
}
}
}
}
//create boxcar and customize wheel holes(size, number, distance)
union(){
difference(){
union(){
difference(){
cube([10,40,10],true);
for (i = [0:3]) {
translate ([0,11*i,0]){
rotate([90,0,90]){
translate([-16.5,-3,-15]){
cylinder(30,1.3,1.3,$fn=10);
}
}
}
}
}
//create upper half of boxcar
translate ([0,0,5]) {
cube([10,40,10], true);
}
//create round top of boxcar
translate ([0,20,9]) {
rotate([90,0,0]) {
cylinder(40,5,5);
}
}
}
//create and customize windows (size, distance, number, placement)
for (i = [0:0]){
translate([0,-5*i,1*i]){
translate([-20,-15,3]){
cube([40,30,7]);
}
}
}
}
}
}
Train Wheel
{
// customize wheel size and wheel hole/ create l*w #of wheels to print
for (i = [0:0]) {
translate([15*i,0,0]){
union(){
difference(){
cylinder(1.5,3.5,3.5);
cylinder(3,.92,.92, $fn=10);
}
}
}
}
}
Train Axle
{
//create and customize axle for wheels, create l*w #of axles
for (i = [0:1]){
translate([5*i,0,0]){
for (i = [0:2]) {
translate([0,5*i,0]){
cylinder (15,.8,.8, $fn=10);
}
}
}
}
Recent Comments