<div dir="ltr">There is an error with the triangular piece below the hinge, it extends below the box.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-11 1:03 GMT+02:00 linkreincarnate <span dir="ltr"><<a href="mailto:linkreincarnate@gmail.com" target="_blank">linkreincarnate@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So I just finished my first major project in openscad thanks to all of you<br>
who helped out with my questions.  That said I am sure the code could be<br>
optimized for readability and maintainability.  Would anyone in here be so<br>
kind as to look over my code and offer me some suggestions or examples of<br>
how I could make it better and more easily parametric.<br>
<br>
I am specifically interested in creating better encapsulation, reducing code<br>
duplication, and optimizing for Thingiverse's customizer.<br>
<br>
<br>
<br>
Giant text dump follows.<br>
<br>
//3d printable cigarette rolling machine<br>
//Created By LinkReincarnate<br>
//CC Share Alike Attribution Non-Commercial<br>
//*************VARIABLE DECLARATION SECTION******** all values are in mm<br>
<br>
<br>
//make sure to change the hingeSlotXOffset when you change the box length.<br>
boxLength = 90.4;<br>
boxWidth = 81.25;<br>
boxHeight = 19.2;<br>
boxBottomThickness = 2;<br>
boxWallThickness = .67;<br>
boxArcHeight = 3.5;<br>
boxArcRadius=1;<br>
boxControlArmHoleZOffset = 3.5;<br>
boxControlArmHoleYOffset = 3;<br>
boxHingePinDiameter = 3;<br>
boxHingeDiameter= 5;<br>
boxHingeZOffset = -5;<br>
boxHingeYOffset = 0;<br>
boxHingeTolerance = .1;<br>
boxHingeSupportZOffset= 0;<br>
boxHingeSupportYOffset = -4.5;<br>
boxHingeNumberOfSplits = 7;<br>
boxHingeClearance=1;<br>
//the following variables determine the details of the cylinder (or sphere)<br>
used for minkowski sums<br>
boxCornerRoundness = 7;<br>
boxCornerSmoothness = 16;<br>
<br>
controlArmLength = 38.5;<br>
controlArmHeight = 7;<br>
controlArmThickness = 5;<br>
controlArmPinDiameter = 2;<br>
controlArmHoleZOffset = 0;<br>
controlArmHoleYOffset = 0;<br>
controlArmPinTolerance = .1;<br>
<br>
lidLipHeight = 5;<br>
lidThickness = 5;<br>
lidTolerance = 1;<br>
lidHingeZOffset = 0;<br>
lidHingeYOffset = 1;<br>
lidHingeXOffset =.4;<br>
lidHingeTolerance = 1;<br>
lidOverlap = 2;<br>
<br>
//moves hinge slot cutouts left and right<br>
hingeSlotXOffset = 0;<br>
hingeSlotYOffset = 0;<br>
hingeSlotZOffset = 0;<br>
<br>
dispenserHoleLength = 71.5; //also used for dist between tracks<br>
dispenserHoleWidth = 11.5;<br>
dispenserHoleXOffset = 0;<br>
dispenserHoleYOffset = 0;<br>
<br>
trackPanelLength = 76;<br>
trackPanelWidth = 19;<br>
trackPanelThickness = 3;<br>
trackWidth = 2.5;<br>
trackLength = 61;<br>
trackHeight = 14;<br>
trackTolerance = 1;<br>
trackControlPoint1X = 3;<br>
trackControlPoint1Y = 3;<br>
trackControlPoint1Z = 0;<br>
trackControlPoint2X = 9;<br>
trackControlPoint2Y = 9;<br>
trackControlPoint2Z = 0;<br>
trackControlPoint3X = 45;<br>
trackControlPoint3Y = 8;<br>
trackControlPoint3Z = 0;<br>
trackControlPoint4X = 57;<br>
trackControlPoint4Y = 14;<br>
trackControlPoint4Z = 0;<br>
<br>
<br>
rollerDiameter = 7;<br>
rollerLength = 71;<br>
<br>
rollerPinDiameter = 2;<br>
hingePinDiameter = 1.6;<br>
pinLength= 71;<br>
<br>
pinTolerance = 1;<br>
cigaretteDiameter = 7.75;<br>
cigaretteLength = 70;<br>
<br>
booleanOverlap = .01; //to ensure that the faces used to difference() dont<br>
line up<br>
lowRollingClearance = 5; //the distance from the center of the rolling pin<br>
to the lid at the lowest point.<br>
hightRollingClearance = 12.6;<br>
<br>
boxRoundCorners = true;<br>
arched = true;<br>
//uses math to determin the arc radius of the curve of the box and creates<br>
the appropriate cylinder<br>
<br>
//*************MODULE DECLARATION SECTION***************************<br>
module CreateArc(            arcLength,<br>
                             arcHeight,<br>
                             cylinderHeight){<br>
    carveRadius = ((arcHeight/2)+((arcLength * arcLength)/arcHeight *<br>
8)/(53));<br>
    rotate(a=[90,180,90]){<br>
        translate([0,-carveRadius + arcHeight - (boxHeight/2),0]){<br>
            cylinder(r=carveRadius, h=cylinderHeight+booleanOverlap,<br>
$fn=1024, center=true);<br>
        }<br>
<br>
    }<br>
}//end of module<br>
<br>
<br>
module CreateNonArchedBody(  boxLength,<br>
                             boxWidth,<br>
                             boxHeight,<br>
                             boxBottomThickness,<br>
                             boxWallThickness,<br>
                             boxRoundCorners,<br>
                             boxCornerRoundness,<br>
                             boxCornerSmoothness,<br>
                             boxHingeDiameter,<br>
                             boxHingePinDiameter,<br>
                             boxHingeZOffset,<br>
                             boxHingeYOffset,<br>
                             boxHingeTolerance,<br>
                             boxHingeClearance,<br>
                             boxHingeNumberOfSplits,<br>
                             pinTolerance,<br>
                             controlArmPinDiameter,<br>
                             boxControlArmHoleZOffset,<br>
                             boxControlArmHoleYOffset,<br>
                             controlArmPinTolerance,<br>
                             boxHingeSupportZOffset,<br>
                             boxHingeSupportYOffset,<br>
                             booleanOverlap){<br>
 //union joins the difference of the outer and inner bodies with a pinhole<br>
for the arms and the hinge parts<br>
    union(){<br>
        //create body<br>
         if (boxRoundCorners){<br>
           difference(){<br>
                $fn=boxCornerSmoothness;<br>
                minkowski(){<br>
                 cube([boxLength-(2*boxCornerRoundness),boxWidth -<br>
(2*boxCornerRoundness),boxHeight/2],<br>
                     center = true);<br>
                 cylinder(r=boxCornerRoundness,h=boxHeight/2, center=true);<br>
                }<br>
                translate([0,0,(boxBottomThickness/2) + booleanOverlap]) {<br>
                    $fn=boxCornerSmoothness;<br>
                    minkowski()<br>
                    {<br>
                     cube([boxLength -<br>
boxWallThickness-(2*boxCornerRoundness),<br>
                              boxWidth - boxWallThickness<br>
-(2*boxCornerRoundness),<br>
                              ((boxHeight/2) - (boxBottomThickness/2))],<br>
                              center = true);<br>
                     cylinder(r=boxCornerRoundness,h=((boxHeight/2) -<br>
(boxBottomThickness/2)), center=true);<br>
                    }<br>
                }<br>
                //create pinholes to connect control arms<br>
                rotate(a=[0, -90, 0]){<br>
<br>
translate([boxControlArmHoleZOffset,boxControlArmHoleYOffset,0]){<br>
                        cylinder(d= (controlArmPinDiameter +<br>
controlArmPinTolerance),<br>
                                     boxLength + booleanOverlap,<br>
                                     center=true );<br>
                    }<br>
                }<br>
<br>
            } //end of difference<br>
         } else {<br>
              difference(){<br>
                    cube([boxLength,boxWidth,boxHeight],<br>
                         center = true);<br>
                    translate([0,0,(boxBottomThickness/2) +booleanOverlap])<br>
{<br>
                        cube([boxLength - boxWallThickness,<br>
                              boxWidth - boxWallThickness,<br>
                              (boxHeight - boxBottomThickness)],<br>
                              center = true);<br>
                    }<br>
                    //create pinholes to connect control arms<br>
                    rotate(a=[0, -90, 0]){<br>
<br>
translate([boxControlArmHoleZOffset,boxControlArmHoleYOffset,0]){<br>
                            cylinder(d= (controlArmPinDiameter +<br>
controlArmPinTolerance),<br>
                                         boxLength + booleanOverlap,<br>
                                         center=true );<br>
                        }<br>
                    }<br>
<br>
              }<br>
         }<br>
         CreateHinge(boxRoundCorners,<br>
                     boxWidth,<br>
                     boxLength,<br>
                     boxHeight,<br>
                     boxHingeDiameter,<br>
                     boxHingePinDiameter,<br>
                     boxHingeZOffset,<br>
                     boxHingeYOffset,<br>
                     boxHingeTolerance,<br>
                     boxHingeClearance,<br>
                     boxHingeNumberOfSplits,<br>
                     pinTolerance,<br>
                     boxHingeSupportZOffset,<br>
                     boxHingeSupportYOffset,<br>
                     lidHingeZOffset,<br>
                     lidHingeYOffset,<br>
                     lidHingeTolerance,<br>
                     booleanOverlap);<br>
     }// end of union body and hinge<br>
}//end of module<br>
module CreateArchedBody(     boxLength,<br>
                             boxWidth,<br>
                             boxHeight,<br>
                             boxBottomThickness,<br>
                             boxWallThickness,<br>
                             boxRoundCorners,<br>
                             boxCornerRoundness,<br>
                             boxCornerSmoothness,<br>
                             boxHingeDiameter,<br>
                             boxHingePinDiameter,<br>
                             boxHingeZOffset,<br>
                             boxHingeYOffset,<br>
                             boxHingeTolerance,<br>
                             boxHingeClearance,<br>
                             boxHingeNumberOfSplits,<br>
                             pinTolerance,<br>
                             controlArmPinDiameter,<br>
                             boxControlArmHoleZOffset,<br>
                             boxControlArmHoleYOffset,<br>
                             controlArmPinTolerance,<br>
                             boxHingeSupportZOffset,<br>
                             boxHingeSupportYOffset,<br>
                             booleanOverlap,<br>
                             boxArcHeight,<br>
                             boxArcRadius<br>
                             ){<br>
    union(){<br>
    //create body<br>
      if (boxRoundCorners){<br>
         translate([0,0,boxHingeSupportZOffset+boxArcHeight+1])<br>
             difference(){<br>
                intersection(){<br>
                    $fn=boxCornerSmoothness;<br>
                    minkowski(){<br>
                     cube([boxLength-(2*boxCornerRoundness),<br>
                           boxWidth - (2*boxCornerRoundness),<br>
                           boxHeight+boxArcHeight/2],<br>
                         center = true);<br>
                     cylinder(r=boxCornerRoundness,h=boxHeight +<br>
boxArcHeight/2);<br>
                    }<br>
                    translate([0,0,-boxHeight+boxArcHeight])<br>
                        CreateArc(boxWidth, boxArcHeight, boxLength);<br>
                 }<br>
                translate([0,0,(boxBottomThickness/2)]){<br>
                   intersection(){<br>
                         $fn=boxCornerSmoothness;<br>
                         minkowski(){<br>
                             cube([boxLength -<br>
boxWallThickness-(2*boxCornerRoundness),<br>
                                   boxWidth - boxWallThickness<br>
-(2*boxCornerRoundness),<br>
                                   (((boxHeight+boxArcHeight/2) -<br>
boxBottomThickness) + booleanOverlap)],<br>
                                   center = true);<br>
                             cylinder(r=boxCornerRoundness,h=boxHeight/2);<br>
                        }<br>
                        translate([0,0,-boxHeight+boxArcHeight])<br>
                            CreateArc(boxWidth, boxArcHeight, boxLength);<br>
                    }<br>
                }<br>
                //create pinholes to connect control arms<br>
                rotate(a=[0, -90, 0]){<br>
<br>
translate([boxControlArmHoleZOffset,boxControlArmHoleYOffset,0]){<br>
                        cylinder(d= (controlArmPinDiameter +<br>
                                     controlArmPinTolerance),<br>
                                     boxLength + booleanOverlap,<br>
                                     center=true );<br>
                    }<br>
                }<br>
<br>
                CreateArc(boxWidth, boxArcHeight, boxLength+booleanOverlap);<br>
              //insert objects here to difference them from the main body<br>
      }<br>
      } else {<br>
          difference(){<br>
              intersection(){<br>
                cube([boxLength,boxWidth,boxHeight+boxArcHeight],<br>
                     center = true);<br>
                translate([0,0,-boxHeight+boxArcHeight]){<br>
                    CreateArc(boxWidth, boxArcHeight, boxLength);<br>
                }<br>
<br>
              }<br>
              intersection(){<br>
                    translate([0,0,(boxBottomThickness/2)]){<br>
                        cube([boxLength - boxWallThickness,<br>
                              boxWidth - boxWallThickness,<br>
                              ((boxHeight +boxArcHeight -<br>
boxBottomThickness) + booleanOverlap)],<br>
                              center = true);<br>
                    }<br>
                    translate([0,0,-boxHeight+boxArcHeight]){<br>
                         CreateArc(boxWidth, boxArcHeight, boxLength);<br>
                    }<br>
                }<br>
                //create pinholes to connect control arms<br>
                rotate(a=[0, -90, 0]){<br>
<br>
translate([boxControlArmHoleZOffset,boxControlArmHoleYOffset,0]){<br>
                       cylinder(d= (controlArmPinDiameter +<br>
                                    controlArmPinTolerance),<br>
                                    boxLength + booleanOverlap,<br>
                                    center=true );<br>
                   }<br>
                }<br>
                CreateArc(boxWidth,boxArcHeight,boxLength + booleanOverlap);<br>
                //insert here to difference with body<br>
            }<br>
      }<br>
    //Create Hinge and hinge support<br>
    CreateHinge( boxRoundCorners,<br>
                 boxWidth,<br>
                 boxLength,<br>
                 boxHeight,<br>
                 boxHingeDiameter,<br>
                 boxHingePinDiameter,<br>
                 boxHingeZOffset,<br>
                 boxHingeYOffset,<br>
                 boxHingeTolerance,<br>
                 boxHingeClearance,<br>
                 boxHingeNumberOfSplits,<br>
                 pinTolerance,<br>
                 boxHingeSupportZOffset,<br>
                 boxHingeSupportYOffset,<br>
                 lidHingeZOffset,<br>
                 lidHingeYOffset,<br>
                 lidHingeTolerance,<br>
                 booleanOverlap);<br>
    //insert new parts to be added to the body here<br>
    }<br>
}//end of module<br>
module CreateNonArchedLid(          lidLipHeight,<br>
                                    lidThickness,<br>
                                    lidTolerance,<br>
                                    lidHingeZOffset,<br>
                                    lidHingeYOffset,<br>
                            //add lidHingeXOffset and hingeSlotXOffset<br>
                                    lidHingeTolerance,<br>
                                    lidOverlap,<br>
                                    hingeSlotXOffset,<br>
                                    hingeSlotYOffset,<br>
                                    hingeSlotZOffset,<br>
                                    boxLength,<br>
                                    boxWidth,<br>
                                    boxHeight,<br>
                                    boxRoundCorners,<br>
                                    boxCornerRoundness,<br>
                                    boxCornerSmoothness,<br>
                                    boxHingeDiameter,<br>
                                    boxHingePinDiameter,<br>
                                    boxHingeNumberOfSplits,<br>
                                    dispenserHoleLength,<br>
                                    dispenserHoleWidth,<br>
                                    dispenserHoleXOffset,<br>
                                    dispenserHoleYOffset,<br>
                                    rollerLength,<br>
                                    trackPanelThickness,<br>
                                    booleanOverlap){<br>
  if (boxRoundCorners){<br>
             difference(){<br>
                    $fn=boxCornerSmoothness;<br>
                    //this is the exterior of the lid<br>
                    minkowski(){<br>
                     cube([lidOverlap + boxLength + lidTolerance - (2 *<br>
boxCornerRoundness),<br>
                           lidOverlap + boxWidth + lidTolerance - (2 *<br>
boxCornerRoundness),<br>
                           ((lidThickness + lidLipHeight)/2)]);<br>
                     cylinder(r=boxCornerRoundness,h=((lidThickness +<br>
lidLipHeight)/2));<br>
                    }<br>
                    //this is the interior cutout<br>
                    translate([lidOverlap/2,lidOverlap/2,-booleanOverlap ]){<br>
                        $fn=boxCornerSmoothness;<br>
                        minkowski()<br>
                        {<br>
                         cube([boxLength + lidTolerance - (2 *<br>
boxCornerRoundness) ,<br>
                               boxWidth + lidTolerance - (2 *<br>
boxCornerRoundness),<br>
                               lidLipHeight/2]);<br>
                         cylinder(r=boxCornerRoundness,h=lidLipHeight/2);<br>
                        }<br>
                    }<br>
                    //this is the hinge lip cutout<br>
                    {<br>
                    translate([-((boxCornerRoundness/2) + (lidTolerance/2) +<br>
((lidOverlap/2))),0,-booleanOverlap])<br>
                    cube([boxLength - lidTolerance,<br>
                               boxWidth + lidTolerance,<br>
                               lidLipHeight +booleanOverlap]);<br>
                    }<br>
                    //hingeslots<br>
                    //this splits the hinge cylinder into individual pieces,<br>
also cuts clearance slots into the lid<br>
                    difference(){<br>
                        //change this rotate to 90 to invert the hinge slot<br>
cut over one hingelength<br>
                      rotate(a=[0,270,0])<br>
                       translate([lidLipHeight,<br>
                                  boxWidth + lidOverlap -<br>
(boxCornerRoundness),<br>
                                  -((boxCornerRoundness/2)) -boxLength]){<br>
                          translate([0,0,hingeSlotXOffset + lidOverlap/2 +<br>
lidTolerance])<br>
                          {<br>
                               for ( i = [0 : boxHingeNumberOfSplits/2] )<br>
                                    {<br>
                                        //LOOK HERE TO TRY TO FIX HINGE SLOT<br>
MISALIGNMENT<br>
                                        translate([0, 0,<br>
boxLength/boxHingeNumberOfSplits * i *2])<br>
<br>
cylinder(d=boxHingeDiameter+boxHingeTolerance+booleanOverlap +<br>
boxHingeClearance,<br>
<br>
(boxLength/boxHingeNumberOfSplits) + boxHingeTolerance + lidHingeTolerance);<br>
                                     }<br>
                          }<br>
<br>
                        }<br>
                        //this cube acts as an endstop precenting the hinge<br>
from being cut past the point it needs to be cut<br>
                        translate([-boxCornerRoundness + boxLength<br>
-(boxCornerRoundness/2) +lidTolerance/2 - (lidOverlap/2),<br>
                                   0,<br>
                                   lidLipHeight -boxHingeDiameter -<br>
boxHingeTolerance - boxHingeClearance,]){<br>
                            cube([boxCornerRoundness,<br>
                                  boxWidth+10,<br>
                                  boxHeight]);<br>
                        }<br>
                        //same as above but on the other side! exciting...<br>
                        translate([-boxCornerRoundness,<br>
                                   0,<br>
                                   lidLipHeight -boxHingeDiameter -<br>
boxHingeTolerance - boxHingeClearance]){<br>
                            cube([boxCornerRoundness,<br>
                                  boxWidth+10,<br>
                                  boxHeight]);<br>
                        }<br>
                    }//end of hinge slot subtration<br>
                    //dispenser hole<br>
                    translate([boxCornerRoundness/2 +lidTolerance/2<br>
,0,lidThickness-2])<br>
<br>
cube([dispenserHoleLength,dispenserHoleWidth,lidThickness+10<br>
+booleanOverlap]);<br>
                    //trackPanelMountingHoles<br>
  //***********Get the thickness out of the module somehow so i can arrange<br>
the track panels outside the dispenser hole<br>
                    translate([boxCornerRoundness/2<br>
+lidTolerance/2,0,lidThickness+booleanOverlap]){<br>
                     rotate([270,0,90]){<br>
                     #CreateControlTrack(<br>
                            controlArmLength,<br>
                            controlArmHeight,<br>
                            controlArmThickness,<br>
                            controlArmPinDiameter,<br>
                            controlArmHoleZOffset,<br>
                            controlArmHoleYOffset,<br>
                            controlArmPinTolerance,<br>
                            lidLipHeight,<br>
                            lidThickness,<br>
                            lidTolerance,<br>
                            boxLength,<br>
                            boxWidth,<br>
                            boxHeight,<br>
                            boxRoundCorners,<br>
                            boxCornerRoundness,<br>
                            boxHingePinDiameter,<br>
                            trackPanelLength,<br>
                            trackPanelWidth,<br>
                            trackPanelThickness,<br>
                            trackWidth,<br>
                            trackLength,<br>
                            trackHeight,<br>
                            trackTolerance,<br>
                            trackControlPoint1X,<br>
                            trackControlPoint1Y,<br>
                            trackControlPoint1Z,<br>
                            trackControlPoint2X,<br>
                            trackControlPoint2Y,<br>
                            trackControlPoint2Z,<br>
                            trackControlPoint3X,<br>
                            trackControlPoint3Y,<br>
                            trackControlPoint3Z,<br>
                            trackControlPoint4X,<br>
                            trackControlPoint4Y,<br>
                            trackControlPoint4Z);<br>
                      translate([0,0,-dispenserHoleLength<br>
-trackPanelThickness])<br>
                     #CreateControlTrack(<br>
                            controlArmLength,<br>
                            controlArmHeight,<br>
                            controlArmThickness,<br>
                            controlArmPinDiameter,<br>
                            controlArmHoleZOffset,<br>
                            controlArmHoleYOffset,<br>
                            controlArmPinTolerance,<br>
                            lidLipHeight,<br>
                            lidThickness,<br>
                            lidTolerance,<br>
                            boxLength,<br>
                            boxWidth,<br>
                            boxHeight,<br>
                            boxRoundCorners,<br>
                            boxCornerRoundness,<br>
                            boxHingePinDiameter,<br>
                            trackPanelLength,<br>
                            trackPanelWidth,<br>
                            trackPanelThickness,<br>
                            trackWidth,<br>
                            trackLength,<br>
                            trackHeight,<br>
                            trackTolerance,<br>
                            trackControlPoint1X,<br>
                            trackControlPoint1Y,<br>
                            trackControlPoint1Z,<br>
                            trackControlPoint2X,<br>
                            trackControlPoint2Y,<br>
                            trackControlPoint2Z,<br>
                            trackControlPoint3X,<br>
                            trackControlPoint3Y,<br>
                            trackControlPoint3Z,<br>
                            trackControlPoint4X,<br>
                            trackControlPoint4Y,<br>
                            trackControlPoint4Z);<br>
                        }<br>
                    }<br>
             } // end of difference<br>
         } else {<br>
              difference(){<br>
                   //this is the exterior of the lid<br>
                   cube([lidOverlap + boxLength + lidTolerance,<br>
                           lidOverlap + boxWidth + lidTolerance,<br>
                           ((lidThickness + lidLipHeight))]);<br>
                    //this is the interior cutout<br>
                    translate([lidOverlap/2,lidOverlap +<br>
booleanOverlap,-booleanOverlap]){<br>
                        cube([boxLength + lidTolerance,<br>
                               boxWidth + lidTolerance,<br>
                               lidLipHeight]);<br>
                    }<br>
                    //this is the hinge lip cutout<br>
                    translate([lidOverlap/2,lidOverlap/2,-booleanOverlap]){<br>
                        cube([boxLength + lidTolerance,<br>
                                   boxWidth + lidTolerance,<br>
                                   lidLipHeight]);<br>
                    }<br>
                    //hingeslots<br>
                    //this splits the hinge cylinder into individual pieces,<br>
also cuts clearance slots into the lid<br>
                    rotate(a=[0,90,0])<br>
                       translate([-lidLipHeight,+boxWidth +<br>
boxHingeDiameter/2,lidOverlap/2]){<br>
                            for ( i = [0 : boxHingeNumberOfSplits] ){<br>
                                    translate([0, 0,<br>
boxLength/boxHingeNumberOfSplits * i *2])<br>
<br>
cylinder(d=boxHingeDiameter+boxHingeTolerance+booleanOverlap +<br>
boxHingeClearance,<br>
<br>
(boxLength/boxHingeNumberOfSplits) + boxHingeTolerance + lidHingeTolerance);<br>
                            }<br>
                        }<br>
              } // end of difference<br>
         }//end of else<br>
