[OpenSCAD] Difference in a Function Definition

linkreincarnate linkreincarnate at gmail.com
Fri Apr 3 02:46:34 EDT 2015


So I created a function that creates a hollow cube by differencing two
cubes.  For some reason though it wont compile.  I keep getting a syntax
error on the first bracket  after the difference function is called.  If I
comment out the difference function it works fine.  What am I missing here? 
You can use the difference function in a  user defined function right? If
not how can I create a function to create an object?


function CreateNonArchedBody(boxLength, 
                             boxWidth, 
                             boxHeight, 
                             boxDepth, 
                             boxWallThickness, 
                             boxHingeDiameter, 
                             boxHingePinDiameter,  
                             boxHingeXOffset, 
                             boxHingeYOffset, 
                             boxHingeTolerance, 
                             pinTolerance, 
                             controlArmPinDiameter,                        
                             controlArmHoleXOffset,                         
                             controlArmHoleYOffset) = 
    
        difference() {
            cube([boxLength,boxWidth,boxHeight], 
                 center = true
                );
            translate([0,0,((boxHeight-boxDepth)/2)]) 
                cube([boxLength - boxWallThickness, 
                      boxWidth - boxWallThickness, 
                      boxDepth], 
                      center = true
                );
        }



--
View this message in context: http://forum.openscad.org/Difference-in-a-Function-Definition-tp12303.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list