cyclone-pcb-factory/Source_files/dxf/oshw.scad

46 lines
1.2 KiB
OpenSCAD
Raw Permalink Normal View History

// OSHW Logo Generator
// Open Source Hardware Logo : http://oshwlogo.com/
// -------------------------------------------------
//
// Adapted from Adrew Plumb/ClothBot original version
// just change internal parameters to made dimension control easier
// a single parameter : logo diameter (millimeters)
//
// oshw_logo_2D(diameter) generate a 2D logo with diameter requested
// just have to extrude to get a 3D version, then add it to your objects
//
// cc-by-sa, pierre-alain dorange, july 2012
// Increase the resolution of default shapes
$fa = 5; // Minimum angle for fragments [degrees]
$fs = 0.5; // Minimum fragment size [mm]
module gear_tooth_2d(d) {
polygon( points=[
[0.0,10.0*d/72.0], [0.5*d,d/15.0],
[0.5*d,-d/15.0], [0.0,-10.0*d/72.0] ] );
}
module oshw_logo_2d(d=10.0) {
rotate(-135) {
difference() {
union() {
circle(r=14.0*d/36.0);
for(i=[1:7]) assign(rotAngle=45*i+45)
rotate(rotAngle) gear_tooth_2d(d);
}
circle(r=10.0*d/72.0);
intersection() {
rotate(-20) square(size=[10.0*d/18.0,10.0*d/18.0]);
rotate(20) square(size=[10.0*d/18.0,10.0*d/18.0]);
}
}
}
}
// usage : oshw_logo_2d(diameter)
//linear_extrude(height=2)
oshw_logo_2d(25);