<br>
<br>
 }//end of Lid Module<br>
module CreateArchedLid(             lidLipHeight,<br>
                                    lidThickness,<br>
                                    lidTolerance,<br>
                                    lidHingeZOffset,<br>
                                    lidHingeYOffset,<br>
                                    lidHingeTolerance,<br>
                                    boxLength,<br>
                                    boxWidth,<br>
                                    boxHeight,<br>
                                    boxRoundCorners,<br>
                                    boxCornerRoundness,<br>
                                    boxCornerSmoothness,<br>
                                    boxHingeDiameter,<br>
                                    boxHingePinDiameter,<br>
                                    dispenserHoleLength,<br>
                                    dispenserHoleWidth,<br>
                                    dispenserHoleXOffset,<br>
                                    dispenserHoleYOffset,<br>
                                    rollerLength,<br>
                                    boxArcHeight,<br>
                                    boxArcRadius,<br>
                                    booleanOverlap)<br>
                                    {}<br>
<br>
<br>
module CreateControlArm(            controlArmLength,<br>
                                    controlArmHeight,<br>
                                    controlArmThickness,<br>
                                    controlArmPinDiameter,<br>
                                    controlArmHoleZOffset,<br>
                                    controlArmHoleYOffset,<br>
                                    controlArmPinTolerance){<br>
<br>
    difference(){<br>
        hull(){<br>
            translate()<br>
                cylinder(d=controlArmHeight, h=controlArmThickness);<br>
            translate([controlArmLength,0,0])<br>
                cylinder(d=controlArmHeight, h=controlArmThickness);<br>
        }//end of hull<br>
        translate([0,0,-controlArmThickness/2])<br>
                #cylinder(d=controlArmPinDiameter, h=controlArmThickness*2,<br>
$fn=32);<br>
            translate([controlArmLength,0,-controlArmThickness/2])<br>
                #cylinder(d=controlArmPinDiameter, h=controlArmThickness*2,<br>
$fn=32);<br>
    }//end of difference<br>
}//end of module<br>
module CreateControlTrack(          controlArmLength,<br>
                                    controlArmHeight,<br>
                                    controlArmThickness,<br>
                                    controlArmPinDiameter,<br>
                                    controlArmHoleZOffset,<br>
                                    controlArmHoleYOffset,<br>
                                    controlArmPinTolerance,<br>
                                    lidLipHeight,<br>
                                    lidThickness,<br>
                                    lidTolerance,<br>
                                    boxLength,<br>
                                    boxWidth,<br>
                                    boxHeight,<br>
                                    boxRoundCorners,<br>
                                    boxCornerRoundness,<br>
                                    boxHingePinDiameter,<br>
                                    trackPanelLength,<br>
                                    trackPanelWidth,<br>
                                    trackPanelThickness,<br>
                                    trackWidth,<br>
                                    trackLength,<br>
                                    trackHeight,<br>
                                    trackTolerance,<br>
                                    trackControlPoint1X,<br>
                                    trackControlPoint1Y,<br>
                                    trackControlPoint1Z,<br>
                                    trackControlPoint2X,<br>
                                    trackControlPoint2Y,<br>
                                    trackControlPoint2Z,<br>
                                    trackControlPoint3X,<br>
                                    trackControlPoint3Y,<br>
                                    trackControlPoint3Z,<br>
                                    trackControlPoint4X,<br>
                                    trackControlPoint4Y,<br>
                                    trackControlPoint4Z){<br>
    union(){<br>
        difference(){<br>
            //Track Panel<br>
            cube([trackPanelLength,trackPanelWidth, trackPanelThickness]);<br>
            //Track<br>
            hull(){<br>
<br>
translate([trackControlPoint1X,trackControlPoint1Y,trackControlPoint1Z -<br>
booleanOverlap])<br>
                    cylinder(d=trackWidth+trackTolerance,h =<br>
trackPanelThickness + booleanOverlap*2, $fn=32);<br>
<br>
<br>
translate([trackControlPoint2X,trackControlPoint2Y,trackControlPoint2Z -<br>
booleanOverlap])<br>
                    cylinder(d=trackWidth+trackTolerance,h =<br>
trackPanelThickness + booleanOverlap*2, $fn=64);<br>
            }<br>
            hull(){<br>
<br>
translate([trackControlPoint2X,trackControlPoint2Y,trackControlPoint2Z -<br>
booleanOverlap])<br>
                    cylinder(d=trackWidth+trackTolerance,h =<br>
trackPanelThickness + booleanOverlap*2, $fn=64);<br>
<br>
<br>
translate([trackControlPoint3X,trackControlPoint3Y,trackControlPoint3Z -<br>
booleanOverlap])<br>
                    cylinder(d=trackWidth+trackTolerance,h =<br>
trackPanelThickness + booleanOverlap*2, $fn=64);<br>
            }<br>
            hull(){<br>
<br>
translate([trackControlPoint3X,trackControlPoint3Y,trackControlPoint3Z -<br>
booleanOverlap])<br>
                    cylinder(d=trackWidth+trackTolerance,h =<br>
trackPanelThickness + booleanOverlap*2, $fn=64);<br>
<br>
<br>
translate([trackControlPoint4X,trackControlPoint4Y,trackControlPoint4Z -<br>
booleanOverlap])<br>
                    cylinder(d=trackWidth+trackTolerance,h =<br>
trackPanelThickness + booleanOverlap*2, $fn=64);<br>
            }<br>
            //rollerflap pin holes<br>
            translate([trackPanelLength*.14,trackPanelWidth<br>
*.07,-booleanOverlap])<br>
                cylinder(d= boxHingePinDiameter, h= trackPanelThickness +<br>
booleanOverlap*2, $fn=64);<br>
            translate([trackPanelLength*.9,trackPanelWidth<br>
*.14,-booleanOverlap])<br>
                cylinder(d= boxHingePinDiameter, h= trackPanelThickness +<br>
booleanOverlap*2, $fn=64);<br>
<br>
            //Right Side Angle Cut<br>
            translate([trackPanelLength,0,-booleanOverlap]){<br>
                rotate([0,0,45]){<br>
<br>
cube([trackPanelLength/4,sqrt(pow(trackPanelWidth,2)+pow(trackPanelWidth,2)),trackPanelThickness+booleanOverlap*2]);<br>
                }<br>
            }<br>
<br>
            //bottom-left corner rounding<br>
           difference(){<br>
                translate([-booleanOverlap,-booleanOverlap,-booleanOverlap])<br>
<br>
cube([trackWidth*2+booleanOverlap*2,trackWidth*2+booleanOverlap*2,trackPanelThickness<br>
+ booleanOverlap*2]);<br>
                translate([trackWidth,trackWidth,-booleanOverlap])<br>
                    cylinder(r=trackWidth,h=trackPanelThickness +<br>
booleanOverlap*2);<br>
                translate([trackWidth*2,-trackWidth,0])<br>
                    rotate([0,0,45])<br>
                        cube([trackWidth*4,trackWidth*4,trackPanelThickness<br>
+ booleanOverlap*2]);<br>
           }<br>
           //top-left corner cuttoff<br>
           translate([-booleanOverlap,(trackPanelWidth/2) - booleanOverlap,<br>
- booleanOverlap])<br>
               rotate([0,0,45])<br>
                   cube([trackPanelWidth + booleanOverlap*2, trackPanelWidth<br>
+ booleanOverlap*2, trackPanelThickness + booleanOverlap*2]);<br>
           //Top angle cutoff<br>
           translate([-booleanOverlap, (trackPanelWidth * .75) -<br>
booleanOverlap, - booleanOverlap])<br>
               rotate([0,0,3])<br>
                   cube([trackPanelLength + booleanOverlap*2,<br>
trackPanelWidth + booleanOverlap*2, trackPanelThickness +<br>
booleanOverlap*2]);<br>
           //Bottom-right corner rounding<br>
           translate([trackPanelLength-lidTolerance,<br>
-booleanOverlap,-booleanOverlap])<br>
                   rotate([0,0,0])<br>
                   cube([trackPanelWidth, trackPanelWidth,<br>
trackPanelThickness + booleanOverlap*2]);<br>
<br>
<br>
        }//end of difference<br>
    //Connecting tabs<br>
    translate([trackPanelLength*.66,-lidThickness, 0])<br>
        cube([trackPanelThickness,lidThickness+1,trackPanelThickness]);<br>
    translate([trackPanelLength*.22, -lidThickness, 0])<br>
        cube([trackPanelThickness,lidThickness+1,trackPanelThickness]);<br>
    }//end of union<br>
}// end of CreateControlTrack module<br>
module CreateRoller(                rollerDiameter,<br>
                                    rollerLength,<br>
                                    rollerPinDiameter){<br>
difference(){<br>
<br>
    cylinder(d=rollerDiameter, h=rollerLength);<br>
    }<br>
    translate([0,0,-2.5])<br>
    cylinder(d=rollerPinDiameter, h=rollerLength +5);<br>
}<br>
<br>
module CreateLidHinge(              boxRoundCorners,<br>
                                    boxWidth,<br>
                                    boxLength,<br>
                                    boxHeight,<br>
                                    boxHingeDiameter,<br>
                                    boxHingePinDiameter,<br>
                                    boxHingeZOffset,<br>
                                    boxHingeYOffset,<br>
                                    boxHingeTolerance,<br>
                                    boxHingeClearance,<br>
                                    boxHingeNumberOfSplits,<br>
                                    pinTolerance,<br>
                                    boxHingeSupportZOffset,<br>
                                    boxHingeSupportYOffset,<br>
                                    lidHingeZOffset,<br>
                                    lidHingeYOffset,<br>
                                    lidHingeXOffset,<br>
                                    lidHingeTolerance,<br>
                                    lidOverlap,<br>
                                    booleanOverlap){<br>
difference(){<br>
    union(){<br>
        //hingepart is created here<br>
        if (boxRoundCorners){<br>
<br>
            translate([boxLength + lidOverlap/2 + lidTolerance/2 -<br>
(boxCornerRoundness*2) + lidHingeXOffset,<br>
                       boxWidth +lidHingeYOffset -(boxCornerRoundness/2) -<br>
lidOverlap/2 + lidTolerance/2,<br>
                       (lidThickness)+lidHingeZOffset]){<br>
                //remember rotation is counterclockwise<br>
                rotate(a=[0,270,0]){<br>
                      cylinder(d=boxHingeDiameter, boxLength -<br>
(boxCornerRoundness * 2));<br>
                }<br>
            }<br>
        } else {<br>
               translate([lidOverlap/2 + lidTolerance/2 +lidHingeXOffset,<br>
                       (boxWidth + lidHingeYOffset + boxHingeDiameter/2),<br>
                       (lidThickness)+lidHingeZOffset ]){<br>
                //remember rotation is counterclockwise<br>
                    rotate(a=[0,90,0])<br>
                    {<br>
                          cylinder(d=boxHingeDiameter, boxLength);<br>
                    }<br>
                }<br>
        }<br>
        //add geometry to the hinge here<br>
     }<br>
<br>
     //hingehole<br>
     if(boxRoundCorners){<br>
         translate([boxLength + lidOverlap/2 + lidTolerance/2 -<br>
(boxCornerRoundness*2) + lidHingeXOffset,<br>
                           boxWidth +lidHingeYOffset -(boxCornerRoundness/2)<br>
- lidOverlap/2 + lidTolerance/2,<br>
                           (lidThickness)+lidHingeZOffset]){<br>
                    //remember rotation is counterclockwise<br>
                    rotate(a=[0,270,0]){<br>
                          cylinder(d=boxHingePinDiameter, boxLength*2<br>
+booleanOverlap,center=true);<br>
                    }<br>
         }<br>
     }else{<br>
          translate([lidOverlap/2 + lidTolerance/2 +lidHingeXOffset<br>
+booleanOverlap,<br>
                       (boxWidth + lidHingeYOffset + boxHingeDiameter/2),<br>
                       (lidThickness)+lidHingeZOffset ]){<br>
                //remember rotation is counterclockwise<br>
                    rotate(a=[0,90,0]){<br>
                          cylinder(d=boxHingePinDiameter, boxLength*2<br>
+booleanOverlap,center=true);<br>
                    }<br>
         }<br>
     }<br>
<br>
<br>
      //hingeslots<br>
      //here the part to be subtracted from the hinge is created<br>
        if(boxRoundCorners){<br>
                translate([lidOverlap/2 -lidTolerance + lidHingeXOffset,<br>
                               boxWidth +lidHingeYOffset<br>
-(boxCornerRoundness/2) - lidOverlap/2 + lidTolerance/2,<br>
                               (lidThickness)+lidHingeZOffset]){<br>
                    rotate(a=[0,90,0])<br>
                       {<br>
                                            for ( i = [0 :<br>
boxHingeNumberOfSplits/2] )<br>
                                                {<br>
<br>
                                                    translate([0, 0,<br>
boxLength/boxHingeNumberOfSplits * i *2])<br>
<br>
cylinder(d=boxHingeDiameter+boxHingeTolerance+booleanOverlap +<br>
boxHingeClearance,<br>
<br>
(boxLength/boxHingeNumberOfSplits) + boxHingeTolerance + lidHingeTolerance);<br>
                                                }<br>
                       }<br>
<br>
                }<br>
        }else{<br>
                translate([lidOverlap/2 -lidTolerance + lidHingeXOffset,<br>
                                       boxWidth +lidHingeYOffset  +<br>
lidOverlap + lidTolerance,<br>
                                       (lidThickness)+lidHingeZOffset]){<br>
                            rotate(a=[0,90,0])<br>
                               {<br>
                                                    for ( i = [0 :<br>
boxHingeNumberOfSplits/2] )<br>
                                                        {<br>
<br>
                                                            translate([0, 0,<br>
boxLength/boxHingeNumberOfSplits * i *2])<br>
<br>
cylinder(d=boxHingeDiameter+boxHingeTolerance+booleanOverlap +<br>
boxHingeClearance,<br>
<br>
(boxLength/boxHingeNumberOfSplits) + boxHingeTolerance + lidHingeTolerance);<br>
                                                        }<br>
                               }<br>
<br>
                }<br>
        }//end of hinge slots<br>
<br>
     }//end of difference (hinge, hingehole, hingeslots trackPanelSlots)<br>
 }//end of module<br>
