Page 1 of 2

Posted: Sun Jun 02, 2013 3:36 am
Working on this off-and-on:

Machinist's square:
openscad_machinist_square.png (4.53 KiB) Viewed 6125 times

Code: Select all

``````module machinists_square (blade_length, blade_width, blade_thickness, beam_offset, beam_length, beam_width, beam_thickness)
cube(size=[beam_width,beam_length,beam_thickness]);
}

machinists_square(6,1,.0625, 0.5, 3, 1, .5);
``````
Allen wrenches:
openscad_hex_key.png (3.61 KiB) Viewed 6124 times
(hexagon function by Kevin Crowley <caohaoim@gmail.com> )

Code: Select all

``````module hexagon(r){
polygon(points=[[r,(r*(tan(30)))],
[0,(r*(2/sqrt(3)))],
[-r,(r*(tan(30)))],
[-r,-(r*(tan(30)))],
[0,-(r*(2/sqrt(3)))],
[r,-(r*(tan(30)))]]);
}

module hexkey (hex_size, hex_length, hex_blade) {
translate([-hex_size, -hex_size*2, -hex_size/2])
render(convexity = 1) {
intersection() {
cube(size=[hex_size*2,hex_size*2.501,hex_size*2.501]);
translate([hex_size, 0, hex_size*2.5])
rotate([0,90,0])
rotate_extrude()
translate([hex_size*2, 0, 0])
//rotate([0,0,90])
hexagon(hex_size/2);
}}
translate([0, 0, hex_size*2])
linear_extrude(height=hex_length-hex_size*2)
rotate([0,0,90])
hexagon(hex_size/2);
translate([0, -hex_size*2, 0])
rotate([90,0,0])
rotate([0,0,90])
hexagon(hex_size/2);
}

hexkey (4,73,28);
``````

### Re: Drawing tools in OpenSCAD

Posted: Sun Jun 02, 2013 11:55 pm
and a combination wrench:
openscad_wrench.png (6.24 KiB) Viewed 6102 times

Code: Select all

``````module wrench (wrench_size, wrench_handle) {
\$fn=50;
translate([wrench_size/4, wrench_handle/4, -wrench_size/16])
minkowski()
{cube (size=[wrench_size*0.5,wrench_handle/2,wrench_size/4]);
cylinder(r=wrench_size/8,h=wrench_size/4);}
cube (size=[wrench_size*1.0625,wrench_handle*0.9,wrench_size*0.375]);
render(convexity = 1) {
translate([0, wrench_handle*0.9, -wrench_size])
intersection() {
cube(size=[wrench_size*2,wrench_handle*0.061,wrench_size*2]);
translate([0, 0, wrench_size*3.375])
rotate([0,90,0])
rotate_extrude(convexity = 10)
translate([wrench_size*2, 0, 0])
square ([wrench_size*0.375,wrench_size*1.0625]);}}
render(convexity = 1) {
difference() {
translate([wrench_size/2, wrench_handle+wrench_size/6, wrench_size/8])
rotate([10,0,0])
cylinder(h = wrench_size*0.625, r=wrench_size*.5+2);
translate([wrench_size/2, wrench_handle+wrench_size/6, wrench_size/16])
rotate([10,0,0])
linear_extrude(height=wrench_size)
rotate([0,0,90])
hexagon(wrench_size/2);}}
translate([wrench_size/2, -wrench_size/2, -wrench_size/8])
render(convexity = 1) {
difference() {
hull() {
rotate([0,0,30])
scale([1.125,1,1])
cylinder(h = wrench_size*0.625, r=wrench_size*.5+2);
translate([wrench_size/8, -wrench_size/2, 0])
cylinder(h = wrench_size*0.625, r=wrench_size*.5+2);
}
{rotate([0,0,15])
{translate([-wrench_size/2, -wrench_size*2.25, -wrench_size/4])
cube (size=[wrench_size,wrench_size*2,wrench_size]);
translate([0, -wrench_size/4, -wrench_size/4])
scale([2,1,1])
cylinder(h = wrench_size, r=wrench_size/4);
}}}}
}

wrench (8,86);``````
Code is a bit rough and probably won't work at all sizes --- improvements welcome.

### Re: Drawing tools in OpenSCAD

Posted: Mon Jun 03, 2013 2:44 am
and a screwdriver:
openscad_screwdriver.png (9.59 KiB) Viewed 6095 times

### Re: Drawing tools in OpenSCAD

Posted: Mon Jun 03, 2013 6:27 pm
and Brown & Sharpe micrometer (sans locking lever):
openscad_micrometer.png (5.33 KiB) Viewed 6068 times

### Re: Drawing tools in OpenSCAD

Posted: Mon Jun 03, 2013 6:29 pm
All that leaves is the Mitutoyo analog caliper.

Anyone have suggestions for other useful tools?

### Re: Drawing tools in OpenSCAD

Posted: Fri Jun 07, 2013 3:23 am
And we're done (except for the scribing point):
openscad_analog_calipers.png (7.08 KiB) Viewed 6011 times
Initial arrangement:
openscad_cigarbox.png (13.18 KiB) Viewed 6011 times
Just need to add finger cut-outs and extrude.

### Re: Drawing tools in OpenSCAD

Posted: Fri Jun 07, 2013 11:02 am
Hmm, can't linear extrude a 3D shape....

I guess the CAM program handles the balance?

### Re: Drawing tools in OpenSCAD

Posted: Fri Jun 07, 2013 11:59 am
You could try adding a second tool positioned up higher and do a hull() operation to join the two in an extrusion-like object. I'm not sure if hull works with 3D objects, if it does work the object may take a long time to render.

### Re: Drawing tools in OpenSCAD

Posted: Fri Jun 07, 2013 4:40 pm
I was informed by two people on the OpenSCAD mailing list that the ``project()'' (but it's actually projection()) command will do what I need here --- will try it this evening.

William

### Re: Drawing tools in OpenSCAD

Posted: Sat Jun 08, 2013 1:59 pm
And I was asked to test, and tested projection to the point of failure --- works on the square, Allen wrenches, scribing point and wrench. Fails on the calipers, micrometer and screwdriver.

But I only really needed the square, so I'm good, after whacking at the calipers to make a ``valid 2-D manifold''.
openscad_cigarbox_extruded.png (13.12 KiB) Viewed 5946 times