3d scanning and printing

Assignment for this week

This page is organized as follows:

Designing a 3d object

After a quick look on the internet, I decided to 3dprint a C60 molecule which is known to be difficult to obtain by injection molding techniques. The position of the atoms in a C60 molecule and the bonds between atoms (which atom is linked to which) are easily available on the web. I used this source. The datafile contains 9 columns (C, #, x, y, z, 1, # 1st neighbor, # 2nd neighbor, # 3rd neighbor). I wrote a simple script in R to create an openSCAD command file that would draw the atom as spheres and the bonds as cylinders. The code is given below:


data = read.table("~/Desktop/c60.cart3d", skip=1)

# x,y,z position of the spheres
x = data[,3]
y = data[,4]
z = data[,5]

# bonds (x2 - x1, y2 - y1, z2 - z1) = (hx, hy, hz)
# cylinder, height = sqrt(hx^2+hy^2+hz^2)
# the cylinder is along z by default
# we must rotate it along x,y,z
# in a spherical coordinate system
# 		hx = h*sin(theta)*cos(phi)
#		hy = h*sin(theta)*sin(phi)
#		hz = h*cos(theta)
# where theta is the angle of rotation along x and phi is the angle of rotation along z
# --> theta = acos(hz/h) and tan(phi) = hy/hx --> phi = atan(hy/hx)
#
text = "R=0.5; F=10;\nunion()\n{\n";
# atoms
for (i in 1:60){
	text = paste(text, "translate([",x[i],",",y[i],",",z[i],"]) sphere(r=R, $fn=F);\n", sep="");
}

# bonds (used centered cylinders, translate, rotate)
for(i in 1:60){
		i1 = data[i, 7];
		hx = x[i1]-x[i]; hy= y[i1]-y[i]; hz = z[i1]-z[i];
		h = sqrt(hx^2+hy^2+hz^2);
		tx = (x[i1]+x[i])/2; ty=(y[i1]+y[i])/2; tz = (z[i1]+z[i])/2;
		theta = acos(hz/h);
		phi = atan(hy/hx);
		text = 	paste(text, "translate([",tx,",",ty,",",tz,"]) rotate([-acos(",hz/h,"),0,-atan2(",hx,",",hy,")]) cylinder(r=0.2, h=",h,", center=true, $fn=F);\n", sep="");
		i2 = data[i, 8];
		hx = x[i2]-x[i]; hy= y[i2]-y[i]; hz = z[i2]-z[i];
		h = sqrt(hx^2+hy^2+hz^2);
		tx = (x[i2]+x[i])/2; ty=(y[i2]+y[i])/2; tz = (z[i2]+z[i])/2;
		theta = acos(hz/h);
		phi = atan(hy/hx);
		text = 	paste(text, "translate([",tx,",",ty,",",tz,"]) rotate([-acos(",hz/h,"),0,-atan2(",hx,",",hy,")]) cylinder(r=0.2, h=",h,", center=true, $fn=F);\n", sep="");
		i3 = data[i, 9];
		hx = x[i3]-x[i]; hy= y[i3]-y[i]; hz = z[i3]-z[i];
		h = sqrt(hx^2+hy^2+hz^2);
		tx = (x[i3]+x[i])/2; ty=(y[i3]+y[i])/2; tz = (z[i3]+z[i])/2;
		theta = acos(hz/h);
		phi = atan(hy/hx);
		text = 	paste(text, "translate([",tx,",",ty,",",tz,"]) rotate([-acos(",hz/h,"),0,-atan2(",hx,",",hy,")]) cylinder(r=0.2, h=",h,", center=true, $fn=F);\n", sep="");
}
text = paste(text, "}\n")

writeLines(text, con="~/Desktop/C60.scad", useBytes=F) 

The openSCAD command file is just a succession of commands that create spheres after a proper translation of x, y and z and cylinders (bonds) that need to be translated and rotated.

The resulting STL exported file can be viewed below (with a low res to avoid big sizes).

It seems you are using an outdated browser that does not support canvas :-(

You can find the stl file here.

3d printing

I used a UPmini for my 3d printing. The stl file can be imported into the 3d printer sofware.

The object can be rescaled. Here I had to rescale everything by a factor 5. Some printing parameters can be tuned by the user: z thickness (here 0.25 mm), fill density, etc.

Finally, once the user clicks on print and validates the print window that lists some parameters (0.25 mm thickness, loose filling, ABS filaments), a new window with the estimated weight of the 3d printed object (here 8.8g) and the duration of the printing process (here 57 min) appears.

The printing took about 1 hour. After removing the object from the plateau, it looked like

I used this tool to remove the support. (you have to be patient and carefull not to ruin the object when removing the support)

And finally I obtained:

I tried to 3dprint the same object with a Ultimaker2

3d scanning

In our lab, we had a MakerBot digitizer 3d scanner.

I tried to 3dscan the C60 molecule I 3dprinted with the UPmini.

And finally I obtained:

You can find the stl file here. As you can see, the 3dscan is far from being perfect.

I also used Autodesk 123d catch which is an incredible tool capable of reconstructing 3d objects from a series of photos.

EVALUATION CHECKLIST 2016 -
3D SCANNING AND PRINTING:

Skills Acquired:

Documentation Required for Completion:



Files to download