module CreateHinge(                 boxRoundCorners,<br>
                                    boxWidth,<br>
                                    boxLength,<br>
                                    boxHeight,<br>
                                    boxHingeDiameter,<br>
                                    boxHingePinDiameter,<br>
                                    boxHingeZOffset,<br>
                                    boxHingeYOffset,<br>
                                    boxHingeTolerance,<br>
                                    boxHingeClearance,<br>
                                    boxHingeNumberOfSplits,<br>
                                    pinTolerance,<br>
                                    boxHingeSupportZOffset,<br>
                                    boxHingeSupportYOffset,<br>
                                    lidHingeZOffset,<br>
                                    lidHingeYOffset,<br>
                                    lidHingeTolerance,<br>
                                    booleanOverlap){<br>
<br>
 //Create Hinge and hinge support<br>
    //difference to create hole in hinge and hinge slots<br>
<br>
    difference(){<br>
       union(){<br>
        //hingepart is created here<br>
        if (boxRoundCorners){<br>
            translate([0,<br>
                       ((boxWidth / 2)+(boxHingeYOffset +<br>
(boxHingeDiameter/2))),<br>
                       (boxHeight/2) ]){<br>
                //remember rotation is counterclockwise<br>
                rotate(a=[0,270,0]){<br>
                      cylinder(d=boxHingeDiameter, boxLength -<br>
(boxCornerRoundness * 2),center=true);<br>
                }<br>
            }<br>
        } else {<br>
               translate([0,<br>
                       ((boxWidth / 2)+(boxHingeYOffset +<br>
(boxHingeDiameter/2))),<br>
                       (boxHeight/2) ]){<br>
                //remember rotation is counterclockwise<br>
                rotate(a=[0,270,0])<br>
                {<br>
                      cylinder(d=boxHingeDiameter, boxLength -<br>
(boxCornerRoundness * 2),center=true);<br>
                }<br>
            }<br>
        }<br>
        //support part is created here, also this part is unioned to the<br>
hingepart<br>
        if(boxRoundCorners){<br>
             difference(){<br>
                 translate([0,((boxWidth /<br>
2)+(boxHingeYOffset+boxHingeSupportYOffset)),((boxHeight/2)+boxHingeZOffset)]){<br>
                     rotate(a=[0,270,0]){<br>
                        rotate(a=[0,0,-25]){<br>
                            cylinder(d=boxHingeDiameter*4,<br>
(boxLength-(boxCornerRoundness * 2)), $fn=4,center=true);<br>
                        }<br>
                     }<br>
                 }<br>
                 translate([0,boxWidth/4,boxHeight-(boxHeight/4) -<br>
booleanOverlap]){<br>
                     //cut for top of hinge support<br>
                     cube([boxLength +booleanOverlap, boxWidth/2,<br>
boxHeight/2], ,center=true);<br>
                 }<br>
                 //cut for removing hinge support from inside box<br>
                 cube([boxLength-(booleanOverlap),<br>
boxWidth-(booleanOverlap), boxHeight- booleanOverlap],center=true);<br>
             }<br>
         }else{<br>
             difference(){<br>
                 translate([0,((boxWidth /<br>
2)+(boxHingeYOffset+boxHingeSupportYOffset)),((boxHeight/2)+boxHingeZOffset)]){<br>
                     rotate(a=[0,270,0]){<br>
                        rotate(a=[0,0,-25]){<br>
                            cylinder(d=boxHingeDiameter*4, (boxLength),<br>
$fn=4,center=true);<br>
                        }<br>
                     }<br>
                 }<br>
                 translate([0,boxWidth/4,boxHeight-(boxHeight/4) -<br>
booleanOverlap]){<br>
                     //cut for top of hinge support<br>
                     cube([boxLength +booleanOverlap, boxWidth/2,<br>
boxHeight/2], ,center=true);<br>
                 }<br>
                 //cut for removing hinge support from inside box<br>
                 cube([boxLength-booleanOverlap, boxWidth-booleanOverlap,<br>
boxHeight-booleanOverlap],center=true);<br>
             }<br>
         }//end of else  end of addition of geomotry<br>
     }<br>
      //hingehole<br>
      translate([0, ((boxWidth / 2) + (boxHingeYOffset+boxHingeDiameter/2)),<br>
((boxHeight/2))]){<br>
                                            rotate(a=[0,-90,0]){<br>
<br>
cylinder(d=boxHingePinDiameter, boxLength + booleanOverlap,center=true);<br>
                                            }<br>
                                        }<br>
       //hingeslots<br>
       //here the part to be subtracted from the hinge is created<br>
        translate([0,<br>
                   ((boxWidth / 2)+(boxHingeYOffset +<br>
(boxHingeDiameter/2))),<br>
                   ((boxHeight/2))]){<br>
            rotate(a=[0,90,0])<br>
               translate([0,0,(-boxLength/2) ]){<br>
                    for ( i = [0 : boxHingeNumberOfSplits/2] ){<br>
<br>
                            translate([0, 0,<br>
boxLength/boxHingeNumberOfSplits * i *2])<br>
<br>
cylinder(d=boxHingeDiameter+boxHingeTolerance+booleanOverlap +<br>
boxHingeClearance,<br>
                                      (boxLength/boxHingeNumberOfSplits) +<br>
boxHingeTolerance,<br>
                                       center=true);<br>
                    }<br>
               }<br>
        } //end of hinge slots<br>
     }//end of difference (hinge, hingehole, hingeslots)<br>
<br>
<br>
<br>
<br>
<br>
<br>
}//end of Hinge Module<br>
<br>
<br>
//**********************END OF<br>
DECLARATIONS***********************************<br>
<br>
if(arched){<br>
    CreateArchedBody(         boxLength,<br>
                             boxWidth,<br>
                             boxHeight,<br>
                             boxBottomThickness,<br>
                             boxWallThickness,<br>
                             boxRoundCorners,<br>
                             boxCornerRoundness,<br>
                             boxCornerSmoothness,<br>
                             boxHingeDiameter,<br>
                             boxHingePinDiameter,<br>
                             boxHingeZOffset,<br>
                             boxHingeYOffset,<br>
                             boxHingeTolerance,<br>
                             boxHingeClearance,<br>
                             boxHingeNumberOfSplits,<br>
                             pinTolerance,<br>
                             controlArmPinDiameter,<br>
                             boxControlArmHoleZOffset,<br>
                             boxControlArmHoleYOffset,<br>
                             controlArmPinTolerance,<br>
                             boxHingeSupportZOffset,<br>
                             boxHingeSupportYOffset,<br>
                             booleanOverlap,<br>
                             boxArcHeight,<br>
                             boxArcRadius<br>
                             );<br>
}else{<br>
   CreateNonArchedBody(          boxLength,<br>
                                 boxWidth,<br>
                                 boxHeight,<br>
                                 boxBottomThickness,<br>
                                 boxWallThickness,<br>
                                 boxRoundCorners,<br>
                                 boxCornerRoundness,<br>
                                 boxCornerSmoothness,<br>
                                 boxHingeDiameter,<br>
                                 boxHingePinDiameter,<br>
                                 boxHingeZOffset,<br>
                                 boxHingeYOffset,<br>
                                 boxHingeTolerance,<br>
                                 boxHingeClearance,<br>
                                 boxHingeNumberOfSplits,<br>
                                 pinTolerance,<br>
                                 controlArmPinDiameter,<br>
                                 boxControlArmHoleZOffset,<br>
                                 boxControlArmHoleYOffset,<br>
                                 controlArmPinTolerance,<br>
                                 boxHingeSupportZOffset,<br>
                                 boxHingeSupportYOffset,<br>
                                 booleanOverlap,<br>
                                 boxArcHeight,<br>
                                 boxArcRadius);<br>
}<br>
<br>
<br>
 if(boxRoundCorners){<br>
     rotate([270,0,0])<br>
      union(){<br>
        translate([-boxLength/2 - lidTolerance/2 - lidOverlap/2 +<br>
boxCornerRoundness,<br>
                   -boxWidth/2  - lidTolerance/2 - lidOverlap/2 +<br>
boxCornerRoundness -52.7,<br>
                   (boxHeight/2)+ booleanOverlap-lidLipHeight+33.5]){<br>
            CreateLidHinge(  boxRoundCorners,<br>
                     boxWidth,<br>
                     boxLength,<br>
                     boxHeight,<br>
                     boxHingeDiameter,<br>
                     boxHingePinDiameter,<br>
                     boxHingeZOffset,<br>
                     boxHingeYOffset,<br>
                     boxHingeTolerance,<br>
                     boxHingeClearance,<br>
                     boxHingeNumberOfSplits,<br>
                     pinTolerance,<br>
                     boxHingeSupportZOffset,<br>
                     boxHingeSupportYOffset,<br>
                     lidHingeZOffset,<br>
                     lidHingeYOffset,<br>
                     lidHingeXOffset,<br>
                     lidHingeTolerance,<br>
                     lidOverlap,<br>
                     booleanOverlap);<br>
<br>
        CreateNonArchedLid( lidLipHeight,<br>
                        lidThickness,<br>
                        lidTolerance,<br>
                        lidHingeZOffset,<br>
                        lidHingeYOffset,<br>
                        lidHingeTolerance,<br>
                        lidOverlap,<br>
                        hingeSlotXOffset,<br>
                        hingeSlotYOffset,<br>
                        hingeSlotZOffset,<br>
                        boxLength,<br>
                        boxWidth,<br>
                        boxHeight,<br>
                        boxRoundCorners,<br>
                        boxCornerRoundness,<br>
                        boxCornerSmoothness,<br>
                        boxHingeDiameter,<br>
                        boxHingePinDiameter,<br>
                        boxHingeNumberOfSplits,<br>
                        dispenserHoleLength,<br>
                        dispenserHoleWidth,<br>
                        dispenserHoleXOffset,<br>
                        dispenserHoleYOffset,<br>
                        rollerLength,<br>
                        trackPanelThickness,<br>
                        booleanOverlap);<br>
                    }//end of Translate<br>
                }//end of union<br>
<br>
 }else{<br>
    translate([-boxLength/2 - lidTolerance/2 - lidOverlap/2,<br>
               -boxWidth/2  - lidTolerance/2 - lidOverlap/2,<br>
               (boxHeight/2)+ booleanOverlap-lidLipHeight]){<br>
<br>
<br>
CreateNonArchedLid( lidLipHeight,<br>
                    lidThickness,<br>
                    lidTolerance,<br>
                    lidHingeZOffset,<br>
                    lidHingeYOffset,<br>
                    lidHingeTolerance,<br>
                    lidOverlap,<br>
                    hingeSlotXOffset,<br>
                    hingeSlotYOffset,<br>
                    hingeSlotZOffset,<br>
                    boxLength,<br>
                    boxWidth,<br>
                    boxHeight,<br>
                    boxRoundCorners,<br>
                    boxCornerRoundness,<br>
                    boxCornerSmoothness,<br>
                    boxHingeDiameter,<br>
                    boxHingePinDiameter,<br>
                    boxHingeNumberOfSplits,<br>
                    dispenserHoleLength,<br>
                    dispenserHoleWidth,<br>
                    dispenserHoleXOffset,<br>
                    dispenserHoleYOffset,<br>
                    rollerLength,<br>
                    trackPanelThickness,<br>
                    booleanOverlap);<br>
               }<br>
     }<br>
