RUG/Pennsylvania/State College/Vertex Param

From RepRap
Revision as of 19:55, 27 March 2012 by KtripPSU (talk | contribs) (Progress Blog)
Jump to: navigation, search

How to Parametrize Mendel vertices to vary machine height... I think

It's time for a new project, and therefore a new project blog. The goal of this undertaking is to develop an OpenSCAD script that allows the user to vary the angles incorporated into the design of the base vertices for our printers. But what's the purpose? By making the angles larger, it will allow us to increase the printable height of the machines, offering yet another greater degree of freedom in our design. I'm hoping to start with existing code, but I may just steal parts from that or even write my own if it turns out to be easier.

Progress Blog

3.22.12

Project inception: Eric and Dave gave me the idea, and I decided to run with it.

Found this, it's a basic vertex written in SCAD, but seems like a bit of a pain to deal with. I think I'll just pull some of it's dimensions for reference, but just start with my own fresh code instead.

I was able to model the basic ends, but decided on an even better basic design. Rather than using the basic block-style structure, a swept arc could be used to create the basic structure. Not only is this easier to get stared with the coding, the parametrization will be much simpler and more fluid. I may try both designs and then just see which one looks/performs better. Anyways, that's all in the future. Here's what I got done today with the OpenSCAD code. Enjoy!

//Parametrization of Vertices
//Kevin Trippel

m8 = 9.9;
m8wide = m8 + 3;
heights = 13.9;



//Create basic shape for ends
difference(){
linear_extrude (height = heights) polygon(points = [[9,0],[0,9],[0,21],[9,30],[29,30],[29,0]], paths = [[0,1,2,3,4,5]]);

linear_extrude (height = heights) polygon(points = [[9,2],[2,9],[2,21],[9,28],[29,28],[29,2]], paths = [[0,1,2,3,4,5]]);
rotate([90,0,0]) translate ([20,heights/2,-30]) cylinder(h = 350, r = m8/2, center = false);

}

//Begin Structural Components
//Horizontal Cross-member

difference(){
translate ([0,13.5,0]) cube(size = [29,3,heights], center = false);
rotate([90,0,0]) translate ([20,heights/2,-29.5]) cylinder(h = 30, r = m8wide/2, center = false);
translate([7,15,0]) cylinder(h = heights, r = m8/2, center = false);

}

//Bottom

difference(){
linear_extrude (height = 2) polygon(points = [[9,0],[0,9],[0,21],[9,30],[29,30],[29,0]], paths = [[0,1,2,3,4,5]]);
translate([7,15,0]) cylinder(h = heights, r = m8/2, center = false);

}
//Vertical Cylinder

difference(){
translate([7,15,0]) cylinder(h = heights, r = m8wide/2, center = false);
translate([7,15,0]) cylinder(h = heights, r = m8/2, center = false);
}

//Vertical Cylinder Gusset

difference(){
translate([0,9,0]) cube(size = [7,12,heights], center = false);
translate([7,15,0]) cylinder(h = heights, r = m8/2, center = false);
}

//Horizontal Cylinder

difference(){
rotate([90,0,0]) translate ([20,heights/2,-30]) cylinder(h = 30, r = m8wide/2, center = false);
rotate([90,0,0]) translate ([20,heights/2,-30]) cylinder(h = 30, r = m8/2, center = false);

}

//Horizontal Cylinder Gusset

difference(){
translate([20-(m8wide/2),0,0]) cube (size = [m8wide, 30, heights/2], center = false);
rotate([90,0,0]) translate ([20,heights/2,-30]) cylinder(h = 65, r = m8wide/2, center = true);
}

3.27.12

Parametrization: Now that I've got the basic form for the ends figured out,it's time to begin the fun part. I need to take the dimensions, and make them a function of an angle. Doing this will make the translation and rotation of the part easier, converting the starting polygon vertices into their rotated counterparts. This will involve what will turn into hundreds of trig functions, all dependent on one user-submitted angle (later, this will be dependent on the user submitted height, I'm just moving one step at a time here).

After much work, I've found an easier way to approach the translation and rotation to comply with the user submitted angle. Rahter than working with the original code (updated version above), I've decided to use the STLs generated from that code and import them. This will make translation, rotation, etc. much simpler and less complicated when involving trig functions.

The initial code still needs tweaks and more accurate relations to calculate the translations, but for now it seems to be a step in the right direction. Here's where things stand as of now, although I plan to continue work on it later today.

//Kevin Trippel
//Project Tall Cat
//Include endpiece.stl


//Set desired Mendel height (in mm) below:
h = 183.75;

theta = (-180) + atan(h/183.75);
theta2 = atan(h/183.75);
a = (90-((1/2)*(180-theta2)));

import_stl("endpiece.stl", convexity = 50);

translate([29 + 10*cos(a) + 29*cos(2*a), 30 + 10*sin(a) + 29*sin(2*a),0]) rotate ([0,0,theta]) import_stl("endpiece.stl", convexity = 50);

linear_extrude (height=2) polygon(points = [[30,0],[29,30],[29 + 10*cos(a), 30 + 10*sin(a)], [50,50]], paths = [0,1,2,3]);