--- /dev/null
+module part_0402(len=1.0, width=0.5, height=0.35, pad_len=0.25)
+{
+ union() {
+ translate([0,0,height/2]) {
+ // body
+ color([0.1,0.1,0.1])
+ cube([len-2*pad_len,width,height], center=true);
+ // terminals
+ color([0.8,0.8,0.8]) {
+ translate([+len/2-pad_len/2, 0, 0])
+ cube([pad_len, width, height], center=true);
+ }
+ color([0.8,0.8,0.8]) {
+ translate([-len/2+pad_len/2, 0, 0])
+ cube([pad_len, width, height], center=true);
+ }
+ }
+ }
+}
+
--- /dev/null
+module part_0603(len=1.6, width=0.8, height=0.45, pad_len=0.3)
+{
+ union() {
+ translate([0,0,height/2]) {
+ // body
+ color([0.1,0.1,0.1])
+ cube([len-2*pad_len,width,height], center=true);
+ // terminals
+ color([0.8,0.8,0.8]) {
+ translate([+len/2-pad_len/2, 0, 0])
+ cube([pad_len, width, height], center=true);
+ }
+ color([0.8,0.8,0.8]) {
+ translate([-len/2+pad_len/2, 0, 0])
+ cube([pad_len, width, height], center=true);
+ }
+ }
+ }
+}
+
--- /dev/null
+module part_0805(len=2, width=1.2, height=0.5, pad_len=0.4)
+{
+ union() {
+ translate([0,0,height/2]) {
+ // body
+ color([0.1,0.1,0.1])
+ cube([len-2*pad_len,width,height], center=true);
+ // terminals
+ color([0.8,0.8,0.8]) {
+ translate([+len/2-pad_len/2, 0, 0])
+ cube([pad_len, width, height], center=true);
+ }
+ color([0.8,0.8,0.8]) {
+ translate([-len/2+pad_len/2, 0, 0])
+ cube([pad_len, width, height], center=true);
+ }
+ }
+ }
+}
--- /dev/null
+module part_1206(len=3.2, width=1.6, height=0.6, pad_len=0.5)
+{
+ union() {
+ translate([0,0,height/2]) {
+ // body
+ color([0.1,0.1,0.1])
+ cube([len-2*pad_len,width,height], center=true);
+ // terminals
+ color([0.8,0.8,0.8]) {
+ translate([+len/2-pad_len/2, 0, 0])
+ cube([pad_len, width, height], center=true);
+ }
+ color([0.8,0.8,0.8]) {
+ translate([-len/2+pad_len/2, 0, 0])
+ cube([pad_len, width, height], center=true);
+ }
+ }
+ }
+}
+
--- /dev/null
+
+module sot23()
+{
+
+ // pin prototype
+ module pin(length, height, thick)
+ {
+ linear_extrude(height=thick)
+ scale([length, -height, 1])
+ polygon([[0.3400,0.0000],[0.3900,0.0100],[0.4300,0.0300],[0.4600,0.0600],[0.4789,0.0908],[0.6279,0.8307],[0.6500,0.8600],[0.6900,0.8900],[0.7300,0.9000],[1.0000,0.9000],[1.0000,1.0000],[0.6700,1.0012],[0.6100,0.9900],[0.5600,0.9600],[0.5300,0.9200],[0.5200,0.9000],[0.3721,0.1693],[0.3500,0.1400],[0.3100,0.1100],[0.2700,0.1000],[0.0000,0.1000],[0.0000,0.0000]]);
+ }
+
+ rotate([90,0,-90]) scale([1.13,1.13,1.13]) translate([-0.9, 0.4, -2.1 - 0.43/2]) {
+ // body
+ color([0.1,0.1,0.1])
+ linear_extrude(height=2.9)
+ polygon([[-0.55,0],[-0.45,0.53],[0.45,0.53],[0.55,0],[0.45,-0.35],[-0.45,-0.35]]);
+
+ // 3 pins
+ color([0.9, 0.9, 0.9]) {
+ translate([0.5,0,0.5-0.43/2])
+ pin(0.5, 0.4, 0.43);
+
+ translate([0.5,0,2.3-0.43/2])
+ pin(0.5, 0.4, 0.43);
+
+ translate([-0.5,0,1.45-0.43/2])
+ pin(-0.5, 0.4, 0.43);
+ }
+ }
+}
+
+
+sot23();
+
+cube([0.1,0.1,0.1]);