<br>
<br>
<br>
translate([-39.25,3,3.5])<br>
    rotate([0,270,0])<br>
        rotate([0,0,44])<br>
        CreateControlArm(                   controlArmLength,<br>
                                            controlArmHeight,<br>
                                            controlArmThickness,<br>
                                            controlArmPinDiameter,<br>
                                            controlArmHoleZOffset,<br>
                                            controlArmHoleYOffset,<br>
                                            controlArmPinTolerance);<br>
translate([44.25,3,3.5])<br>
    rotate([0,270,0])<br>
        rotate([0,0,44])<br>
        CreateControlArm(                   controlArmLength,<br>
                                            controlArmHeight,<br>
                                            controlArmThickness,<br>
                                            controlArmPinDiameter,<br>
                                            controlArmHoleZOffset,<br>
                                            controlArmHoleYOffset,<br>
                                            controlArmPinTolerance);<br>
rotate([0,90,0])<br>
translate([-31,29,-rollerLength/2])<br>
CreateRoller(rollerDiameter,<br>
                                    rollerLength,<br>
                                    rollerPinDiameter);<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://forum.openscad.org/Can-I-get-some-code-review-up-in-here-tp12341.html" target="_blank">http://forum.openscad.org/Can-I-get-some-code-review-up-in-here-tp12341.html</a><br>
Sent from the OpenSCAD mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
OpenSCAD mailing list<br>
<a href="mailto:Discuss@lists.openscad.org">Discuss@lists.openscad.org</a><br>
<a href="http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org" target="_blank">http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><a href="mailto:karsten@rohrbach.de" target="_blank">stempeldergeschichte@googlemail.com</a><br>
<br>
P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:<br>
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.<br>
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.<br>
<br>
P.S. In case my e-mail is shorter than you enjoy:<br>
I am currently trying short replies instead of no replies at all.<br>
Please let me know, if you like to read more.<br><br>Enjoy!<br></div>
</div>