Posts: 8585
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

Working on this off-and-on:

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

Code: Select all

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 4134 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);
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Posts: 8585
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

### Re: Drawing tools in OpenSCAD

and a combination wrench:
openscad_wrench.png (6.24 KiB) Viewed 4112 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.
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Posts: 8585
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

### Re: Drawing tools in OpenSCAD

and a screwdriver:
openscad_screwdriver.png (9.59 KiB) Viewed 4105 times
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Posts: 8585
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

### Re: Drawing tools in OpenSCAD

and Brown & Sharpe micrometer (sans locking lever):
openscad_micrometer.png (5.33 KiB) Viewed 4078 times
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Posts: 8585
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

### Re: Drawing tools in OpenSCAD

All that leaves is the Mitutoyo analog caliper.

Anyone have suggestions for other useful tools?
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Posts: 8585
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

### Re: Drawing tools in OpenSCAD

And we're done (except for the scribing point):
openscad_analog_calipers.png (7.08 KiB) Viewed 4021 times
Initial arrangement:
openscad_cigarbox.png (13.18 KiB) Viewed 4021 times
Just need to add finger cut-outs and extrude.
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Posts: 8585
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

### Re: Drawing tools in OpenSCAD

Hmm, can't linear extrude a 3D shape....

I guess the CAM program handles the balance?
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

### Re: Drawing tools in OpenSCAD

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.
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

Posts: 8585
Joined: Mon Apr 09, 2012 6:11 pm
Location: Pennsylvania --- south of the Turnpike, East of US-15
Contact:

### Re: Drawing tools in OpenSCAD

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
Shapeoko 3XL #0006 w/ Carbide Compact Router w/0.125″ and ¼″ Carbide 3D precision collets