From: Bdale Garbee Date: Thu, 29 Oct 2020 16:24:58 +0000 (-0600) Subject: openscad-compatible 3d part models, and Attribute entries to reference them X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=b5262539811183548b064144bf10474d07f12340;p=hw%2Faltusmetrum openscad-compatible 3d part models, and Attribute entries to reference them --- diff --git a/packages/0402.fp b/packages/0402.fp index 50ffb67..78c5951 100644 --- a/packages/0402.fp +++ b/packages/0402.fp @@ -7,6 +7,7 @@ # text_x, text_y, text_direction, text_scale, text_flags Element[0x00000000 "Standard SMT resistor, capacitor etc" "" "0402" 0 0 -3150 -3150 0 100 ""] ( + Attribute("openscad" "0402") # # Pad[x1, y1, x2, y2, thickness, clearance, mask, name , pad number, flags] Pad[-1574 -393 diff --git a/packages/0402.scad b/packages/0402.scad index ab9b305..0c9eb68 100644 --- a/packages/0402.scad +++ b/packages/0402.scad @@ -18,4 +18,3 @@ module part_0402(len=1.0, width=0.5, height=0.35, pad_len=0.25) } } -part_0402(); diff --git a/packages/0603.fp b/packages/0603.fp index 88564d9..fd62108 100644 --- a/packages/0603.fp +++ b/packages/0603.fp @@ -12,6 +12,7 @@ # text_x, text_y, text_direction, text_scale, text_flags Element[0x00000000 "Standard SMT resistor, capacitor etc" "" "0603" 0 0 -3150 -3150 0 100 ""] ( + Attribute("openscad" "0603") # # Pad[x1, y1, x2, y2, thickness, clearance, mask, name , pad number, flags] Pad[-2559 -492 diff --git a/packages/0603.scad b/packages/0603.scad index 8aed1e5..751ec84 100644 --- a/packages/0603.scad +++ b/packages/0603.scad @@ -18,4 +18,3 @@ module part_0603(len=1.6, width=0.8, height=0.45, pad_len=0.3) } } -part_0603(); diff --git a/packages/0805.fp b/packages/0805.fp index 6454ad9..eb2700e 100644 --- a/packages/0805.fp +++ b/packages/0805.fp @@ -12,6 +12,7 @@ # text_x, text_y, text_direction, text_scale, text_flags Element[0x00000000 "Standard SMT resistor, capacitor etc" "" "0805" 0 0 -3150 -3150 0 100 ""] ( + Attribute("openscad" "0805") # # Pad[x1, y1, x2, y2, thickness, clearance, mask, name , pad number, flags] Pad[-3543 -393 diff --git a/packages/0805.scad b/packages/0805.scad index 7151939..3aa937d 100644 --- a/packages/0805.scad +++ b/packages/0805.scad @@ -18,4 +18,3 @@ module part_0805(len=2, width=1.2, height=0.5, pad_len=0.4) } } -part_0805(); diff --git a/packages/1206.fp b/packages/1206.fp index 6bddc3c..934bcb5 100644 --- a/packages/1206.fp +++ b/packages/1206.fp @@ -12,6 +12,7 @@ # text_x, text_y, text_direction, text_scale, text_flags Element[0x00000000 "Standard SMT resistor, capacitor etc" "" "1206" 0 0 -3150 -3150 0 100 ""] ( + Attribute("openscad" "1206") # # Pad[x1, y1, x2, y2, thickness, clearance, mask, name , pad number, flags] Pad[-5905 -1181 diff --git a/packages/SOT23-5.fp b/packages/SOT23-5.fp index 7cd739f..46388b7 100644 --- a/packages/SOT23-5.fp +++ b/packages/SOT23-5.fp @@ -1,6 +1,7 @@ Element["" "LP2980 SOT23-5" "U1" "SOT25" 289000 132000 6300 -5000 3 89 ""] ( + Attribute("openscad" "sot23-5") Pad[0 -800 0 800 2400 3000 3000 "4" "4" "square,edge2"] Pad[7800 -800 7800 800 2400 3000 3000 "5" "5" "square,edge2"] Pad[7800 -9000 7800 -7400 2400 3000 3000 "1" "1" "square"] diff --git a/packages/SOT23.fp b/packages/SOT23.fp index 4f89c2d..a3335b5 100644 --- a/packages/SOT23.fp +++ b/packages/SOT23.fp @@ -4,6 +4,7 @@ # 34 for SOT23, 24 for SOT25 Element(0x00 "SMT transistor, 3 pins" "" "SOT23" 148 0 3 100 0x00) ( + Attribute("openscad" "sot23") ElementLine(0 0 0 139 10) ElementLine(0 139 128 139 10) ElementLine(128 139 128 0 10) diff --git a/packages/sot23-5.scad b/packages/sot23-5.scad new file mode 100644 index 0000000..10ff8f7 --- /dev/null +++ b/packages/sot23-5.scad @@ -0,0 +1,39 @@ + +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,1.4-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,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); + } + } +} + +sot23(); diff --git a/packages/sot23.scad b/packages/sot23.scad index 8d500f7..b3d2b31 100644 --- a/packages/sot23.scad +++ b/packages/sot23.scad @@ -30,5 +30,3 @@ module sot23() } } - -sot23();