From 2cbfe8e17ae89257bce84a58c340fa90bca555d9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 13 Feb 2016 22:06:31 +0000 Subject: [PATCH] sealing-box, bike-lipo-box: $-ise cnrrad --- bike-lipo-box.scad | 9 ++++----- sealing-box.scad.m4 | 30 +++++++++++++++++------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/bike-lipo-box.scad b/bike-lipo-box.scad index b7c4cd6..6056d61 100644 --- a/bike-lipo-box.scad +++ b/bike-lipo-box.scad @@ -83,7 +83,6 @@ innertube = 1.0 + 0.2; lidoverlap = 1.5; lidoverhang = 6; tubesealrad = 2.0; -ts_cnrrad = 10; include @@ -100,11 +99,11 @@ module TestSealLid(){ ////toplevel translate([totx_outer * .75, toty_outer/2, 0]) cylinder(h=100, r=5); - translate([-wallthick + ts_cnrrad*.5, - ts_cnrrad*.5 - wallthick, + translate([-wallthick + $sealingbox_cnrrad*.5, + $sealingbox_cnrrad*.5 - wallthick, totz_inner + $sealingbox_ceilth]) - Commitid_BestCount([totx_outer * .75 - 2.5 - (ts_cnrrad*.5), - toty_outer - (ts_cnrrad*.5 - wallthick)*2]); + Commitid_BestCount([totx_outer * .75 - 2.5 - ($sealingbox_cnrrad*.5), + toty_outer - ($sealingbox_cnrrad*.5 - wallthick)*2]); } } diff --git a/sealing-box.scad.m4 b/sealing-box.scad.m4 index 3130e6d..efc253a 100644 --- a/sealing-box.scad.m4 +++ b/sealing-box.scad.m4 @@ -12,8 +12,6 @@ // $sealingbox_ceilth // $sealingbox_floorth // $sealingbox_wallth -// ts_cnrrad (outer radius of corners, leave at default normall) -// xxx default should be in this file // 3. use the modules // SealingBox_RectBox // SealingBox_RectLid @@ -23,6 +21,11 @@ // 2. Define your own BoxDoShapeSomething like BoxDoShapeRect // 3. Invoke BoxUseShape // 4. Use the Box and Lid modules generated +// +// Other settings +// $sealingbox_cnrrad + +$sealingbox_cnrrad = 10; m4_define(`BoxLocals',` wall = $sealingbox_wallth; @@ -31,11 +34,12 @@ m4_define(`BoxLocals',` xbox = $sealingbox_xbox; ybox = $sealingbox_ybox; zbox = $sealingbox_zbox; + cnrrad = $sealingbox_cnrrad; - ts_cidoff = (ts_cnrrad * (1-.7) + wall * .8) * [1,1]; + ts_cidoff = (cnrrad * (1-.7) + wall * .8) * [1,1]; - xbox_lin = xbox - ts_cnrrad*2; - ybox_lin = ybox - ts_cnrrad*2; + xbox_lin = xbox - cnrrad*2; + ybox_lin = ybox - cnrrad*2; ') m4_dnl Box_Part($1=transl_x,$2=transl_y, $3=rot_z,$4=mirror_xy) @@ -81,14 +85,14 @@ m4_define(`BoxPart_Extrude_Arc',` m4_dnl BoxDoShapeRect(`profile(profileargs)'); m4_define(`BoxDoShapeRect',` - Box_Part(0, ts_cnrrad, 0,0, Linear,`ybox_lin', `$1' ) - Box_Part(0, ybox-ts_cnrrad, 0,0, Arc,`-ts_cnrrad,90' , `$1' ) - Box_Part(ts_cnrrad, ybox, -90,0, Linear,`xbox_lin', `$1' ) - Box_Part(xbox-ts_cnrrad, ybox, -90,0, Arc,`-ts_cnrrad,90' , `$1' ) - Box_Part(xbox, ybox-ts_cnrrad, -180,0, Linear,`ybox_lin', `$1' ) - Box_Part(xbox, ts_cnrrad, -180,0, Arc,`-ts_cnrrad,90' , `$1' ) - Box_Part(xbox-ts_cnrrad, 0, -270,0, Linear,`xbox_lin', `$1' ) - Box_Part(ts_cnrrad, 0, -270,0, Arc,`-ts_cnrrad,90' , `$1' ) + Box_Part(0, cnrrad, 0,0, Linear,`ybox_lin', `$1' ) + Box_Part(0, ybox-cnrrad, 0,0, Arc,`-cnrrad,90' , `$1' ) + Box_Part(cnrrad, ybox, -90,0, Linear,`xbox_lin', `$1' ) + Box_Part(xbox-cnrrad, ybox, -90,0, Arc,`-cnrrad,90' , `$1' ) + Box_Part(xbox, ybox-cnrrad, -180,0, Linear,`ybox_lin', `$1' ) + Box_Part(xbox, cnrrad, -180,0, Arc,`-cnrrad,90' , `$1' ) + Box_Part(xbox-cnrrad, 0, -270,0, Linear,`xbox_lin', `$1' ) + Box_Part(cnrrad, 0, -270,0, Arc,`-cnrrad,90' , `$1' ) ') m4_dnl ' -- 2.30.2