X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=blobdiff_plain;f=utils.scad;h=e440b5f03d6cf1966889522bbc497946d851fb57;hp=5234d5151e3023d2dda7eb81331884f88f73352c;hb=916bd585aa4d5c37e2b5326d83c453e110e1ab58;hpb=d54c8edf3430f88517c17213e2accfc6d856bcf0 diff --git a/utils.scad b/utils.scad index 5234d51..e440b5f 100644 --- a/utils.scad +++ b/utils.scad @@ -24,3 +24,28 @@ module FArcSegment(xc,yc,inrad,outrad,alpha,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(); +}