OpenSCAD-Arduino-Mounting-Library icon indicating copy to clipboard operation
OpenSCAD-Arduino-Mounting-Library copied to clipboard

Problems with components under pcb like sdcard in dimension calculation

Open HansH111 opened this issue 10 years ago • 1 comments

I am trying to adapt your library for a different pcb layout

so I created a rpiplusComponent list. The problem with this is that it has an underneath sdcard and in the calculation of the componentsDimensions it effects the overall height. The SDcard space (negative z value) is already compensated by the standoffheight.

if there a simple way to exclude or not to accept negative z values in the componentsDimensions function .

HansH111 avatar Jul 17 '14 18:07 HansH111

solved it by changing the minVec function into

//Return the minimum values between two vectors of either length 2 or 3. 2D Vectors are treated as 3D vectors who final value is 0. function minVec( vector1, vector2 ) = [min(vector1[0], vector2[0]), min(vector1[1], vector2[1]), min((vector1[2] == undef ? 0 : (vector1[2] < 0 ? 0 : vector1[2])), (vector2[2] == undef ? 0 : (vector2[2] < 0 ? 0 : vector2[2])) )];

HansH111 avatar Jul 18 '14 18:07 HansH111