X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=utils.scad;h=b1ed2005c164f0c0e0f7ca6e76dfcf10b206767e;hb=refs%2Fheads%2Fmaster;hp=e440b5f03d6cf1966889522bbc497946d851fb57;hpb=e483e7b4218e5d2501dadd948c101299ed91248e;p=reprap-play.git diff --git a/utils.scad b/utils.scad deleted file mode 100644 index e440b5f..0000000 --- a/utils.scad +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C -*- - -// suitable for masking things within radius sqrt(2) only -module FArcSegment_mask(beta) { - for (i=[0 : 0.75 : 3]) { - rotate(i*beta/4) - polygon([[0, 0], - [1, 0], - [cos(beta/4), sin(beta/4)]]); - } -} - -module FArcSegment(xc,yc,inrad,outrad,alpha,delta) { - translate([xc,yc]) { - intersection() { - difference() { - circle(r=outrad, $fn=70); - circle(r=inrad, $fn=70); - } - rotate(alpha) scale(outrad*2) { - FArcSegment_mask(delta); - } - } - } -} - -module rectfromto(a,b) { - ab = b - a; - translate([min(a[0], b[0]), min(a[1], b[1])]) - square([abs(ab[0]), abs(ab[1])]); -} -module circleat(c,r) { translate(c) circle(r); } -module linextr(z0,z1, convexity=20) { - translate([0,0,z0]) - linear_extrude(height=z1-z0, convexity=convexity) - children(); -} - -module linextr_x_yz(x0,x1, convexity=20) { // XY turn into YZ - rotate([90,0,0]) - rotate([0,90,0]) - linextr(x0,x1, convexity=convexity) - children(); -} - -module linextr_y_xz(y0,y1, convexity=20) { // XY turn into YZ - rotate([0,0,180]) - rotate([90,0,0]) - linextr(y0,y1, convexity=convexity) - children(); -} diff --git a/utils.scad b/utils.scad new file mode 120000 index 0000000..b1ed200 --- /dev/null +++ b/utils.scad @@ -0,0 +1 @@ +diziet-utils/utils.scad \ No newline at end of file