[OpenSCAD] Frustrating unexpected behavior

linkreincarnate linkreincarnate at gmail.com
Mon Apr 6 17:37:33 EDT 2015


So I am trying to make a lid for a hinged box.  I am getting some
unpredictable results with it though.   I need to be able to make a cutout
of the lip of the box at the level where the lid ends and the lip begins and
to place a hinge part there.  But when I change the numbers around to
anything other than a 1:1 ratio on the two numbers that control the
thickness I am unable to predict where the transition from lid to lip
begins.  I have been working on this particular problem since yesterday and
I am being stumped.  What am I missing here?

boxLength = 90.4;
boxWidth = 81.25;
boxHeight = 19.2;
boxBottomThickness = .67;
boxWallThickness = .67;
boxArcHeight = 3.5;
boxArcRadius=1;
boxControlArmHoleZOffset = 3.5;
boxControlArmHoleYOffset = 3;
boxHingePinDiameter = 3;
boxHingeDiameter= 5;
boxHingeZOffset = 0;
boxHingeYOffset = 0;
boxHingeTolerance = .1;
boxHingeSupportZOffset= -5;
boxHingeSupportYOffset = -4.5;
boxHingeNumberOfSplits = 7;
boxHingeClearance=1;
//the following variables determine the details of the cylinder (or sphere)
used for minkowski sums
boxCornerRoundness = 7;
boxCornerSmoothness = 16;
boxRoundCorners = true;

controlArmLength = 0;
controlArmHeight = 0;
conrolArmThickness = 0;
controlArmPinDiameter = 2;
controlArmHoleZOffset = 0;
controlArmHoleYOffset = 0;
controlArmPinTolerance = .1;

lidLipHeight = 2;
lidThickness = 2;
lidTolerance = 1;
lidHingeZOffset = 0;
lidHingeYOffset = 0;
lidHingeTolerance = 1;
lidOverlap = 2;

dispenserHoleLength = 72; //also used for dist between tracks
dispenserHoleWidth = 11.5;
dispenserHoleXOffset = 0;
dispenserHoleYOffset = 0;

trackPanelLength = 76;
trackPanelHeight = 19;
trackPanelThickness = 3;
trackWidth = 2.5;
trackLength = 61;
trackHeight = 14;

rollerDiameter = 7;
rollerLength = 71;

rollerPinDiameter = 2;
hingePinDiameter = 1.6;
pinLength= 71;

pinTolerance = 1;
cigaretteDiameter = 7.75;
cigaretteLength = 70;

booleanOverlap = .01; //to ensure that the faces used to difference() dont
line up

lowRollingClearance = 5; //the distance from the center of the rolling pin
to the lid at the lowest point.
hightRollingClearance = 12.6;

arched = false;
//uses math to determine the arc radius of the curve of the box and creates
the appropriate cylinder


difference(){     
                    $fn=boxCornerSmoothness;
                    minkowski(){
                     cube([lidOverlap + boxLength + lidTolerance - (2 *
boxCornerRoundness),
                           lidOverlap + boxWidth + lidTolerance - (2 *
boxCornerRoundness),
                           ((lidThickness + lidLipHeight)/2)], center=true);
                     cylinder(r=boxCornerRoundness,
                                 h=((lidThickness + lidLipHeight)/2),
center=true);
                    }
                    
                    translate([0,0,-lidThickness/2 ])
                    {
                        $fn=boxCornerSmoothness;
                        minkowski()
                        {
                         cube([boxLength + lidTolerance - (2 *
boxCornerRoundness) ,
                               boxWidth + lidTolerance - (2 *
boxCornerRoundness),
                               lidLipHeight+booleanOverlap],center = true); 
                         cylinder(r=boxCornerRoundness,h=lidLipHeight/2,
center = true);
                        }
                    }
                    translate([0,(boxCornerRoundness + lidTolerance +
lidOverlap+booleanOverlap),-lidThickness/2])
                    cube([boxLength + lidTolerance - (2 *
boxCornerRoundness) ,
                               boxWidth + lidTolerance - (2 *
boxCornerRoundness),
                               lidLipHeight +booleanOverlap],center = true); 
}



--
View this message in context: http://forum.openscad.org/Frustrating-unexpected-behavior-tp12321.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list