summaryrefslogtreecommitdiff
path: root/e3dv6.scad
blob: 9b74f8a56f5145d73eae5df7c570af97c7b65c63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
include <stuff.scad>;

hb_w = 16;		// width (along X axis)
hb_l = 20;		// length (along Y axis)
hb_h = 11.5;		// height (guess!)
hb_d = 6;		// heatbreak diameter
n_offset_w = 8;		// nozzle offset from the left
n_offset_l = 4.5;	// nozzle offset from the front
n_d = 7/cos(30);	// nozzle (outermost) diameter
hs_offset_w = 8;	// heater screw offset from the left
hs_offset_l = 17.5;	// heater screw offset from the front
hs_d = 5.7;		// heater screw diameter
hs_t = 1.5; 		// heater screw head thickness
ts_offset_l = 3.5;	// thermistor screw offset from the front
ts_offset_h = 4.8;	// thermistor screw offset from the bottom
ts_d = 7;		// thermistor screw diameter
ts_t = 2.6;		// thermistor screw head thickness
c_offset_l = 11.5;	// cartrdige offset from the from
c_offset_h = 4;		// cartridge offset from the bottom
c_d = 6.1;		// cartrdige diameter
c_t = 1.7;		// cartridge protrusion length (thickness)
c_tw = 4.3;		// thickness of the other cartridge end with wires

sv=hs_t+ss;

the_w = ss + max(c_tw,ts_t)+hb_w+c_t + ss;
the_l = ss + hb_l + ss;
the_h = sv + hb_h + ss;

/* Nozzle stuff */
n_protrude = 0.4;	// nozzle tip protrusion from silicone
n_h1 = 3.6;		// nozzle cone base from the heater body (minimal)
n_cone_h = 2;		// nozzle cone height
n_cone_d2 = 1;		// pad diameter of the 0.4 nozzle (works up to 0.6); see
			// http://wiki.e3d-online.com/images/3/3a/V6-NOZZLE-ALL.pdf
n_cone_d1 = n_cone_h * tan(40) * 2 + n_cone_d2;
codpiece_h = n_h1 + n_cone_h - n_protrude;

use <bubbles.scad>;
module heatershape(bubbled=true, codpiece=false) {
 m = n_offset_l-hb_d/2;
 module topholes(h) {
  hull() {
   for(sx=[-1,1]) for(sy=[-1,1])
    translate([hb_w/2+sx*(hb_w/2-m-hb_d/2),hb_l/2+sy*(hb_l/2-m-hb_d/2),0])
    cylinder(d=hb_d,h=h,$fn=24);
  }
  translate([-c_tw,c_offset_l-c_d/2,0])
  cube(size=[hb_w/2+c_tw,c_d,h]);
 }
 // main body and protrusion
 // body
 cube(size=[hb_w,hb_l,hb_h]);
 // protrusion
 translate([0,0,hb_h]) {
  // irrelevant, because we print upside-down: mo = m+max(c_t,c_tw)+ss; th=3*ss;
  mo = protrude/4; th = protrude/2;
  translate([0,0,-1]) topholes(h=ss+th);
  if (!abro)
   translate([0,0,ss+protrude-mo-th]) hull() {
    topholes(h=layer_height);
    translate([-c_tw-ss,-ss,mo])
     cube(size=[the_w,the_l,th]);
   }
  else
   translate([-c_tw-ss,-ss,ss])
    cube(size=[the_w,the_l,th]);
 }
 // nozzle
 translate([n_offset_w,n_offset_l,1]) mirror([0,0,1])
  if (codpiece) {
   mc_d2 = n_cone_d2 + n_protrude * tan(40) * 2;
   intersection() {
    cylinder(d = n_d, h = n_h1 + 1 + epsilon, $fn=24);
    cylinder(d1 = n_d * 2, d2 = 0, h = n_h1 * 2 + 1, $fn=24);
   }
   translate([0, 0, n_h1 + 1])
    cylinder(h = n_cone_h - n_protrude, d1 = n_cone_d1, d2 = mc_d2, $fn = 32);
  } else
   cylinder(d=n_d,h=sv+1,$fn=24);
 // heater screw
 translate([hs_offset_w,hs_offset_l,1]) mirror([0,0,1]) cylinder(d=hs_d,h=hs_t+1,$fn=24);
 // thermistor screw
 translate([1,ts_offset_l,ts_offset_h]) rotate([0,-90,0]) cylinder(d=ts_d,h=ts_t+1,$fn=24);
 // cartridge on the right
 translate([hb_w-1,c_offset_l,c_offset_h]) rotate([0,90,0]) cylinder(d=c_d,h=c_t+1,$fn=24);
 // cartrdige on the left
 translate([1,c_offset_l,c_offset_h]) rotate([0,-90,0]) cylinder(d=c_d,h=c_tw+1,$fn=24);
 translate([-c_tw,c_offset_l-c_d/2,c_offset_h]) cube(size=[c_tw+1,c_d,hb_h-c_offset_h]);

 if(bubbled) {
  for(y=[0,hb_l]) translate([0,y,0]) bubbles(size=[hb_w,ss/2,hb_h]);
  rotate([0,0,90]) bubbles(size=[hb_l,(c_tw+ss)/2,hb_h],d=(c_tw+ss)/2,s=1.1*(c_tw+ss)/2);
  translate([hb_w,0,0]) rotate([0,0,90]) bubbles(size=[hb_l,(c_t+ss)/2,hb_h],d=(c_t+ss),s=1.1*(c_t+ss));
  rotate([-90,0,0]) bubbles(size=[hb_w,sv/2,hb_l]);
 }
}

function vc(d,h) = PI*pow(d/2,2)*h;		// cylinder volume

vol_ = the_w*the_l*the_h
 - hb_w*hb_l*hb_h					// heater block
 - vc(d=n_d,h=sv)					// nozzle
 - vc(d=hs_d,h=hs_t)					// heater screw
 - vc(d=ts_d,h=ts_t)					// thermistor_screw
 - vc(d=c_d,h=c_t)					// cartridge on the right
 - vc(d=c_d,h=c_tw)/2 - c_d*c_tw*(hb_h-c_offset_h)	// cartridge on the left
;
vol = vol_*1.2;
echo("volume",vol);

use <view.scad>;
use <mold.scad>;

codpiece = true;
view="inner";

view(view=view,volume=vol) {
 cp_h = codpiece ? codpiece_h - sv : 0;
 prt = abro ? protrude / 2 : protrude;
 difference() {
  union() {
   mold(size=[the_w,the_l,the_h],s=ms,v_protrude=prt,introffset=ss+c_offset_l);
   if (codpiece)
    translate([0, 0, -cp_h])
     cube([the_w + ms * 2, the_l + ms * 2, cp_h + epsilon]);
  }
  if (codpiece)
   translate([ms + c_tw + ss + n_offset_w, ms + ss + n_offset_l, ms]) {
    scale([1, 1, codpiece_h / (n_d + 2)])
     sphere(d = n_d + 2, $fn = 64);
   }
 }
 translate([ms+c_tw+ss,ms+ss,ms+sv]) heatershape(true, codpiece);
 translate([ms+epsilon,ms+epsilon,ms+epsilon - cp_h])
  cube(size=[the_w-2*epsilon,the_l-2*epsilon,the_h-2*epsilon + cp_h]);
}
/* vim:set ai sw=1: */