final
This commit is contained in:
385
case/YAPP_Box/examples/ESP32-CAM-USB-FISH_v30.scad
Normal file
385
case/YAPP_Box/examples/ESP32-CAM-USB-FISH_v30.scad
Normal file
@@ -0,0 +1,385 @@
|
||||
//---------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for ESP32-CAM
|
||||
//
|
||||
// Version 1.1 (12-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-as --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
| | v
|
||||
| -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
|
||||
// Edit these parameters for your own board dimensions
|
||||
wallThickness = 1.4;
|
||||
basePlaneThickness = 1.8;
|
||||
lidPlaneThickness = 1.8;
|
||||
|
||||
baseWallHeight = 15;
|
||||
lidWallHeight = 6;
|
||||
|
||||
// Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
// + baseWallHeight + lidWallHeight
|
||||
pcbLength = 40;
|
||||
pcbWidth = 27.5;
|
||||
pcbThickness = 13.5;
|
||||
|
||||
// padding between pcb and inside wall
|
||||
paddingFront = 0.3;
|
||||
paddingBack = 0.3;
|
||||
paddingRight = 0.3;
|
||||
paddingLeft = 0.3;
|
||||
|
||||
// ridge where base and lid off box can overlap
|
||||
// Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3;
|
||||
ridgeSlack = 0.2;
|
||||
|
||||
roundRadius = 2.0;
|
||||
|
||||
// How much the PCB needs to be raised from the base
|
||||
// to leave room for solderings and whatnot
|
||||
standoffHeight = 11.0;
|
||||
standoffPinDiameter = 0.5;
|
||||
standoffHoleSlack = 0.1;
|
||||
standoffDiameter = 3.5;
|
||||
|
||||
|
||||
// Set the layer height of your printer
|
||||
printerLayerHeight = 0.2;
|
||||
|
||||
|
||||
//-- C O N T R O L ---------------//-> Default -----------------------------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 6; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 3;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showMarkersBoxOutside = false;
|
||||
showMarkersBoxInside = false;
|
||||
showMarkersPCB = false;
|
||||
showMarkersCenter = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L -----------------------------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// Optional:
|
||||
// p(2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// p(4) = standoffDiameter Default = standoffDiameter;
|
||||
// p(5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// p(6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// p(7) = filletRadius (0 = auto size)
|
||||
// n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// n(b) = { <yappPin>, yappHole } // Baseplate support treatment
|
||||
// n(c) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[1, 1, 2, undef, yappBoth, yappHole, yappNoFillet]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsLid =
|
||||
[
|
||||
[9, ((pcbWidth/2)+0.5), 0, 0, 6.5, yappCircle, yappCenter] // lens
|
||||
,[30, pcbWidth-3, 6, 6, 1, yappRoundedRect, yappCenter] // flash LED
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBase =
|
||||
[
|
||||
[(pcbLength/2), (pcbWidth/2), 35, 20, 0, yappPolygon, shapeHexagon, [maskBars, 0, 0, 90], yappCenter]
|
||||
];
|
||||
|
||||
//-- front plane -- origin is pcb[0,0,0]
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsFront =
|
||||
[
|
||||
[13, -19, 12, 8, 0, yappRectangle, yappCenter] // USB
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBack =
|
||||
[
|
||||
[13, -9, 15, 6, 0, yappRectangle, yappCenter] // SD card
|
||||
];
|
||||
|
||||
//-- left plane -- origin is pcb[0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posz
|
||||
cutoutsLeft =
|
||||
[
|
||||
[pcbLength-6, -20, 6.5, 4, 0, yappRectangle, yappCenter] // button
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsRight =
|
||||
[
|
||||
[pcbLength-6, -20, 6.5, 4, 0, yappRectangle, yappCenter] // button
|
||||
];
|
||||
|
||||
///-- connectors
|
||||
//-- normal : origen = box[0,0,0]
|
||||
//-- yappConnWithPCB: origen = pcb[0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (1) = pcbStandHeight
|
||||
// (3) = screwDiameter
|
||||
// (4) = screwHeadDiameter
|
||||
// (5) = insertDiameter
|
||||
// (6) = outsideDiameter
|
||||
// (7) = flangeHeight
|
||||
// (8) = flangeDiam
|
||||
// (9) = { yappConnWithPCB }
|
||||
// (10) = { yappAllCorners | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
connectors =
|
||||
[
|
||||
];
|
||||
|
||||
//-- base mounts -- origen = box[x0,y0]
|
||||
// (0) = posx | posy
|
||||
// (1) = screwDiameter
|
||||
// (2) = width
|
||||
// (3) = height
|
||||
// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// (5) = { yappCenter }
|
||||
boxMounts =
|
||||
[
|
||||
];
|
||||
|
||||
//-- snap Joins -- origen = box[x0,y0]
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// (n) = { yappSymmetric }
|
||||
snapJoins =
|
||||
[
|
||||
[2, 5, yappLeft, yappRight]
|
||||
,[(shellWidth/2)-2.5, 5, yappFront]
|
||||
];
|
||||
|
||||
//-- origin of labels is box [0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posy/z
|
||||
// (2) = orientation
|
||||
// (3) = plane {lid | base | left | right | front | back }
|
||||
// (4) = font
|
||||
// (5) = size
|
||||
// (6) = "label text"
|
||||
labelsPlane =
|
||||
[
|
||||
];
|
||||
|
||||
module hookBaseOutside()
|
||||
{
|
||||
translate([(shellLength/2)-7.5,(shellWidth-wallThickness)-3,1])
|
||||
{
|
||||
difference()
|
||||
{
|
||||
union()
|
||||
{
|
||||
cube([15,10,10]);
|
||||
translate([0,10,5])
|
||||
rotate([0,90,0])
|
||||
cylinder(d=10, h=15);
|
||||
}
|
||||
translate([-1,10,5])
|
||||
{
|
||||
rotate([0,90,0])
|
||||
color("red") cylinder(d=4.5, h=17);
|
||||
}
|
||||
translate([4.8,0,-0.5])
|
||||
cube([5.4,16,11]);
|
||||
}
|
||||
|
||||
} // translate
|
||||
|
||||
} // hookBaseOutside()
|
||||
|
||||
module hookLidInside()
|
||||
{
|
||||
translate([9, ((pcbWidth/2)+0.5), 0])
|
||||
{
|
||||
difference()
|
||||
{
|
||||
cylinder(h=4, r=8, center=true);
|
||||
cylinder(h=5, r=6.5, center=true);
|
||||
}
|
||||
}
|
||||
translate([30, pcbWidth-3, -1])
|
||||
{
|
||||
difference()
|
||||
{
|
||||
cube([8, 8, 7], center=true);
|
||||
cube([6, 6, 8], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
} // lidHook()
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
371
case/YAPP_Box/examples/ESP32-CAM-USB_v30.scad
Normal file
371
case/YAPP_Box/examples/ESP32-CAM-USB_v30.scad
Normal file
@@ -0,0 +1,371 @@
|
||||
//---------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for ESP32-CAM
|
||||
//
|
||||
// Version 1.1 (12-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-as --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
| | v
|
||||
| -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
|
||||
// Edit these parameters for your own board dimensions
|
||||
wallThickness = 1.4;
|
||||
basePlaneThickness = 1.8;
|
||||
lidPlaneThickness = 1.8;
|
||||
|
||||
baseWallHeight = 15;
|
||||
lidWallHeight = 6;
|
||||
|
||||
// Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
// + baseWallHeight + lidWallHeight
|
||||
pcbLength = 40;
|
||||
pcbWidth = 27.5;
|
||||
pcbThickness = 13.5;
|
||||
|
||||
// padding between pcb and inside wall
|
||||
paddingFront = 0.3;
|
||||
paddingBack = 0.3;
|
||||
paddingRight = 0.3;
|
||||
paddingLeft = 0.3;
|
||||
|
||||
// ridge where base and lid off box can overlap
|
||||
// Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3;
|
||||
ridgeSlack = 0.2;
|
||||
|
||||
roundRadius = 2.0;
|
||||
|
||||
// How much the PCB needs to be raised from the base
|
||||
// to leave room for solderings and whatnot
|
||||
standoffHeight = 11.0;
|
||||
standoffPinDiameter = 0.5;
|
||||
standoffHoleSlack = 0.1;
|
||||
standoffDiameter = 3.5;
|
||||
|
||||
|
||||
// Set the layer height of your printer
|
||||
printerLayerHeight = 0.2;
|
||||
|
||||
|
||||
//-- C O N T R O L ---------------//-> Default -----------------------------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 6; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 3;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showMarkersBoxOutside = false;
|
||||
showMarkersBoxInside = false;
|
||||
showMarkersPCB = false;
|
||||
showMarkersCenter = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L -----------------------------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// Optional:
|
||||
// p(2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// p(4) = standoffDiameter Default = standoffDiameter;
|
||||
// p(5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// p(6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// p(7) = filletRadius (0 = auto size)
|
||||
// n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// n(b) = { <yappPin>, yappHole } // Baseplate support treatment
|
||||
// n(c) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[1, 1, 2, undef, yappBoth, yappHole, yappNoFillet]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsLid =
|
||||
[
|
||||
[8, ((pcbWidth/2)+0.5), 0, 0, 4.5, yappCircle, yappCenter] // lens
|
||||
,[9, ((pcbWidth/2)+0.5), 0, 0, 4.5, yappCircle, yappCenter] // lens
|
||||
,[10, ((pcbWidth/2)+0.5), 0, 0, 4.5, yappCircle, yappCenter] // lens
|
||||
,[30, pcbWidth-3, 6, 6, 1, yappRoundedRect, yappCenter] // flash LED
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBase =
|
||||
[
|
||||
[(pcbLength/2), (pcbWidth/2), 35, 20, 0, yappPolygon, shapeHexagon, [maskBars, 0, 0, 90], yappCenter]
|
||||
];
|
||||
|
||||
//-- front plane -- origin is pcb[0,0,0]
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsFront =
|
||||
[
|
||||
[13, -19, 12, 8, 0, yappRectangle, yappCenter] // USB
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBack =
|
||||
[
|
||||
[13, -9, 15, 6, 0, yappRectangle, yappCenter] // SD card
|
||||
];
|
||||
|
||||
//-- left plane -- origin is pcb[0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posz
|
||||
cutoutsLeft =
|
||||
[
|
||||
[pcbLength-6, -20, 6.5, 4, 0, yappRectangle, yappCenter] // button
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsRight =
|
||||
[
|
||||
[pcbLength-6, -20, 6.5, 4, 0, yappRectangle, yappCenter] // button
|
||||
];
|
||||
|
||||
///-- connectors
|
||||
//-- normal : origen = box[0,0,0]
|
||||
//-- yappConnWithPCB: origen = pcb[0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (1) = pcbStandHeight
|
||||
// (3) = screwDiameter
|
||||
// (4) = screwHeadDiameter
|
||||
// (5) = insertDiameter
|
||||
// (6) = outsideDiameter
|
||||
// (7) = flangeHeight
|
||||
// (8) = flangeDiam
|
||||
// (9) = { yappConnWithPCB }
|
||||
// (10) = { yappAllCorners | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
connectors =
|
||||
[
|
||||
];
|
||||
|
||||
//-- base mounts -- origen = box[x0,y0]
|
||||
// (0) = posx | posy
|
||||
// (1) = screwDiameter
|
||||
// (2) = width
|
||||
// (3) = height
|
||||
// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// (5) = { yappCenter }
|
||||
boxMounts =
|
||||
[
|
||||
];
|
||||
|
||||
//-- snap Joins -- origen = box[x0,y0]
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (2..5) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// (n) = { yappSymmetric }
|
||||
snapJoins =
|
||||
[
|
||||
[2, 5, yappLeft, yappRight]
|
||||
,[(shellWidth/2)-2.5, 5, yappFront]
|
||||
];
|
||||
|
||||
//-- origin of labels is box [0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posy/z
|
||||
// (2) = orientation
|
||||
// (3) = plane {lid | base | left | right | front | back }
|
||||
// (4) = font
|
||||
// (5) = size
|
||||
// (6) = "label text"
|
||||
labelsPlane =
|
||||
[
|
||||
];
|
||||
|
||||
module hookBaseOutside()
|
||||
{
|
||||
translate([(shellLength/2)-7.5,(shellWidth-wallThickness)-3,1])
|
||||
{
|
||||
difference()
|
||||
{
|
||||
union()
|
||||
{
|
||||
cube([15,10,10]);
|
||||
translate([0,10,5])
|
||||
rotate([0,90,0])
|
||||
cylinder(d=10, h=15);
|
||||
}
|
||||
translate([-1,10,5])
|
||||
{
|
||||
rotate([0,90,0])
|
||||
color("red") cylinder(d=4.5, h=17);
|
||||
}
|
||||
translate([4.8,0,-0.5])
|
||||
cube([5.4,16,11]);
|
||||
}
|
||||
|
||||
} // translate
|
||||
|
||||
} // hookBaseOutside()
|
||||
|
||||
module lidHook()
|
||||
{
|
||||
|
||||
} // lidHook()
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
479
case/YAPP_Box/examples/GateAlarm_Sample_v30.scad
Normal file
479
case/YAPP_Box/examples/GateAlarm_Sample_v30.scad
Normal file
@@ -0,0 +1,479 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// for many or complex cutouts you might need to adjust
|
||||
// the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
// Electro cookie 30 row
|
||||
pcbLength = 88.9; // Front to back
|
||||
pcbWidth = 52.1; // Side to side
|
||||
pcbThickness = 1.7;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 3;
|
||||
paddingBack = 3;
|
||||
paddingRight = 3;
|
||||
paddingLeft = 3;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 12;
|
||||
lidWallHeight = 11;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.3;
|
||||
roundRadius = 3.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 1.7;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 4.0;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 12; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 10;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;//0.25;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;//0.25;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from back)
|
||||
inspectY = 0; //-> 0=none (>0 from right)
|
||||
inspectXfromBack = false; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; // View from the inspection cut to the right
|
||||
inspectZfromTop = true;
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
pcbStands = [
|
||||
// Electro cookie 30 row
|
||||
[5.1, 8.25]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (2) = pcbStandHeight
|
||||
// (3) = screwDiameter
|
||||
// (4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// (5) = insertDiameter
|
||||
// (6) = outsideDiameter
|
||||
// Optional:
|
||||
// (7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (8) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { <yappCoordBox>, yappCoordPCB }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
connectors =
|
||||
[
|
||||
// [9, 15, 10, 2.5, 6 + 1.25, 4.0, 9, 0, yappFrontRight]
|
||||
// ,[9, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]
|
||||
// ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontRight]
|
||||
// ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Base Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = pos
|
||||
// (1) = screwDiameter
|
||||
// (2) = width
|
||||
// (3) = height
|
||||
// Optional:
|
||||
// (4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
baseMounts =
|
||||
[
|
||||
// [shellWidth/2, 3, 10, 3, yappFront, yappBack]//, yappCenter]
|
||||
// [[10,10], 3, 0, 3, yappFront, yappBack]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { [yappMaskDef, hOffset, vOffset, rotations] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. THis can be used to fine tune the mask placement in the opening.
|
||||
// (n) = { yappCoordBox | <yappCoordPCB> }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
// Vent
|
||||
// [shellLength/2,shellWidth/2 ,55,55, 5, yappPolygon, shapeHexagon, [maskBars,1,1.5], yappCenter]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
// Cutout for piezo buzzer
|
||||
[25,shellWidth/2 ,0,0, 29.8/2, yappCircle ,yappCenter, yappCoordBox]
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// Cutout for USB
|
||||
[pcbWidth/2, -5 -pcbThickness ,12.5,7.0, 2, yappRoundedRect , yappCenter]
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
//Cutout for cable
|
||||
// [35,6 ,0,0, 3.25, yappCircle,yappCenter]
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[35+3.25,6, 0, 0, 3.25, yappCircle, yappCenter, yappCoordBox]
|
||||
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappSymmetric }
|
||||
// (n) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
snapJoins =
|
||||
[
|
||||
[(shellWidth/2), 10, yappFront,yappBack, yappCenter]
|
||||
//,[25, 10, yappBack, yappBack, yappSymmetric, yappCenter]
|
||||
,[(shellLength/2), 10, yappLeft, yappRight, yappCenter]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Light Tubes ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (2) = tubeLength
|
||||
// (3) = tubeWidth
|
||||
// (4) = tubeWall
|
||||
// (5) = gapAbovePcb
|
||||
// (6) = tubeType {yappCircle|yappRectangle}
|
||||
// Optional:
|
||||
// (7) = lensThickness (how much to leave on the top of the lid for the light to shine through 0 for open hole : Default = 0/Open
|
||||
// (8) = Height to top of PCB : Default = standoffHeight+pcbThickness
|
||||
// (9) = filletRadius : Default = 0/Auto
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
lightTubes =
|
||||
[
|
||||
|
||||
[pcbLength-(8.820),(pcbWidth/2)-3.810, // Pos
|
||||
6, 6, // W,L
|
||||
1.0, // wall thickness
|
||||
2, // Gap above PCB
|
||||
yappCircle, // tubeType (Shape)
|
||||
undef,undef,1
|
||||
]
|
||||
,[pcbLength-(8.820+(2.54*3)),(pcbWidth/2)-1.27 - (2.54*1), // Pos
|
||||
6, 6, // W,L
|
||||
1.0, // wall thickness
|
||||
2, // Gap above PCB
|
||||
yappCircle, // tubeType (Shape)
|
||||
undef,undef,1
|
||||
]
|
||||
,[pcbLength-(8.820+(2.54*6)),(pcbWidth/2)-3.810, // Pos
|
||||
6, 6, // W,L
|
||||
1.0, // wall thickness
|
||||
2, // Gap above PCB
|
||||
yappCircle, // tubeType (Shape)
|
||||
undef,undef,1
|
||||
]
|
||||
,[pcbLength-(8.820+(2.54*9)),(pcbWidth/2)-3.810, // Pos
|
||||
6, 6, // W,L
|
||||
1.0, // wall thickness
|
||||
2, // Gap above PCB
|
||||
yappCircle, // tubeType (Shape)
|
||||
undef,undef,1
|
||||
]
|
||||
,[pcbLength-(8.820),(pcbWidth/2)+3.810, // Pos
|
||||
6, 6, // W,L
|
||||
1.0, // wall thickness
|
||||
2, // Gap above PCB
|
||||
yappCircle, // tubeType (Shape)
|
||||
undef,undef,1
|
||||
]
|
||||
,[pcbLength-(8.820+(2.54*3)),(pcbWidth/2)+3.810, // Pos
|
||||
6, 6, // W,L
|
||||
1.0, // wall thickness
|
||||
2, // Gap above PCB
|
||||
yappCircle, // tubeType (Shape)
|
||||
undef,undef,1
|
||||
]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (2) = capLength for yappRectangle, capDiameter for yappCircle
|
||||
// (3) = capWidth for yappRectangle, not used for yappCircle
|
||||
// (4) = capAboveLid
|
||||
// (5) = switchHeight
|
||||
// (6) = switchTravel
|
||||
// (7) = poleDiameter
|
||||
// Optional:
|
||||
// (8) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// (9) = buttonType {yappCircle|<yappRectangle>} : Default = yappRectangle
|
||||
// (10) = filletRadius : Default = 0/Auto
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
pushButtons =
|
||||
[
|
||||
[pcbLength-(8.820+(2.54*8.5)),(pcbWidth/2)+3.810+(2.54*2),
|
||||
8, // cap Diameter
|
||||
0, // Unused
|
||||
1, // Cap above Lid
|
||||
3, // Switch Height
|
||||
1, // Switch travel
|
||||
3.5, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappCircle, // Shape
|
||||
0
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = pos
|
||||
// (1) = width
|
||||
// (2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB
|
||||
// yappCoordBox = Above (positive) the bottom of the shell (outside)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// Note: use ridgeExtTop to reference the top of the extension for cutouts.
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtFront =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
ridgeExtLeft =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[35, 6.5, 6, yappCoordBox]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// (0) = posx
|
||||
// (1) = posy/z
|
||||
// (2) = rotation degrees CCW
|
||||
// (3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}
|
||||
// (5) = font
|
||||
// (6) = size
|
||||
// (7) = "label text"
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
labelsPlane =
|
||||
[
|
||||
[5, 18, -90, 1, yappLid, "Liberation Mono:style=bold", 6, "DMR" ]
|
||||
|
||||
,[83.5, 22, -90, 1, yappLid, "Liberation Mono:style=bold", 4, "Front" ]
|
||||
,[83.5-(2.54*3), 22, -90, 1, yappLid, "Liberation Mono:style=bold", 4, "Drive" ]
|
||||
,[83.5-(2.54*6), 22, -90, 1, yappLid, "Liberation Mono:style=bold", 4, "Rear" ]
|
||||
,[83.5-(2.54*9), 22, -90, 1, yappLid, "Liberation Mono:style=bold", 4, "Pool" ]
|
||||
,[83.5, 57, -90, 1, yappLid, "Liberation Mono:style=bold", 4, "Alarm" ]
|
||||
,[83.5-(2.54*3), 57, -90, 1, yappLid, "Liberation Mono:style=bold", 4, "Muted" ]
|
||||
,[83.5-(2.54*12), 47, -90, 1, yappLid, "Liberation Mono:style=bold", 4, "Mute" ]
|
||||
];
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
60202
case/YAPP_Box/examples/Multiple_PCB_v30.dxf
Normal file
60202
case/YAPP_Box/examples/Multiple_PCB_v30.dxf
Normal file
File diff suppressed because it is too large
Load Diff
626
case/YAPP_Box/examples/Multiple_PCB_v30.scad
Normal file
626
case/YAPP_Box/examples/Multiple_PCB_v30.scad
Normal file
@@ -0,0 +1,626 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0.1 (2024-01-15)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// For many/complex cutoutGrills, you might need to adjust
|
||||
// the max number of elements in OpenSCAD:
|
||||
//
|
||||
// Preferences->Advanced->Turn off rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte refers to Y axis,
|
||||
// height/hoogte refers to Z axis
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = false;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// The Following will be used as the first element in the pbc array
|
||||
pcbLength = 52; // Front to back
|
||||
pcbWidth = 27; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
standoffHeight = 3.0; //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot
|
||||
standoffDiameter = 4;
|
||||
standoffPinDiameter = 2.2;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
relayLength = 50.0;
|
||||
relayWidth = 26.15;
|
||||
|
||||
displayPCBLength = 31.15;
|
||||
displayPCBWidth = 80.0;
|
||||
//===================================================================
|
||||
// *** PCBs ***
|
||||
// Printed Circuit Boards
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : yappCoordBoxInside[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = name
|
||||
// p(1) = length
|
||||
// p(2) = width
|
||||
// p(3) = posx
|
||||
// p(4) = posy
|
||||
// p(5) = Thickness
|
||||
// p(6) = standoffHeight
|
||||
// p(7) = standoffDiameter
|
||||
// p(8) = standoffPinDiameter
|
||||
// p(9) = standoffHoleSlack (default to 0.4)
|
||||
// Optional:
|
||||
|
||||
//The following can be used to get PCB values elsewhere in the script - not in pcb definition.
|
||||
//If "PCB Name" is omitted then "Main" is used
|
||||
// pcbLength --> pcbLength("PCB Name")
|
||||
// pcbWidth --> pcbWidth("PCB Name")
|
||||
// pcbThickness --> pcbThickness("PCB Name")
|
||||
// standoffHeight --> standoffHeight("PCB Name")
|
||||
// standoffDiameter --> standoffDiameter("PCB Name")
|
||||
// standoffPinDiameter --> standoffPinDiameter("PCB Name")
|
||||
// standoffHoleSlack --> standoffHoleSlack("PCB Name")
|
||||
|
||||
|
||||
pcb =
|
||||
[
|
||||
["Main", pcbLength, pcbWidth, 0, 0, pcbThickness, standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack],
|
||||
["Relay", 50, 26, pcbLength + 4, 0, pcbThickness, standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack],
|
||||
["Display", 80, 36, 0, pcbWidth + 4, pcbThickness, standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]
|
||||
];
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 2;
|
||||
paddingBack = 2;
|
||||
paddingRight = 2;
|
||||
paddingLeft = 2;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 6;
|
||||
lidWallHeight = 20;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 3.0;
|
||||
|
||||
|
||||
// Set the layer height of your printer
|
||||
printerLayerHeight = 0.2;
|
||||
|
||||
|
||||
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
// -- Render --
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
|
||||
// --Preview --
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
showSideBySide = true; //-> Default = true
|
||||
onLidGap = 0; // tip don't override to animate the lid opening
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> Remove the walls from the lid : only if preview and showSideBySide=true
|
||||
hideBaseWalls = false; //-> Remove the walls from the base : only if preview and showSideBySide=true
|
||||
showOrientation = true; //-> Show the Front/Back/Left/Right labels : only in preview
|
||||
showPCB = true; //-> Show the PCB in red : only in preview
|
||||
showSwitches = true; //-> Show the switches (for pushbuttons) : only in preview
|
||||
showButtonsDepressed = false; //-> Should the buttons in the Lid On view be in the pressed position
|
||||
showOriginCoordBox = false; //-> Shows red bars representing the origin for yappCoordBox : only in preview
|
||||
showOriginCoordBoxInside = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showOriginCoordPCB = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showMarkersPCB = false; //-> Shows black bars corners of the PCB : only in preview
|
||||
showMarkersCenter = false; //-> Shows magenta bars along the centers of all faces
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromBottom = true; //-> View from the inspection cut up
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
// Start of Debugging config (used if not overridden in template)
|
||||
// ------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
//==================================================================
|
||||
// *** Shapes ***
|
||||
//------------------------------------------------------------------
|
||||
// There are a view pre defines shapes and masks
|
||||
// shapes:
|
||||
// shapeIsoTriangle, shapeHexagon, shape6ptStar
|
||||
//
|
||||
// masks:
|
||||
// maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars
|
||||
//
|
||||
//------------------------------------------------------------------
|
||||
// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will
|
||||
// be scaled as needed.
|
||||
// defined as a vector of [x,y] vertices pairs.(min 3 vertices)
|
||||
// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];
|
||||
// To see how to add your own shapes and mask see the YAPPgenerator program
|
||||
//------------------------------------------------------------------
|
||||
|
||||
|
||||
// Show sample of a Mask
|
||||
//SampleMask(maskHoneycomb);
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// Optional:
|
||||
// p(2) = Height to bottom of PCB : Default = standoff_Height
|
||||
// p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcb_Thickness, yappCoordBox=0
|
||||
// p(4) = standoff_Diameter Default = standoff_Diameter;
|
||||
// p(5) = standoff_PinDiameter Default = standoff_PinDiameter;
|
||||
// p(6) = standoff_HoleSlack Default = standoff_HoleSlack;
|
||||
// p(7) = filletRadius (0 = auto size)
|
||||
// n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// n(b) = { <yappPin>, yappHole } // Baseplate support treatment
|
||||
// n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { yappNoFillet }
|
||||
// n(f) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
//- Add stands 5mm from each corner of the PCB
|
||||
[2, 2, 19, yappAllCorners],
|
||||
|
||||
//- Add posts 25mm from the corners of the box, with a custon height,diameter, Pin Size, hole
|
||||
//- slack and filler radius.
|
||||
// [25, 25, 10, 10, 3.3, 0.9, 5, yappCoordBox]
|
||||
// [5,5, yappAllCorners]
|
||||
,[pcbLength + 7, 3, 18, 2.4, 5, default, default, 1]
|
||||
,[pcbLength + 7, 23, 18, 2.4, 5, default, default, 1]
|
||||
,[pcbLength + 50 + 1, 3, 18, 2.4, 5, default, default, 1]
|
||||
,[pcbLength + 50 + 1, 23, 18, 2.4, 5, default, default, 1]
|
||||
|
||||
,[4, pcbWidth + 7, 19, 2.4, 4, default, default, 1]
|
||||
,[4, pcbWidth + 38, 19, 2.4, 4, default, default, 1]
|
||||
,[79, pcbWidth + 7, 19, 2.4, 4, default, default, 1]
|
||||
,[79, pcbWidth + 38, 19, 2.4, 4, default, default, 1]
|
||||
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = pcbStandHeight
|
||||
// p(3) = screwDiameter
|
||||
// p(4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// p(5) = insertDiameter
|
||||
// p(6) = outsideDiameter
|
||||
// Optional:
|
||||
// p(7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// p(8) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = [yappPCBName, "XXX"] : {XXX = the PCB name: Default "Main"}
|
||||
//-------------------------------------------------------------------
|
||||
connectors =
|
||||
[
|
||||
// [9, 15, standoffHeight("PCB3"), 2.5, 6 + 1.25, 4.0, 9, yappAllCorners, [yappPCBName, "PCB3"]]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
// n(g) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBase =
|
||||
[
|
||||
[pcbLength()/2,shellWidth/2 ,55,55, 5, yappPolygon ,0 ,0, yappCenter, shapeHexagon, [maskHoneycomb,0,1.5,0], ]
|
||||
, [pcbLength()*2-5, 35 ,12.5,7.0, 2, yappCircle , yappCenter]
|
||||
, [pcbLength()*2-5-65, 35 ,12.5,7.0, 4, yappCircle , yappCenter]
|
||||
// , [0, 0, 10, 10, 0, yappRectangle, maskHexCircles, [yappPCBName, "PCB3"]]
|
||||
// , [shellLength*2/3,shellWidth/2 ,0, 30, 20, yappCircleWithFlats, yappCenter]
|
||||
// , [shellLength/2,shellWidth/2 ,10, 5, 20, yappCircleWithKey,yappCenter]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
[5.5,38,72,25,0,yappRectangle]
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
[pcbWidth()/2 - 0.75, 15 - pcbThickness() ,16,10.0, 2, yappRoundedRect , yappCenter]
|
||||
|
||||
];
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// Cutout for USB
|
||||
[pcbWidth()/2, 16 -pcbThickness() ,12.5,7.0, 2, yappRoundedRect , yappCenter]
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
//[pcbLength()+2, 16 ,12.5,7.0, 4, yappCircle , yappCenter]
|
||||
// Cutout for AC 1
|
||||
//[pcbLength("Voltage Detect 1")/2, pcbThickness("Voltage Detect 1") + 3 ,11,7.0, 2, yappRoundedRect , yappCenter, [yappPCBName, "Voltage Detect 1"]]
|
||||
// Cutout for AC 2
|
||||
//,[pcbLength("Voltage Detect 2")/2, pcbThickness("Voltage Detect 2") + 3 ,11,7.0, 2, yappRoundedRect , yappCenter, [yappPCBName, "Voltage Detect 2"]]
|
||||
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
//[pcbLength()/2, pcbThickness() + 3 ,12.5,7.0, 2, yappRoundedRect , yappCenter]
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx | posy
|
||||
// p(1) = width
|
||||
// p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// Optional:
|
||||
// n(a) = { <yappOrigin>, yappCenter }
|
||||
// n(b) = { yappSymmetric }
|
||||
// n(c) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[15, 10, yappFront, yappCenter, yappSymmetric]
|
||||
,[15, 10, yappBack, yappCenter, yappSymmetric]
|
||||
,[30, 10, yappRight, yappCenter, yappSymmetric]
|
||||
,[45, 10, yappLeft, yappCenter, yappSymmetric]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.
|
||||
// Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter
|
||||
// (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of
|
||||
// the left of the opening
|
||||
// n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Light Tubes ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = tubeLength
|
||||
// p(3) = tubeWidth
|
||||
// p(4) = tubeWall
|
||||
// p(5) = gapAbovePcb
|
||||
// p(6) = { yappCircle | yappRectangle } : tubeType
|
||||
// Optional:
|
||||
// p(7) = lensThickness (how much to leave on the top of the lid for the
|
||||
// light to shine through 0 for open hole : Default = 0/Open
|
||||
// p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness
|
||||
// p(9) = filletRadius : Default = 0/Auto
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
lightTubes =
|
||||
[
|
||||
|
||||
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = capLength
|
||||
// p(3) = capWidth
|
||||
// p(4) = capRadius
|
||||
// p(5) = capAboveLid
|
||||
// p(6) = switchHeight
|
||||
// p(7) = switchTravel
|
||||
// p(8) = poleDiameter
|
||||
// Optional:
|
||||
// p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle
|
||||
// p(11) = angle : Default = 0
|
||||
// p(12) = filletRadius : Default = 0/Auto
|
||||
// p(13) = buttonWall : Default = 2.0;
|
||||
// p(14) = buttonPlateThickness : Default= 2.5;
|
||||
// p(15) = buttonSlack : Default= 0.25;
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
pushButtons =
|
||||
[
|
||||
// ESP Reset Button
|
||||
[2.54 + 0.5, (pcbWidth()/2)+8,
|
||||
8, // Width
|
||||
8, // Length
|
||||
2, // Radius
|
||||
0, // Cap above Lid
|
||||
15, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappRoundedRect // Shape
|
||||
],
|
||||
[2.54 + 0.5, (pcbWidth()/2)-6.5,
|
||||
8, // Width
|
||||
8, // Length
|
||||
2, // Radius
|
||||
0, // Cap above Lid
|
||||
15, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappRoundedRect // Shape
|
||||
]
|
||||
|
||||
//- 0, 1, 2, 3, 4, 5, 6, 7, 8
|
||||
// [(pcbLength()/2)+10, 65, 15, 10, 0, 3, 5, 1, 3]
|
||||
// ,[ 10, 10, 10, 10, 4, 2.0, 4, 1, 4, standoffHeight(), yappCircle, [yappPCBName, "PCB3"]]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// p(0) = posx
|
||||
// p(1) = posy/z
|
||||
// p(2) = rotation degrees CCW
|
||||
// p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// p(4) = { yappLeft | yappRight | yappFront | yappBack | yappLid | yappBaseyappLid } : plane
|
||||
// p(5) = font
|
||||
// p(6) = size
|
||||
// p(7) = "label text"
|
||||
// Optional:
|
||||
// p(8) = Expand : Default = 0 : mm to expand text by (making it bolder)
|
||||
//-------------------------------------------------------------------
|
||||
labelsPlane =
|
||||
[
|
||||
[5, 5, 0, 1, yappLid, "Liberation Mono:style=bold", 5, "YAPP" ]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos
|
||||
// p(1) = width
|
||||
// p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB
|
||||
// yappCoordBox = Above (positive) the bottom of the shell (outside)
|
||||
// Optional:
|
||||
// n(a) = { <yappOrigin>, yappCenter }
|
||||
// n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(c) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
// n(d) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtLeft =
|
||||
[
|
||||
//[pcbLength("Voltage Detect 1")/2, 11, pcbThickness("Voltage Detect 1") + 3, [yappPCBName, "Voltage Detect 1"], yappCenter]
|
||||
//,[pcbLength("Voltage Detect 2")/2, 11, pcbThickness("Voltage Detect 2") + 3, [yappPCBName, "Voltage Detect 2"], yappCenter]
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
//[pcbLength()/2, 12.5, pcbThickness() + 3 , yappCenter]
|
||||
|
||||
];
|
||||
|
||||
ridgeExtFront =
|
||||
[
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
//[pcbWidth()/2, 12.5, 13,yappCoordPCB, yappCenter]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//========= HOOK functions ============================
|
||||
|
||||
// Hook functions allow you to add 3d objects to the case.
|
||||
// Lid/Base = Shell part to attach the object to.
|
||||
// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.
|
||||
// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors.
|
||||
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookLidInside()
|
||||
{
|
||||
//if (printMessages) echo("hookLidInside() ..");
|
||||
|
||||
} // hookLidInside()
|
||||
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,shellHeight)
|
||||
module hookLidOutside()
|
||||
{
|
||||
//if (printMessages) echo("hookLidOutside() ..");
|
||||
|
||||
} // hookLidOutside()
|
||||
|
||||
//===========================================================
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseInside()
|
||||
{
|
||||
//if (printMessages) echo("hookBaseInside() ..");
|
||||
|
||||
} // hookBaseInside()
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseOutside()
|
||||
{
|
||||
//if (printMessages) echo("hookBaseOutside() ..");
|
||||
|
||||
} // hookBaseInside()
|
||||
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// *************** END OF TEMPLATE SECTION ******************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
//projection(cut=true) translate([0,0,-4]) YAPPgenerate();
|
||||
YAPPgenerate();
|
||||
504
case/YAPP_Box/examples/PoolMonitor_v30.scad
Normal file
504
case/YAPP_Box/examples/PoolMonitor_v30.scad
Normal file
@@ -0,0 +1,504 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// for many or complex cutouts you might need to adjust
|
||||
// the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
pcb2X = 95;
|
||||
pcb2Y = 6;
|
||||
pcb2MountInset = 2.5;
|
||||
pcb2HoleDiameter = 3;
|
||||
pcb2Length = 26;
|
||||
pcb2Width = 50;
|
||||
pcb2Thickness = 1.7;
|
||||
pcb2Height = 4;
|
||||
//44.8
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = false;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
// Electro cookie 30 row
|
||||
pcbLength = 88.9; // Front to back
|
||||
pcbWidth = 52.1; // Side to side
|
||||
pcbThickness = 1.7;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 32;
|
||||
paddingBack = 3;
|
||||
paddingRight = 3;
|
||||
paddingLeft = 27;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 12;
|
||||
lidWallHeight = 16;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.3;
|
||||
roundRadius = 3.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 4.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 1.7;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 4.0;
|
||||
|
||||
|
||||
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
// -- Render --
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
|
||||
// --Preview --
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
showSideBySide = true; //-> Default = true
|
||||
onLidGap = 0; // tip don't override to animate the lid opening
|
||||
//onLidGap = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2; // tip don't override to animate the lid opening/closing
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> Remove the walls from the lid : only if preview and showSideBySide=true
|
||||
hideBaseWalls = false; //-> Remove the walls from the base : only if preview and showSideBySide=true
|
||||
showOrientation = true; //-> Show the Front/Back/Left/Right labels : only in preview
|
||||
showPCB = true; //-> Show the PCB in red : only in preview
|
||||
showSwitches = true; //-> Show the switches (for pushbuttons) : only in preview
|
||||
showButtonsDepressed = false; //-> Should the buttons in the Lid On view be in the pressed position
|
||||
showOriginCoordBox = false; //-> Shows red bars representing the origin for yappCoordBox : only in preview
|
||||
showOriginCoordBoxInside = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showOriginCoordPCB = true; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showMarkersPCB = false; //-> Shows black bars corners of the PCB : only in preview
|
||||
showMarkersCenter = false; //-> Shows magenta bars along the centers of all faces
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromBottom = true; //-> View from the inspection cut up
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { yappAllCorners | yappFrontLeft | yappFrontRight | <yappBackLeft> | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
pcb2X = 90;
|
||||
pcb2Y = 6;
|
||||
pcb2Length = 26;
|
||||
pcb2Width = 50;
|
||||
pcb2MountInset = 2.5;
|
||||
pcb2HoleDiameter = 3;
|
||||
pcb2Thickness = 1.7;
|
||||
pcb2Height = 4;
|
||||
*/
|
||||
|
||||
pcbStands = [
|
||||
// Electro cookie 30 row
|
||||
[5.1, 8.25, yappAllCorners]
|
||||
// Relay module
|
||||
,[pcb2X + pcb2MountInset, pcb2Y + pcb2MountInset, pcb2Height, pcb2Thickness, 5, 2.8, yappCoordBox]
|
||||
,[pcb2X + pcb2MountInset, pcb2Y + pcb2Width - pcb2MountInset, pcb2Height, pcb2Thickness, 5, 2.8, yappCoordBox]
|
||||
,[pcb2X + pcb2Length - pcb2MountInset, pcb2Y + pcb2MountInset, pcb2Height, pcb2Thickness, 5, 2.8, yappCoordBox]
|
||||
,[pcb2X + pcb2Length - pcb2MountInset, pcb2Y + pcb2Width - pcb2MountInset, pcb2Height, pcb2Thickness, 5, 2.8, yappCoordBox]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (2) = pcbStandHeight
|
||||
// (3) = screwDiameter
|
||||
// (4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// (5) = insertDiameter
|
||||
// (6) = outsideDiameter
|
||||
// Optional:
|
||||
// (7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (8) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { <yappCoordBox>, yappCoordPCB }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
connectors =
|
||||
[
|
||||
// [9, 15, 10, 2.5, 6 + 1.25, 4.0, 9, 0, yappFrontRight]
|
||||
// ,[9, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]
|
||||
// ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontRight]
|
||||
// ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.
|
||||
// Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter
|
||||
// (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of
|
||||
// the left of the opening
|
||||
// n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
[shellWidth/2, 3, 10, 3, yappCenter, yappFront, yappBack]//, yappCenter]
|
||||
// [[10,10], 3, 0, 3, yappFront, yappBack]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { [yappMaskDef, hOffset, vOffset, rotations] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. THis can be used to fine tune the mask placement in the opening.
|
||||
// (n) = { yappCoordBox | <yappCoordPCB> }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
// Vent
|
||||
// [shellLength/2,shellWidth/2 ,55,55, 5, yappPolygon, shapeHexagon, [maskBars,1,1.5], yappCenter]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
// OLED Screen
|
||||
[35,25 ,22,32, 0, yappRectangle ,yappCenter, yappCoordBox]
|
||||
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
// [68, 12, 14, 5, 2.5, yappRoundedRect, yappCenter, yappCoordBox]
|
||||
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// Cutout for USB
|
||||
[pcbWidth/2, 13, 13,7.5, 2, yappRoundedRect , yappCenter]
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
[70, 13, 0,0, 3, yappCircle , yappCenter]
|
||||
,[103, 3, 0,0, 3, yappCircle , yappCenter]
|
||||
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
//Cutout for cable
|
||||
// [35,6 ,0,0, 3.25, yappCircle,yappCenter]
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[38, 12, 14, 5, 2.5, yappRoundedRect, yappCenter, yappCoordBox]
|
||||
,[80, 12, 14, 4, 2, yappRoundedRect, yappCenter, yappCoordBox]
|
||||
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappSymmetric }
|
||||
// (n) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
snapJoins =
|
||||
[
|
||||
[(shellWidth/2), 10, yappFront, yappCenter]
|
||||
,[(shellWidth/2-28), 10, yappBack, yappSymmetric, yappCenter]
|
||||
//,[25, 10, yappBack, yappBack, yappSymmetric, yappCenter]
|
||||
,[(shellLength/4), 10, yappLeft, yappSymmetric, yappCenter]
|
||||
,[(shellLength/2-5), 10, yappRight, yappCenter]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Light Tubes ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (2) = tubeLength
|
||||
// (3) = tubeWidth
|
||||
// (4) = tubeWall
|
||||
// (5) = gapAbovePcb
|
||||
// (6) = tubeType {yappCircle|yappRectangle}
|
||||
// Optional:
|
||||
// (7) = lensThickness (how much to leave on the top of the lid for the light to shine through 0 for open hole : Default = 0/Open
|
||||
// (8) = Height to top of PCB : Default = standoffHeight+pcbThickness
|
||||
// (9) = filletRadius : Default = 0/Auto
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
lightTubes =
|
||||
[
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = capLength
|
||||
// p(3) = capWidth
|
||||
// p(4) = capRadius
|
||||
// p(5) = capAboveLid
|
||||
// p(6) = switchHeight
|
||||
// p(7) = switchTravel
|
||||
// p(8) = poleDiameter
|
||||
// Optional:
|
||||
// p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// p(10) = Shape {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey} : Default = yappRectangle
|
||||
// p(11) = angle : Default = 0
|
||||
// p(12) = filletRadius : Default = 0/Auto
|
||||
// p(13) = buttonWall : Default = 2.0;
|
||||
// p(14) = buttonPlateThickness : Default= 2.5;
|
||||
// p(15) = buttonSlack : Default= 0.25;
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { yappLeftOrigin, <yappGlobalOrigin> }
|
||||
// n(c) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pushButtons =
|
||||
[
|
||||
// Reset button
|
||||
[(8.820+(2.54*1)),(pcbWidth/2)+(3.810+(2.54*1.5)),
|
||||
8, // Length
|
||||
8, // Width
|
||||
1, // Radius Diameter
|
||||
1, // Cap above Lid
|
||||
14.3, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3.5, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappRoundedRect, // Shape
|
||||
0
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = pos
|
||||
// (1) = width
|
||||
// (2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB
|
||||
// yappCoordBox = Above (positive) the bottom of the shell (outside)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// Note: use ridgeExtTop to reference the top of the extension for cutouts.
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtFront =
|
||||
[
|
||||
// [68, 14, 12, yappCoordBox, yappCenter]
|
||||
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
[pcbWidth/2, 13, 12, yappCenter]
|
||||
|
||||
];
|
||||
|
||||
ridgeExtLeft =
|
||||
[
|
||||
[75, 6, 13+5.6+1.5, yappCoordBox, yappCenter]
|
||||
,[108, 6, 3+5.6+1.5, yappCoordBox, yappCenter]
|
||||
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[38, 14, 12, yappCoordBox, yappCenter]
|
||||
,[80, 14, 12, yappCoordBox, yappCenter]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// (0) = posx
|
||||
// (1) = posy/z
|
||||
// (2) = rotation degrees CCW
|
||||
// (3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}
|
||||
// (5) = font
|
||||
// (6) = size
|
||||
// (7) = "label text"
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
labelsPlane =
|
||||
[
|
||||
[5, 5, 0, 1, yappLid, "Liberation Mono:style=bold", 6, "DMR" ]
|
||||
|
||||
// ,[83.5, 22, -90, 1, yappLid, "Liberation Mono", 4, "Front" ,0.15]
|
||||
// ,[83.5-(2.54*3), 22, -90, 1, yappLid, "Liberation Mono", 4, "Drive" ,0.15]
|
||||
// ,[83.5-(2.54*6), 22, -90, 1, yappLid, "Liberation Mono", 4, "Rear" ,0.15 ]
|
||||
// ,[83.5-(2.54*9), 22, -90, 1, yappLid, "Liberation Mono", 4, "Pool" ,0.15 ]
|
||||
// ,[83.5, 57, -90, 1, yappLid, "Liberation Mono", 4, "Alarm" ,0.15 ]
|
||||
// ,[83.5-(2.54*3), 57, -90, 1, yappLid, "Liberation Mono", 4, "Muted" ,0.15 ]
|
||||
// ,[83.5-(2.54*12), 47, -90, 1, yappLid, "Liberation Mono", 4, "Mute" ,0.15 ]
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
translate([48,(shellWidth + shiftLid*2)+47,0])
|
||||
rotate([0,0,90])
|
||||
import("C:/Users/rosen/OneDrive/Documents/3d Models/OLED mount-hook.stl", convexity=3);
|
||||
357
case/YAPP_Box/examples/RidgeExtDemo_v30.scad
Normal file
357
case/YAPP_Box/examples/RidgeExtDemo_v30.scad
Normal file
@@ -0,0 +1,357 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for Ridge Edge Demo
|
||||
//
|
||||
// Version 3.0 (12-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 4.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
// + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 25;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
// or 1.8x wallThickness if using snaps
|
||||
ridgeHeight = 10.0;
|
||||
ridgeSlack = 0.2;
|
||||
|
||||
//-- Radius of the shell corners
|
||||
roundRadius = 3;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used for PCB Supports, Push Button and showPCB
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 12;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly } : What part of the shell to cut (only affects Left/Right/Front/Back
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
// 1, 2, 3, 4, 5, 6..
|
||||
// This can only have a cable put through it after the case is assembled
|
||||
// This could be used as a locking pin
|
||||
[75,ridgeExtTop-(ridgeHeight/2), 0, 0, 1, yappCircle, yappCenter, yappCoordBox]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[85,ridgeExtTop-ridgeHeight-3, 0, 0, 3, yappCircle, yappCoordBox]
|
||||
|
||||
// In the Middle of the Ridge
|
||||
,[95+3,ridgeExtTop-(ridgeHeight/2), 0, 0, 2.5, yappCircle, yappCenter, yappCoordBox]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,ridgeExtTop-10-3, 0, 0, 3, yappCircle, yappCoordBox]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[45,ridgeExtTop - 15-3, 20, 6, 3, yappRoundedRect, yappCoordBox]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38,ridgeExtTop - 15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter, yappCoordBox]
|
||||
|
||||
|
||||
];
|
||||
|
||||
/***
|
||||
cutoutsBack =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[25,ridgeExtTop-10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,ridgeExtTop-10-3, 6, 6, 0, yappPolygon, shape6ptStar, yappLeftOrigin]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[45,ridgeExtTop - 15-3, 20, 6, 3, yappRoundedRect]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38,ridgeExtTop - 15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
// Height = ridgeExtTop - height of the ext - the diameter of the circle
|
||||
[25,ridgeExtTop-10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[45,ridgeExtTop - 15-3, 10, 6, 3, yappRoundedRect]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38,ridgeExtTop - 15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[25,ridgeExtTop-10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,ridgeExtTop-10-3, 6, 6, 0, yappPolygon, shape6ptStar, yappLeftOrigin]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[45,ridgeExtTop - 15-3, 20, 6, 3, yappRoundedRect]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38,ridgeExtTop - 15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
|
||||
];
|
||||
|
||||
***/
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = pos
|
||||
// (1) = width
|
||||
// (2) = height : Distance below the ridge : Negative to move into lid
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// Note: use ridgeExtTop to reference the top of the extension for cutouts.
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtFront =
|
||||
[
|
||||
[85, 6, ridgeHeight]
|
||||
|
||||
// Make a ridge extension 6mm wide in the middle of the ridge
|
||||
,[95, 6, 5]
|
||||
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
,[25, 6, 10]
|
||||
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 20, 15]
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[25, 6, 10]
|
||||
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge from the left edge
|
||||
,[25, 6, 10, yappLeftOrigin]
|
||||
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 20, 15]
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
];
|
||||
|
||||
ridgeExtLeft =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[25, 6, 10]
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 10, 15]
|
||||
|
||||
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[60, 5, (ridgeHeight/10)* -14]
|
||||
,[70, 5, (ridgeHeight/10)* -10]
|
||||
,[80, 5, (ridgeHeight/10)* -6]
|
||||
,[90, 5, (ridgeHeight/10)* -2]
|
||||
,[100, 5,(ridgeHeight/10)* 2]
|
||||
,[110, 5,(ridgeHeight/10)* 6]
|
||||
,[120, 5,(ridgeHeight/10)* 10]
|
||||
,[130, 5,(ridgeHeight/10)* 14]
|
||||
,[140, 5,(ridgeHeight/10)* 18]
|
||||
,[150, 5,(ridgeHeight/10)* 22]
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[25, 6, 10]
|
||||
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge from the left edge
|
||||
,[25, 6, 10, yappLeftOrigin]
|
||||
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 20, 15]
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// (0) = posx
|
||||
// (1) = posy/z
|
||||
// (2) = rotation degrees CCW
|
||||
// (3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}
|
||||
// (5) = font
|
||||
// (6) = size
|
||||
// (7) = "label text"
|
||||
//-------------------------------------------------------------------
|
||||
labelsPlane =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
646
case/YAPP_Box/examples/WaterHeaterMonitor_v3.scad
Normal file
646
case/YAPP_Box/examples/WaterHeaterMonitor_v3.scad
Normal file
@@ -0,0 +1,646 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0.1 (2024-01-15)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// For many/complex cutoutGrills, you might need to adjust
|
||||
// the max number of elements in OpenSCAD:
|
||||
//
|
||||
// Preferences->Advanced->Turn off rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte refers to Y axis,
|
||||
// height/hoogte refers to Z axis
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// The Following will be used as the first element in the pbc array
|
||||
pcbLength = 88.9; // Front to back
|
||||
pcbWidth = 52.1; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
standoffHeight = 3.0; //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
//===================================================================
|
||||
// *** PCBs ***
|
||||
// Printed Circuit Boards
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : yappCoordBoxInside[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = name
|
||||
// p(1) = length
|
||||
// p(2) = width
|
||||
// p(3) = posx
|
||||
// p(4) = posy
|
||||
// p(5) = Thickness
|
||||
// p(6) = standoffHeight
|
||||
// p(7) = standoffDiameter
|
||||
// p(8) = standoffPinDiameter
|
||||
// p(9) = standoffHoleSlack (default to 0.4)
|
||||
// Optional:
|
||||
|
||||
//The following can be used to get PCB values elsewhere in the script - not in pcb definition.
|
||||
//If "PCB Name" is omitted then "Main" is used
|
||||
// pcbLength --> pcbLength("PCB Name")
|
||||
// pcbWidth --> pcbWidth("PCB Name")
|
||||
// pcbThickness --> pcbThickness("PCB Name")
|
||||
// standoffHeight --> standoffHeight("PCB Name")
|
||||
// standoffDiameter --> standoffDiameter("PCB Name")
|
||||
// standoffPinDiameter --> standoffPinDiameter("PCB Name")
|
||||
// standoffHoleSlack --> standoffHoleSlack("PCB Name")
|
||||
|
||||
pcb =
|
||||
[
|
||||
["Main", pcbLength,pcbWidth, 0,34, pcbThickness, standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]
|
||||
,["Voltage Detect 1", ,71.5, 15.1, 5,0, 1.6, 3, 5, 2.5]
|
||||
,["Voltage Detect 2", ,71.5, 15.1, 5,16.1, 1.6, 3, 5, 2.5]
|
||||
];
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.4;
|
||||
basePlaneThickness = 1.2;
|
||||
lidPlaneThickness = 1.2;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 9;
|
||||
lidWallHeight = 17;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 3.0;
|
||||
|
||||
|
||||
// Set the layer height of your printer
|
||||
printerLayerHeight = 0.2;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
// -- Render --
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
|
||||
// --Preview --
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
showSideBySide = true; //-> Default = true
|
||||
onLidGap = 0; // tip don't override to animate the lid opening
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> Remove the walls from the lid : only if preview and showSideBySide=true
|
||||
hideBaseWalls = false; //-> Remove the walls from the base : only if preview and showSideBySide=true
|
||||
showOrientation = true; //-> Show the Front/Back/Left/Right labels : only in preview
|
||||
showPCB = true; //-> Show the PCB in red : only in preview
|
||||
showSwitches = true; //-> Show the switches (for pushbuttons) : only in preview
|
||||
showButtonsDepressed = false; //-> Should the buttons in the Lid On view be in the pressed position
|
||||
showOriginCoordBox = false; //-> Shows red bars representing the origin for yappCoordBox : only in preview
|
||||
showOriginCoordBoxInside = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showOriginCoordPCB = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showMarkersPCB = false; //-> Shows black bars corners of the PCB : only in preview
|
||||
showMarkersCenter = false; //-> Shows magenta bars along the centers of all faces
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromBottom = true; //-> View from the inspection cut up
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
// Start of Debugging config (used if not overridden in template)
|
||||
// ------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
//==================================================================
|
||||
// *** Shapes ***
|
||||
//------------------------------------------------------------------
|
||||
// There are a view pre defines shapes and masks
|
||||
// shapes:
|
||||
// shapeIsoTriangle, shapeHexagon, shape6ptStar
|
||||
//
|
||||
// masks:
|
||||
// maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars
|
||||
//
|
||||
//------------------------------------------------------------------
|
||||
// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will
|
||||
// be scaled as needed.
|
||||
// defined as a vector of [x,y] vertices pairs.(min 3 vertices)
|
||||
// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];
|
||||
// To see how to add your own shapes and mask see the YAPPgenerator program
|
||||
//------------------------------------------------------------------
|
||||
|
||||
|
||||
// Show sample of a Mask
|
||||
//SampleMask(maskHoneycomb);
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// Optional:
|
||||
// p(2) = Height to bottom of PCB : Default = standoff_Height
|
||||
// p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcb_Thickness, yappCoordBox=0
|
||||
// p(4) = standoff_Diameter Default = standoff_Diameter;
|
||||
// p(5) = standoff_PinDiameter Default = standoff_PinDiameter;
|
||||
// p(6) = standoff_HoleSlack Default = standoff_HoleSlack;
|
||||
// p(7) = filletRadius (0 = auto size)
|
||||
// n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// n(b) = { <yappPin>, yappHole } // Baseplate support treatment
|
||||
// n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { yappNoFillet }
|
||||
// n(f) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
//- Add stands 5mm from each corner of the PCB
|
||||
[5, 5, yappAllCorners]
|
||||
//- Add posts 25mm from the corners of the box, with a custon height,diameter, Pin Size, hole
|
||||
//- slack and filler radius.
|
||||
// [25, 25, 10, 10, 3.3, 0.9, 5, yappCoordBox]
|
||||
// [5,5, yappAllCorners]
|
||||
|
||||
// Voltage Dector boards have 2 offset pins
|
||||
,[15.4, 6.5, undef, undef, 5, 2.5, [yappPCBName, "Voltage Detect 1"]]
|
||||
,[55.7, 2.25, undef, undef, 5, 2.5, [yappPCBName, "Voltage Detect 1"]]
|
||||
|
||||
,[15.4, 6.5, undef, undef, 5, 2.5, [yappPCBName, "Voltage Detect 2"]]
|
||||
,[55.7, 2.25, undef, undef, 5, 2.5, [yappPCBName, "Voltage Detect 2"]]
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = pcbStandHeight
|
||||
// p(3) = screwDiameter
|
||||
// p(4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// p(5) = insertDiameter
|
||||
// p(6) = outsideDiameter
|
||||
// Optional:
|
||||
// p(7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// p(8) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = [yappPCBName, "XXX"] : {XXX = the PCB name: Default "Main"}
|
||||
//-------------------------------------------------------------------
|
||||
connectors =
|
||||
[
|
||||
// [9, 15, standoffHeight("PCB3"), 2.5, 6 + 1.25, 4.0, 9, yappAllCorners, [yappPCBName, "PCB3"]]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
// n(g) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBase =
|
||||
[
|
||||
[pcbLength()/2,pcbWidth()/2 ,55,55, 5, yappPolygon ,0 ,0, yappCenter, shapeHexagon, [maskHoneycomb,0,1.5,0], ]
|
||||
// , [0, 0, 10, 10, 0, yappRectangle, maskHexCircles, [yappPCBName, "PCB3"]]
|
||||
// , [shellLength*2/3,shellWidth/2 ,0, 30, 20, yappCircleWithFlats, yappCenter]
|
||||
// , [shellLength/2,shellWidth/2 ,10, 5, 20, yappCircleWithKey,yappCenter]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// Cutout for USB
|
||||
[pcbWidth()/2, 13 -pcbThickness() ,12.5,7.0, 2, yappRoundedRect , yappCenter]
|
||||
|
||||
// Cutout for AC 1
|
||||
,[pcbWidth("Voltage Detect 1")/2, pcbThickness("Voltage Detect 1") + 3 ,11,7.0, 2, yappRoundedRect , yappCenter, [yappPCBName, "Voltage Detect 1"]]
|
||||
// Cutout for AC 2
|
||||
,[pcbWidth("Voltage Detect 2")/2, pcbThickness("Voltage Detect 2") + 3 ,11,7.0, 2, yappRoundedRect , yappCenter, [yappPCBName, "Voltage Detect 2"]]
|
||||
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
[pcbLength()/2, pcbThickness() + 3 ,12.5,7.0, 2, yappRoundedRect , yappCenter]
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx | posy
|
||||
// p(1) = width
|
||||
// p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// Optional:
|
||||
// n(a) = { <yappOrigin>, yappCenter }
|
||||
// n(b) = { yappSymmetric }
|
||||
// n(c) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[30, 10, yappFront, yappCenter, yappSymmetric]
|
||||
,[47, 10, yappBack, yappCenter]
|
||||
,[30, 10, yappRight, yappCenter, yappSymmetric]
|
||||
,[30, 10, yappLeft, yappCenter, yappSymmetric]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.
|
||||
// Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter
|
||||
// (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of
|
||||
// the left of the opening
|
||||
// n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
[shellWidth/2,3,-3,4,yappFront, yappCenter]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Light Tubes ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = tubeLength
|
||||
// p(3) = tubeWidth
|
||||
// p(4) = tubeWall
|
||||
// p(5) = gapAbovePcb
|
||||
// p(6) = { yappCircle | yappRectangle } : tubeType
|
||||
// Optional:
|
||||
// p(7) = lensThickness (how much to leave on the top of the lid for the
|
||||
// light to shine through 0 for open hole : Default = 0/Open
|
||||
// p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness
|
||||
// p(9) = filletRadius : Default = 0/Auto
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
lightTubes =
|
||||
[
|
||||
// ESP Power Light
|
||||
[12.5 + 3, (pcbWidth()/2)+7.0, // [0,1] Pos
|
||||
3, 3, // [2,3] Length, Width
|
||||
0.8, // [4] wall thickness
|
||||
standoffHeight() + pcbThickness() + 12, // [5] Gap above base bottom
|
||||
yappCircle, // [6] tubeType (Shape)
|
||||
0, // [7] lensThickness
|
||||
yappCoordPCB // [n1]
|
||||
]
|
||||
|
||||
// Voltage Detect 1 power indicator
|
||||
,[30,pcbWidth("Voltage Detect 1")/2, // [0,1] Pos
|
||||
6, 6, // [2,3] Length, Width
|
||||
0.8, // [4] wall thickness
|
||||
5, // [5] gapAbovePcb
|
||||
yappCircle, // [6] tubeType (Shape)
|
||||
0, // [7] lensThickness
|
||||
yappCoordPCB // [n1]
|
||||
,[yappPCBName, "Voltage Detect 1"]
|
||||
]
|
||||
|
||||
// Voltage Detect 2 power indicator
|
||||
,[30,pcbWidth("Voltage Detect 2")/2, // [0,1] Pos
|
||||
6, 6, // [2,3] Length, Width
|
||||
0.8, // [4] wall thickness
|
||||
5, // [5] Gap above base bottom
|
||||
yappCircle, // [6] tubeType (Shape)
|
||||
0, // [7] lensThickness
|
||||
yappCoordPCB // [n1]
|
||||
,[yappPCBName, "Voltage Detect 2"]
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = capLength
|
||||
// p(3) = capWidth
|
||||
// p(4) = capRadius
|
||||
// p(5) = capAboveLid
|
||||
// p(6) = switchHeight
|
||||
// p(7) = switchTravel
|
||||
// p(8) = poleDiameter
|
||||
// Optional:
|
||||
// p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle
|
||||
// p(11) = angle : Default = 0
|
||||
// p(12) = filletRadius : Default = 0/Auto
|
||||
// p(13) = buttonWall : Default = 2.0;
|
||||
// p(14) = buttonPlateThickness : Default= 2.5;
|
||||
// p(15) = buttonSlack : Default= 0.25;
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
pushButtons =
|
||||
[
|
||||
// ESP Reset Button
|
||||
[2.54 + 3, (pcbWidth()/2)+7.0,
|
||||
8, // Width
|
||||
8, // Length
|
||||
2, // Radius
|
||||
0, // Cap above Lid
|
||||
15, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappRoundedRect // Shape
|
||||
]
|
||||
// ,[ 5, 5, 10, 10, 4, 2.0, 4, 1, 4, standoffHeight(), yappCircle, [yappPCBName, "Voltage Detect 1"]]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// p(0) = posx
|
||||
// p(1) = posy/z
|
||||
// p(2) = rotation degrees CCW
|
||||
// p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// p(4) = { yappLeft | yappRight | yappFront | yappBack | yappLid | yappBaseyappLid } : plane
|
||||
// p(5) = font
|
||||
// p(6) = size
|
||||
// p(7) = "label text"
|
||||
// Optional:
|
||||
// p(8) = Expand : Default = 0 : mm to expand text by (making it bolder)
|
||||
// p(9) = Direction : { <yappTextLeftToRight>, yappTextRightToLeft, yappTextTopToBottom, yappTextBottomToTop }
|
||||
// p(10) = Horizontal alignment : { <yappTextHAlignLeft>, yappTextHAlignCenter, yappTextHAlignRight }
|
||||
// p(11) = Vertical alignment : { yappTextVAlignTop, yappTextVAlignCenter, yappTextVAlignBaseLine,
|
||||
// p(12) = Character Spacing : Default = 1
|
||||
//-------------------------------------------------------------------
|
||||
labelsPlane =
|
||||
[
|
||||
[6.5, shellWidth-28, -90, 1, yappLid, "Liberation Mono", 5, "RESET" , 0.15]
|
||||
,[16.5, shellWidth-28, -90, 1, yappLid, "Liberation Mono", 5, "POWER" ,0.15 ]
|
||||
,[43, shellWidth-56, -90, 1, yappLid, "Liberation Mono", 5, "Elements" ,0.15 ]
|
||||
,[34, shellWidth-65.5, -90, 1, yappLid, "Liberation Mono", 5, "UPPER" ,0.15, yappTextTopToBottom, undef, undef, 1.1]
|
||||
,[34, shellWidth-82, -90, 1, yappLid, "Liberation Mono", 5, "LOWER" ,0.15, yappTextTopToBottom, undef, undef, 1.1]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos
|
||||
// p(1) = width
|
||||
// p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB
|
||||
// yappCoordBox = Above (positive) the bottom of the shell (outside)
|
||||
// Optional:
|
||||
// n(a) = { <yappOrigin>, yappCenter }
|
||||
// n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(c) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
// n(d) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtLeft =
|
||||
[
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
[pcbLength()/2, 12.5, pcbThickness() + 3 , yappCenter]
|
||||
|
||||
];
|
||||
|
||||
ridgeExtFront =
|
||||
[
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
[pcbWidth()/2, 12.5, 13,yappCoordPCB, yappCenter]
|
||||
,[pcbWidth("Voltage Detect 1")/2, 11, pcbThickness("Voltage Detect 1") + 3, [yappPCBName, "Voltage Detect 1"], yappCenter]
|
||||
,[pcbWidth("Voltage Detect 2")/2, 11, pcbThickness("Voltage Detect 2") + 3, [yappPCBName, "Voltage Detect 2"], yappCenter]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//========= HOOK functions ============================
|
||||
|
||||
// Hook functions allow you to add 3d objects to the case.
|
||||
// Lid/Base = Shell part to attach the object to.
|
||||
// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.
|
||||
// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors.
|
||||
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookLidInside()
|
||||
{
|
||||
//if (printMessages) echo("hookLidInside() ..");
|
||||
|
||||
} // hookLidInside()
|
||||
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,shellHeight)
|
||||
module hookLidOutside()
|
||||
{
|
||||
//if (printMessages) echo("hookLidOutside() ..");
|
||||
|
||||
} // hookLidOutside()
|
||||
|
||||
//===========================================================
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseInside()
|
||||
{
|
||||
//if (printMessages) echo("hookBaseInside() ..");
|
||||
color("Red")
|
||||
translate([(shellLength-1)/2,33,0])
|
||||
cube([shellLength-1,1,5], center=true);
|
||||
|
||||
} // hookBaseInside()
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseOutside()
|
||||
{
|
||||
//if (printMessages) echo("hookBaseOutside() ..");
|
||||
|
||||
} // hookBaseInside()
|
||||
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// *************** END OF TEMPLATE SECTION ******************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
271
case/YAPP_Box/examples/YAPP_ArduinoClone_v30.scad
Normal file
271
case/YAPP_Box/examples/YAPP_ArduinoClone_v30.scad
Normal file
@@ -0,0 +1,271 @@
|
||||
//---------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This will generate a projectbox for a "Arduino UNO 'clone'"
|
||||
//
|
||||
// Version 3.0 (02-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-as --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
| | v
|
||||
| -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
//-- which half do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
|
||||
|
||||
myPcb = "./STL/MODELS/Arduino_Uno_model.stl";
|
||||
|
||||
if (true)
|
||||
{
|
||||
translate([900.5, -271, 2.6])
|
||||
{
|
||||
rotate([0,0,0]) color("lightgray") import(myPcb);
|
||||
}
|
||||
}
|
||||
|
||||
//-- Edit these parameters for your own board dimensions
|
||||
wallThickness = 1.8;
|
||||
basePlaneThickness = 1.2;
|
||||
lidPlaneThickness = 1.7;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (baseWallHeight+lidWall_heigth) - (standoff_heigth+pcbThickness)
|
||||
//-- (6.2 + 4.5) - (3.5 + 1.5) ==> 5.7
|
||||
baseWallHeight = 6.5;
|
||||
lidWallHeight = 5.5;
|
||||
|
||||
//-- pcb dimensions
|
||||
pcbLength = 68.5;
|
||||
pcbWidth = 53.3;
|
||||
pcbThickness = 1.5;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 2;
|
||||
paddingBack = 2;
|
||||
paddingRight = 2;
|
||||
paddingLeft = 2;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.5;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 3.5;
|
||||
pinDiameter = 3.0;
|
||||
standoffDiameter = 5.2;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 5;
|
||||
shiftLid = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
colorLid = "yellow";
|
||||
hideBaseWalls = false; //-> false
|
||||
colorBase = "gray";
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[13.8, 1.75, yappBoth, yappBackLeft, yappNoFillet] // back-left
|
||||
,[15, 2.7, yappBaseOnly, yappBackRight] // back-right
|
||||
,[14.5, 8, undef, undef, 4, 0.5, 0,1, yappLidOnly, yappHole, yappBackRight] // push down
|
||||
,[2.4, 7, yappBoth, yappPin, yappFrontLeft, yappNoFillet] // front-left
|
||||
,[2.4, 18.2, yappBoth, yappPin, yappFrontRight, yappNoFillet] // front-right
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { [yappMaskDef, hOffset, vOffst, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsLid =
|
||||
[
|
||||
[ 4, 38, 14, 14, 2, yappRoundedRect, 20, yappCenter, yappCoordPCB] // USB (right)
|
||||
,[ 3, 7.5, 15, 10, 1, yappRoundedRect, yappCenter, yappCoordPCB] // Power Jack
|
||||
// ,[40, 53, 50, 10, 2, yappRoundedRect, 10, yappCenter, yappCoordPCB] // right headers
|
||||
// ,[45.5, -1, 40, 10, 0, yappRectangle, yappCenter, yappCoordPCB] // left headers
|
||||
,[38, 3, 24.5, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB] // left power header
|
||||
,[65, 27.5, 9, 12, 1, yappRoundedRect, yappCenter, yappCoordPCB] // ICSP1
|
||||
,[ 4, 47.5, 8, 0, 3, yappCircle, yappCoordPCB] // reset button
|
||||
,[26, 22.5, 3, 3.5, 1, yappRoundedRect, yappCenter, yappCoordPCB] // led 13
|
||||
,[26, 29, 3, 3.5, 1, yappRoundedRect, yappCenter, yappCoordPCB] // TX
|
||||
,[26, 35, 3, 3.5, 1, yappRoundedRect, yappCenter, yappCoordPCB] // RX
|
||||
,[26, 42, 3, 3.5, 1, yappRoundedRect, yappCenter, yappCoordPCB] // PWR
|
||||
];
|
||||
|
||||
//-- base plane -- origin is pcb[0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
cutoutsBase =
|
||||
[
|
||||
[pcbLength/2, pcbWidth/2 ,45, 45, 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
//-- back plane -- origin is pcb[0,0,0]
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsBack =
|
||||
[
|
||||
[38, 4, 14, 11, 1, yappRoundedRect, 25, yappCenter, yappCoordPCB] // USB-A
|
||||
,[ 7.5, 4, 10, 11, 1, yappRoundedRect, 5, yappCenter, yappCoordPCB] // Power Jack
|
||||
];
|
||||
|
||||
//-- right plane -- origin is pcb[0,0,0]
|
||||
// (0) = posX
|
||||
// (1) = posZ
|
||||
cutoutsRight =
|
||||
[
|
||||
[42.0, 7, 51, 3, 2, yappRoundedRect, 10, yappCenter, yappCoordPCB] // right headers
|
||||
];
|
||||
//-- right plane -- origin is pcb[0,0,0]
|
||||
// (0) = posX
|
||||
// (1) = posZ
|
||||
cutoutsLeft =
|
||||
[
|
||||
[46.5, 7, 42, 3, 2, yappRoundedRect, 9, yappCenter, yappCoordPCB] // left headers
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappSymmetric }
|
||||
// (n) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[10, 5, yappRight, yappLeft, yappSymmetric]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// (0) = posx
|
||||
// (1) = posy/z
|
||||
// (2) = rotation degrees CCW
|
||||
// (3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}
|
||||
// (5) = font
|
||||
// (6) = size
|
||||
// (7) = "label text"
|
||||
//-------------------------------------------------------------------
|
||||
labelsPlane = [
|
||||
[28, 14, 0, 0.8, yappTop, "Arial:style=bold", 4, "Arduino CLONE" ]
|
||||
, [57, 25, 90, 0.8, yappTop, "Liberation Mono:style=bold", 5, "YAPP" ]
|
||||
, [33, 23, 0, 0.8, yappTop, "Liberation Mono:style=bold", 4, "L13" ]
|
||||
, [33, 30, 0, 0.8, yappTop, "Liberation Mono:style=bold", 4, "TX" ]
|
||||
, [33, 36, 0, 0.8, yappTop, "Liberation Mono:style=bold", 4, "RX" ]
|
||||
, [33, 43, 0, 0.8, yappTop, "Liberation Mono:style=bold", 4, "PWR" ]
|
||||
];
|
||||
|
||||
|
||||
YAPPgenerate();
|
||||
549
case/YAPP_Box/examples/YAPP_Countersink Sample_v3.scad
Normal file
549
case/YAPP_Box/examples/YAPP_Countersink Sample_v3.scad
Normal file
@@ -0,0 +1,549 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0.1 (2024-01-15)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// For many/complex cutoutGrills, you might need to adjust
|
||||
// the max number of elements in OpenSCAD:
|
||||
//
|
||||
// Preferences->Advanced->Turn off rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte refers to Y axis,
|
||||
// height/hoogte refers to Z axis
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // front to back (X axis)
|
||||
pcbWidth = 100; // side to side (Y axis)
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 2;
|
||||
paddingBack = 2;
|
||||
paddingRight = 2;
|
||||
paddingLeft = 2;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 3.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used for PCB Supports, Push Button and showPCB
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
// Set the layer height of your printer
|
||||
printerLayerHeight = 0.2;
|
||||
|
||||
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
// -- Render --
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
|
||||
// --Preview --
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
showSideBySide = true; //-> Default = true
|
||||
onLidGap = 0; // tip don't override to animate the lid opening
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> Remove the walls from the lid : only if preview and showSideBySide=true
|
||||
hideBaseWalls = false; //-> Remove the walls from the base : only if preview and showSideBySide=true
|
||||
showOrientation = true; //-> Show the Front/Back/Left/Right labels : only in preview
|
||||
showPCB = false; //-> Show the PCB in red : only in preview
|
||||
showSwitches = false; //-> Show the switches (for pushbuttons) : only in preview
|
||||
showButtonsDepressed = false; //-> Should the buttons in the Lid On view be in the pressed position
|
||||
showOriginCoordBox = false; //-> Shows red bars representing the origin for yappCoordBox : only in preview
|
||||
showOriginCoordBoxInside = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showOriginCoordPCB = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showMarkersPCB = false; //-> Shows black bars corners of the PCB : only in preview
|
||||
showMarkersCenter = false; //-> Shows magenta bars along the centers of all faces
|
||||
inspectX = 145; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = false; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromBottom = true; //-> View from the inspection cut up
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
// Start of Debugging config (used if not overridden in template)
|
||||
// ------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
//==================================================================
|
||||
// *** Shapes ***
|
||||
//------------------------------------------------------------------
|
||||
// There are a view pre defines shapes and masks
|
||||
// shapes:
|
||||
// shapeIsoTriangle, shapeHexagon, shape6ptStar
|
||||
//
|
||||
// masks:
|
||||
// maskHoneycomb, maskHexCircles, maskBars, maskOffsetBars
|
||||
//
|
||||
//------------------------------------------------------------------
|
||||
// Shapes should be defined to fit into a 1x1 box (+/-0.5 in X and Y) - they will
|
||||
// be scaled as needed.
|
||||
// defined as a vector of [x,y] vertices pairs.(min 3 vertices)
|
||||
// for example a triangle could be [yappPolygonDef,[[-0.5,-0.5],[0,0.5],[0.5,-0.5]]];
|
||||
// To see how to add your own shapes and mask see the YAPPgenerator program
|
||||
//------------------------------------------------------------------
|
||||
|
||||
|
||||
// Show sample of a Mask
|
||||
//SampleMask(maskHoneycomb);
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// Optional:
|
||||
// p(2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// p(4) = standoffDiameter Default = standoffDiameter;
|
||||
// p(5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// p(6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// p(7) = filletRadius (0 = auto size)
|
||||
// n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// n(b) = { <yappPin>, yappHole } // Baseplate support treatment
|
||||
// n(c) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
//- Add stands 5mm from each corner of the PCB
|
||||
[5, 5]
|
||||
//- Add posts 25mm from the corners of the box, with a custon height,diameter, Pin Size, hole
|
||||
//- slack and filler radius.
|
||||
// [25, 25, 10, 10, 3.3, 0.9, 5, yappCoordBox]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = pcbStandHeight
|
||||
// p(3) = screwDiameter
|
||||
// p(4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// p(5) = insertDiameter
|
||||
// p(6) = outsideDiameter
|
||||
// Optional:
|
||||
// p(7) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// p(8) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }
|
||||
// n(c) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
connectors =
|
||||
[
|
||||
[9, 15, 10, 2.5, 6 + 1.25, 4.0, 9, 4, yappFrontRight, yappCountersink]
|
||||
// ,[9, 15, 10, 2.5, 6 + 1.25, 4.0, 9, yappNoFillet, yappFrontLeft]
|
||||
// ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, yappFrontRight]
|
||||
// ,[34, 15, 10, 2.5, 6+ 1.25, 4.0, 9, 0, yappFrontLeft]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBase =
|
||||
[
|
||||
[65,shellWidth/2 ,55,55, 5, yappPolygon ,0 ,30, yappCenter, shapeHexagon, maskHexCircles]
|
||||
// , [0, 0, 10, 10, 0, yappRectangle,maskHexCircles]
|
||||
// , [shellLength*2/3,shellWidth/2 ,0, 30, 20, yappCircleWithFlats, yappCenter]
|
||||
// , [shellLength/2,shellWidth/2 ,10, 5, 20, yappCircleWithKey,yappCenter]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
//Center test
|
||||
[shellLength/2, shellWidth/2, 1, 1, 5, yappRectangle ,20 ,45, yappCenter]
|
||||
,[pcbLength/2, pcbWidth/2, 1, 1, 5, yappRectangle ,20 ,45, yappCenter, yappCoordPCB]
|
||||
//Edge tests
|
||||
,[shellLength/2, 0, 2, 2, 5, yappRectangle ,20 ,45, yappCenter]
|
||||
,[shellLength/2, shellWidth, 2, 2, 5, yappRectangle ,20 ,45, yappCenter]
|
||||
,[0, shellWidth/2, 2, 2, 5, yappRectangle ,20 ,45, yappCenter]
|
||||
,[shellLength, shellWidth/2, 2, 2, 5, yappRectangle ,20 ,45, yappCenter]
|
||||
|
||||
,[shellLength*2/3, shellWidth/2, 0, 30, 20, yappCircleWithFlats, yappCenter]
|
||||
,[shellLength/3, shellWidth/2, 10, 5, 20, yappCircleWithKey,yappCenter]
|
||||
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx | posy
|
||||
// p(1) = width
|
||||
// p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// Optional:
|
||||
// n(a) = { <yappOrigin>, yappCenter }
|
||||
// n(b) = { yappSymmetric }
|
||||
// n(c) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[15, 10, yappFront, yappCenter, yappRectangle, yappSymmetric]
|
||||
,[25, 10, yappBack, yappSymmetric, yappCenter]
|
||||
,[30, 10, yappLeft, yappRight, yappCenter, yappSymmetric]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.
|
||||
// Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter
|
||||
// (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of
|
||||
// the left of the opening
|
||||
// n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Light Tubes ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = tubeLength
|
||||
// p(3) = tubeWidth
|
||||
// p(4) = tubeWall
|
||||
// p(5) = gapAbovePcb
|
||||
// p(6) = { yappCircle | yappRectangle } : tubeType
|
||||
// Optional:
|
||||
// p(7) = lensThickness (how much to leave on the top of the lid for the
|
||||
// light to shine through 0 for open hole : Default = 0/Open
|
||||
// p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness
|
||||
// p(9) = filletRadius : Default = 0/Auto
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
lightTubes =
|
||||
[
|
||||
[(pcbLength/2)+10, 20, // [0,1] Pos
|
||||
5, 5, // [2,3] Length, Width
|
||||
1, // [4] wall thickness
|
||||
standoffHeight + pcbThickness + 4, // [5] Gap above base bottom
|
||||
yappRectangle, // [6] tubeType (Shape)
|
||||
0.5, // [7] lensThickness
|
||||
yappCoordPCB // [n1]
|
||||
]
|
||||
,
|
||||
[(pcbLength/2)+10, 40, // [0,1] Pos
|
||||
5, 10, // [2,3] Length, Width
|
||||
1, // [4] wall thickness
|
||||
standoffHeight + pcbThickness + 4, // [5] Gap above base bottom
|
||||
yappCircle, // [6] tubeType (Shape)
|
||||
undef, // [7]
|
||||
undef, // [8]
|
||||
5, // [9] filletRadius
|
||||
yappCoordPCB // [n1]
|
||||
]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = capLength
|
||||
// p(3) = capWidth
|
||||
// p(4) = capRadius
|
||||
// p(5) = capAboveLid
|
||||
// p(6) = switchHeight
|
||||
// p(7) = switchTravel
|
||||
// p(8) = poleDiameter
|
||||
// Optional:
|
||||
// p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle
|
||||
// p(11) = angle : Default = 0
|
||||
// p(12) = filletRadius : Default = 0/Auto
|
||||
// p(13) = buttonWall : Default = 2.0;
|
||||
// p(14) = buttonPlateThickness : Default= 2.5;
|
||||
// p(15) = buttonSlack : Default= 0.25;
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pushButtons =
|
||||
[
|
||||
//- 0, 1, 2, 3, 4, 5, 6, 7, 8
|
||||
[(pcbLength/2)+10, 65, 15, 10, 0, 3, 5, 1, 3]
|
||||
,[(pcbLength/2)+10, 85, 10, 10, 4, 2.0, 4, 1, 4, standoffHeight, yappCircle]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// p(0) = posx
|
||||
// p(1) = posy/z
|
||||
// p(2) = rotation degrees CCW
|
||||
// p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// p(4) = { yappLeft | yappRight | yappFront | yappBack | yappLid | yappBaseyappLid } : plane
|
||||
// p(5) = font
|
||||
// p(6) = size
|
||||
// p(7) = "label text"
|
||||
// Optional:
|
||||
// p(8) = Expand : Default = 0 : mm to expand text by (making it bolder)
|
||||
//-------------------------------------------------------------------
|
||||
labelsPlane =
|
||||
[
|
||||
[5, 5, 0, 1, yappLid, "Liberation Mono:style=bold", 5, "YAPP" ]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos
|
||||
// p(1) = width
|
||||
// p(2) = height : Where to relocate the seam : yappCoordPCB = Above (positive) the PCB
|
||||
// yappCoordBox = Above (positive) the bottom of the shell (outside)
|
||||
// Optional:
|
||||
// n(a) = { <yappOrigin>, yappCenter }
|
||||
// n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(c) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
//
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtLeft =
|
||||
[
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
];
|
||||
|
||||
ridgeExtFront =
|
||||
[
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
//========= HOOK functions ============================
|
||||
|
||||
// Hook functions allow you to add 3d objects to the case.
|
||||
// Lid/Base = Shell part to attach the object to.
|
||||
// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.
|
||||
// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors.
|
||||
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookLidInside()
|
||||
{
|
||||
//if (printMessages) echo("hookLidInside() ..");
|
||||
|
||||
} // hookLidInside()
|
||||
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,shellHeight)
|
||||
module hookLidOutside()
|
||||
{
|
||||
//if (printMessages) echo("hookLidOutside() ..");
|
||||
|
||||
} // hookLidOutside()
|
||||
|
||||
//===========================================================
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseInside()
|
||||
{
|
||||
//if (printMessages) echo("hookBaseInside() ..");
|
||||
|
||||
} // hookBaseInside()
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseOutside()
|
||||
{
|
||||
//if (printMessages) echo("hookBaseOutside() ..");
|
||||
|
||||
} // hookBaseInside()
|
||||
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// *************** END OF TEMPLATE SECTION ******************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
// **********************************************************
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
220
case/YAPP_Box/examples/YAPP_Demo_DisplayMount_v31.scad
Normal file
220
case/YAPP_Box/examples/YAPP_Demo_DisplayMount_v31.scad
Normal file
@@ -0,0 +1,220 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// for many or complex cutouts you might need to adjust
|
||||
// the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
shiftLid = 10; // Set the distance between the lid and base when rendered or previewed side by side
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
// ********************************************************************
|
||||
// The Following will be used as the first element in the pbc array
|
||||
|
||||
//Defined here so you can define the "Main" PCB using these if wanted
|
||||
pcbLength = 140; // front to back (X axis)
|
||||
pcbWidth = 120; // side to side (Y axis)
|
||||
pcbThickness = 1.6;
|
||||
standoffHeight = 1.0; //-- How much the PCB needs to be raised from the base to leave room for solderings
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 10;
|
||||
lidWallHeight = 5;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.3;
|
||||
roundRadius = 3.0;
|
||||
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
// -- Render --
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
|
||||
// --Preview --
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
showSideBySide = true; //-> Default = true
|
||||
onLidGap = 0; // tip don't override to animate the lid opening
|
||||
//onLidGap = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2; // tip don't override to animate the lid opening/closing
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> Remove the walls from the lid : only if preview and showSideBySide=true
|
||||
hideBaseWalls = false; //-> Remove the walls from the base : only if preview and showSideBySide=true
|
||||
showOrientation = true; //-> Show the Front/Back/Left/Right labels : only in preview
|
||||
showPCB = false; //-> Show the PCB in red : only in preview
|
||||
showSwitches = false; //-> Show the switches (for pushbuttons) : only in preview
|
||||
showButtonsDepressed = false; //-> Should the buttons in the Lid On view be in the pressed position
|
||||
showOriginCoordBox = false; //-> Shows red bars representing the origin for yappCoordBox : only in preview
|
||||
showOriginCoordBoxInside = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showOriginCoordPCB = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showMarkersPCB = false; //-> Shows black bars corners of the PCB : only in preview
|
||||
showMarkersCenter = false; //-> Shows magenta bars along the centers of all faces
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromBottom = true; //-> View from the inspection cut up
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Display Mounts ***
|
||||
// add a cutout to the lid with mounting posts for a display
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p[2] : displayWidth = overall Width of the display module
|
||||
// p[3] : displayHeight = overall Height of the display module
|
||||
// p[4] : pinInsetH = Horizontal inset of the mounting hole
|
||||
// p[5] : pinInsetV = Vertical inset of the mounting hole
|
||||
// p[6] : pinDiameter,
|
||||
// p[7] : postOverhang = Extra distance on outside of pins for the display to sit on - pin Diameter is a good value
|
||||
// p[8] : walltoPCBGap = Distance from the display PCB to the surface of the screen
|
||||
// p[9] : pcbThickness = Thickness of the display module PCB
|
||||
// p[10] : windowWidth = opening width for the screen
|
||||
// p[11] : windowHeight = Opening height for the screen
|
||||
// p[12] : windowOffsetH = Horizontal offset from the center for the opening
|
||||
// p[13] : windowOffsetV = Vertical offset from the center for the opening
|
||||
// p[14] : bevel = Apply a 45degree bevel to the opening
|
||||
// Optionl:
|
||||
// p[15] : rotation
|
||||
// p[16] : snapDiameter : default = pinDiameter*2
|
||||
// p[17] : lidThickness : default = lidPlaneThickness
|
||||
// n(a) = { <yappOrigin>, yappCenter }
|
||||
// n(b) = { <yappCoordBox> | yappCoordPCB | yappCoordBoxInside }
|
||||
// n(c) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
// n(d) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
//-------------------------------------------------------------------
|
||||
displayMounts =
|
||||
[
|
||||
[ // This is for a SSD-1306 OLED Display v1.1 with vcc-gnd-scl-sda Pinout
|
||||
20, //xPos
|
||||
20, // yPos
|
||||
28.9, // displayWidth
|
||||
27.1, //displayHeight
|
||||
2.7, //pinInsetH
|
||||
1.9, //pinInsetV
|
||||
2.0, //pinDiameter
|
||||
2.0, //postOverhang
|
||||
1.5, //walltoPCBGap
|
||||
1.5, //pcbThickness
|
||||
26.4, //windowWidth
|
||||
14.5, //windowHeight
|
||||
0, //windowOffsetH
|
||||
1.5, //windowOffsetV
|
||||
true, //bevel
|
||||
0, // rotation
|
||||
yappDefault,//snapDiameter
|
||||
yappDefault,
|
||||
yappCenter,
|
||||
],
|
||||
[ // This is for a 1620A 2x20 LCD Display - Mounted through the lid
|
||||
100, //xPos
|
||||
25, // yPos
|
||||
80, // displayWidth
|
||||
35.9, //displayHeight
|
||||
2.2, //pinInsetH
|
||||
2.2, //pinInsetV
|
||||
2.7, //pinDiameter
|
||||
2.7, //postOverhang
|
||||
5.8, //walltoPCBGap
|
||||
1.5, //pcbThickness
|
||||
71.5, //windowWidth
|
||||
24.2, //windowHeight
|
||||
0, //windowOffsetH
|
||||
-0.9, //windowOffsetV
|
||||
false, //bevel
|
||||
0, // rotation
|
||||
5.0,//snapDiameter
|
||||
yappDefault,
|
||||
yappCenter,
|
||||
],
|
||||
[ // This is for a 1620A 2x20 LCD Display - Mounted under the lid
|
||||
100, //xPos
|
||||
75, // yPos
|
||||
80, // displayWidth
|
||||
35.9, //displayHeight
|
||||
2.2, //pinInsetH
|
||||
2.2, //pinInsetV
|
||||
2.7, //pinDiameter
|
||||
2.7, //postOverhang
|
||||
7.3, //walltoPCBGap
|
||||
1.5, //pcbThickness
|
||||
67.0, //windowWidth
|
||||
17.0, //windowHeight
|
||||
0, //windowOffsetH
|
||||
-0.9, //windowOffsetV
|
||||
false, //bevel
|
||||
0, // rotation
|
||||
5.0,//snapDiameter
|
||||
yappDefault,
|
||||
yappCenter,
|
||||
],
|
||||
[ // This is for a 2.8 TFT SPI 240*320 V1.2 Display
|
||||
// Note the measurements were to the pin holes not the entire display
|
||||
30, //xPos
|
||||
80, // yPos
|
||||
82.4, // displayWidth
|
||||
50.0, //displayHeight
|
||||
3.0, //pinInsetH
|
||||
3.0, //pinInsetV
|
||||
2.9, //pinDiameter
|
||||
2.9, //postOverhang
|
||||
3.8, //walltoPCBGap
|
||||
1.5, //pcbThickness
|
||||
60.0, //windowWidth
|
||||
46.6, //windowHeight
|
||||
5.4, //windowOffsetH
|
||||
0, //windowOffsetV
|
||||
true, //bevel
|
||||
90, // rotation
|
||||
5.0,//snapDiameter
|
||||
yappDefault,
|
||||
yappCenter,
|
||||
],
|
||||
];
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
|
||||
328
case/YAPP_Box/examples/YAPP_Demo_RealBox_v30.scad
Normal file
328
case/YAPP_Box/examples/YAPP_Demo_RealBox_v30.scad
Normal file
@@ -0,0 +1,328 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for Demo RealBox - transmitter/receiver
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
makeTransmitter = false; //-- {true|false}
|
||||
|
||||
//=========== DON'T CHANGE ANYTING BELOW THIS LINE ==================
|
||||
|
||||
insertDiam = 4.1;
|
||||
|
||||
leftPadding = makeTransmitter ? 1 : 15;
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
|
||||
/*
|
||||
see https://polyd.com/en/conversione-step-to-stl-online
|
||||
*/
|
||||
|
||||
myPcb = "./STL/MODELS/virtualP1Cable_v10_model.stl";
|
||||
|
||||
if (true)
|
||||
{
|
||||
translate([-145.5, 156.5+leftPadding, 5.5])
|
||||
{
|
||||
rotate([0,0,0]) color("lightgray") import(myPcb);
|
||||
}
|
||||
}
|
||||
|
||||
//-- switchBlock dimensions
|
||||
switchWallThickness = 1;
|
||||
switchWallHeight = 11;
|
||||
switchLength = 15;
|
||||
switchWidth = 13;
|
||||
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 62.3;
|
||||
pcbWidth = 49.6;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = leftPadding; //-> set on top of file;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 1.8;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 14;
|
||||
lidWallHeight = 5;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.5;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 4.0; //-- only used for showPCB
|
||||
standoffPinDiameter = 2.2;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 5;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
colorBase = "BurlyWood";
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[// 0, 1, 2, 3, 4, 5, 6
|
||||
[3.2, 3.0, yappBoth, yappPin, yappFrontRight]
|
||||
,[3.2, 3.5, yappBoth, yappPin, yappBackLeft]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (2) = pcbStandHeight
|
||||
// (3) = screwDiameter
|
||||
// (4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// (5) = insertDiameter
|
||||
// (6) = outsideDiameter
|
||||
// Optional:
|
||||
// (7) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { <yappCoordBox>, yappCoordPCB }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
connectors =
|
||||
[
|
||||
//--0, 1, 2, 3, 4, 5, 6, 7, 8, -rest-
|
||||
[3, 3.2, 4, 2.7, 5, insertDiam, 7, 0, yappCoordPCB, yappFrontLeft]
|
||||
,[3, 3.2, 4, 2.7, 5, insertDiam, 7, 0, yappCoordPCB, yappBackRight]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
[pcbLength/2, pcbWidth/2 ,25, 25, 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5, 6, 7 8, 9, n
|
||||
[-3, 30, 13, 8, 0, yappRectangle, yappCoordPCB] //-- antennaConnector
|
||||
,[45, 8.5, 18, 15, 0, yappRectangle, 4, yappCoordPCB] //-- RJ12
|
||||
,[49.5, 41.5, 14, 12, 0, yappRectangle, yappCenter, yappCoordPCB] //-- switchBlock
|
||||
];
|
||||
|
||||
|
||||
// (0) = xPos from used yappCoord[0,0,0]
|
||||
// (1) = zPos from used yappCoord[0,0,0]
|
||||
cutoutsFront =
|
||||
[
|
||||
[ 8.5, 0, 15, 16, 0, yappRectangle, 4, yappCoordPCB] //-- RJ12
|
||||
,[-6, 0, 0, 7, 4.5, yappCircleWithFlats, 0, 90, yappCenter, yappCoordPCB] //-- powerJack
|
||||
];
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5, 6, n
|
||||
[34, 15, 0, 0, 6, yappCircle, 10, yappCenter, yappCoordPCB] //-- antennaConnector
|
||||
];
|
||||
|
||||
//-- base mounts -- origen = box[x0,y0]
|
||||
// (0) = posx | posy
|
||||
// (1) = screwDiameter
|
||||
// (2) = width
|
||||
// (3) = height
|
||||
// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// (5) = { yappCenter }
|
||||
baseMounts =
|
||||
[
|
||||
[pcbLength/2, pcbWidth/2 ,25, 25, 0, 0 , 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB] //, yappUseMask]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappSymmetric }
|
||||
// (n) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[15, 3, yappLeft, yappRight, yappCenter, yappSymmetric]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
//===========================================================
|
||||
module hookLidInside()
|
||||
{
|
||||
echo("hookLidInsidePost(switchBox) ..");
|
||||
|
||||
translate([(47.5+wallThickness+paddingFront)
|
||||
, (38.5+wallThickness+paddingRight+paddingLeft)
|
||||
, (switchWallHeight+0)/-2])
|
||||
{
|
||||
difference()
|
||||
{
|
||||
//-- [49.5, 41.5, 12, 14, 0, yappRectangle, yappCenter] //-- switchBlock
|
||||
//-- [49.5, 41.5, 13, 15, 0, yappRectangle, yappCenter] //-- switchBlock
|
||||
|
||||
color("blue") cube([switchLength, switchWidth, switchWallHeight], center=true);
|
||||
color("red") cube([switchLength-switchWallThickness,
|
||||
switchWidth-switchWallThickness, switchWallHeight+1], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // hookLidInside(dummy)
|
||||
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
328
case/YAPP_Box/examples/YAPP_Demo_RealBox_v31.scad
Normal file
328
case/YAPP_Box/examples/YAPP_Demo_RealBox_v31.scad
Normal file
@@ -0,0 +1,328 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for Demo RealBox - transmitter/receiver
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
makeTransmitter = false; //-- {true|false}
|
||||
|
||||
//=========== DON'T CHANGE ANYTING BELOW THIS LINE ==================
|
||||
|
||||
insertDiam = 4.1;
|
||||
|
||||
leftPadding = makeTransmitter ? 1 : 15;
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
|
||||
/*
|
||||
see https://polyd.com/en/conversione-step-to-stl-online
|
||||
*/
|
||||
|
||||
myPcb = "./STL/MODELS/virtualP1Cable_v10_model.stl";
|
||||
|
||||
if (true)
|
||||
{
|
||||
translate([-145.5, 156.5+leftPadding, 5.5])
|
||||
{
|
||||
rotate([0,0,0]) color("lightgray") import(myPcb);
|
||||
}
|
||||
}
|
||||
|
||||
//-- switchBlock dimensions
|
||||
switchWallThickness = 1;
|
||||
switchWallHeight = 11;
|
||||
switchLength = 15;
|
||||
switchWidth = 13;
|
||||
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 62.3;
|
||||
pcbWidth = 49.6;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = leftPadding; //-> set on top of file;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 1.8;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 14;
|
||||
lidWallHeight = 5;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.5;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 4.0; //-- only used for showPCB
|
||||
standoffPinDiameter = 2.2;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 5;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
colorBase = "BurlyWood";
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[// 0, 1, 2, 3, 4, 5, 6
|
||||
[3.2, 3.0, yappBoth, yappPin, yappFrontRight]
|
||||
,[3.2, 3.5, yappBoth, yappPin, yappBackLeft]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// (2) = pcbStandHeight
|
||||
// (3) = screwDiameter
|
||||
// (4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// (5) = insertDiameter
|
||||
// (6) = outsideDiameter
|
||||
// Optional:
|
||||
// (7) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { <yappCoordBox>, yappCoordPCB }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
connectors =
|
||||
[
|
||||
//--0, 1, 2, 3, 4, 5, 6, 7, 8, -rest-
|
||||
[3, 3.2, 4, 2.7, 5, insertDiam, 7, 0, yappCoordPCB, yappFrontLeft]
|
||||
,[3, 3.2, 4, 2.7, 5, insertDiam, 7, 0, yappCoordPCB, yappBackRight]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
[pcbLength/2, pcbWidth/2 ,25, 25, 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5, 6, 7 8, 9, n
|
||||
[-3, 30, 13, 8, 0, yappRectangle, yappCoordPCB] //-- antennaConnector
|
||||
,[45, 8.5, 18, 15, 0, yappRectangle, 4, yappCoordPCB] //-- RJ12
|
||||
,[49.5, 41.5, 14, 12, 0, yappRectangle, yappCenter, yappCoordPCB] //-- switchBlock
|
||||
];
|
||||
|
||||
|
||||
// (0) = xPos from used yappCoord[0,0,0]
|
||||
// (1) = zPos from used yappCoord[0,0,0]
|
||||
cutoutsFront =
|
||||
[
|
||||
[ 8.5, 0, 15, 16, 0, yappRectangle, 4, yappCoordPCB] //-- RJ12
|
||||
,[-6, 0, 0, 7, 4.5, yappCircleWithFlats, 0, 90, yappCenter, yappCoordPCB] //-- powerJack
|
||||
];
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5, 6, n
|
||||
[34, 15, 0, 0, 6, yappCircle, 10, yappCenter, yappCoordPCB] //-- antennaConnector
|
||||
];
|
||||
|
||||
//-- base mounts -- origen = box[x0,y0]
|
||||
// (0) = posx | posy
|
||||
// (1) = screwDiameter
|
||||
// (2) = width
|
||||
// (3) = height
|
||||
// (4..7) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// (5) = { yappCenter }
|
||||
baseMounts =
|
||||
[
|
||||
[pcbLength/2, pcbWidth/2 ,25, 25, 0, 0 , 0, yappPolygon, shapeHexagon, maskHoneycomb, yappCenter, yappCoordPCB] //, yappUseMask]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappSymmetric }
|
||||
// (n) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[15, 3, yappLeft, yappRight, yappCenter, yappSymmetric]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
//===========================================================
|
||||
module hookLidInside()
|
||||
{
|
||||
echo("hookLidInsidePost(switchBox) ..");
|
||||
|
||||
translate([(47.5+wallThickness+paddingFront)
|
||||
, (38.5+wallThickness+paddingRight+paddingLeft)
|
||||
, (switchWallHeight+0)/-2])
|
||||
{
|
||||
difference()
|
||||
{
|
||||
//-- [49.5, 41.5, 12, 14, 0, yappRectangle, yappCenter] //-- switchBlock
|
||||
//-- [49.5, 41.5, 13, 15, 0, yappRectangle, yappCenter] //-- switchBlock
|
||||
|
||||
color("blue") cube([switchLength, switchWidth, switchWallHeight], center=true);
|
||||
color("red") cube([switchLength-switchWallThickness,
|
||||
switchWidth-switchWallThickness, switchWallHeight+1], center=true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // hookLidInside(dummy)
|
||||
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
158
case/YAPP_Box/examples/YAPP_Demo_boxMounts_v30.scad
Normal file
158
case/YAPP_Box/examples/YAPP_Demo_boxMounts_v30.scad
Normal file
@@ -0,0 +1,158 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a YAPP_Test_buttons_v30 test box
|
||||
//
|
||||
// Rendering takes ~ 11 minutes (renderQuality 10)
|
||||
// Rendering takes ~ 5 minutes (renderQuality 5)
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 100;
|
||||
pcbWidth = 100;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 1.4;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.0;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 10;
|
||||
lidWallHeight = 10;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.0; //-> at least 1.8 * wallThickness
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 8.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 3.0;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 6;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 5; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 10;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
colorBase = "yellow";
|
||||
alphaBase = 0.8;//0.2;
|
||||
colorLid = "silver";
|
||||
alphaLid = 0.8;//0.2;
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Base)
|
||||
inspectXfromBack = false; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = true; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X. Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of the left of the opening
|
||||
// n(e) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
[13, 3, 3, 3, yappLeft, yappRight, yappFront, yappBack]
|
||||
,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter]
|
||||
,[30, 2, 6, 5, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappLeftOrigin] // Note placement as previous line for Front and Left
|
||||
,[10, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappLid]
|
||||
,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappLid]
|
||||
,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappLeftOrigin, yappLid] // Note placement as previous line for Front and Left
|
||||
|
||||
,[40, 3, 3, 3, yappLeft] // 3 length yields a hole twice as wide as long (screw diameter = 3 also)
|
||||
,[50, 3, 0, 3, 1, yappLeft] // Zero length yields a circular hole
|
||||
,[60, 3, -3, 3, yappLeft] // 3 length yields a hole twice as long as wide perpendicular to case (screw diameter = 3 also)
|
||||
,[[70,10], 3, 10, 3, yappLeft] // Vector por position yoelds Pos=70, offset = normal offset + 10
|
||||
,[0, 3, 0, 3, 4, yappFront] // Note fillet/connection issues when closer to corner than roundRadius value
|
||||
];
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
158
case/YAPP_Box/examples/YAPP_Demo_boxMounts_v31.scad
Normal file
158
case/YAPP_Box/examples/YAPP_Demo_boxMounts_v31.scad
Normal file
@@ -0,0 +1,158 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a YAPP_Test_buttons_v30 test box
|
||||
//
|
||||
// Rendering takes ~ 11 minutes (renderQuality 10)
|
||||
// Rendering takes ~ 5 minutes (renderQuality 5)
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 100;
|
||||
pcbWidth = 100;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 1.4;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.0;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 10;
|
||||
lidWallHeight = 10;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.0; //-> at least 1.8 * wallThickness
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 8.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 3.0;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 6;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 5; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 10;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
colorBase = "yellow";
|
||||
alphaBase = 0.8;//0.2;
|
||||
colorLid = "silver";
|
||||
alphaLid = 0.8;//0.2;
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Base)
|
||||
inspectXfromBack = false; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = true; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X. Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of the left of the opening
|
||||
// n(e) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
[13, 3, 3, 3, yappLeft, yappRight, yappFront, yappBack]
|
||||
,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter]
|
||||
,[30, 2, 6, 5, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappAltOrigin] // Note placement as previous line for Front and Left
|
||||
,[10, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappLid]
|
||||
,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappLid]
|
||||
,[30, 3, 6, 3, yappLeft, yappRight, yappFront, yappBack, yappCenter, yappAltOrigin, yappLid] // Note placement as previous line for Front and Left
|
||||
|
||||
,[40, 3, 3, 3, yappLeft] // 3 length yields a hole twice as wide as long (screw diameter = 3 also)
|
||||
,[50, 3, 0, 3, 1, yappLeft] // Zero length yields a circular hole
|
||||
,[60, 3, -3, 3, yappLeft] // 3 length yields a hole twice as long as wide perpendicular to case (screw diameter = 3 also)
|
||||
,[[70,10], 3, 10, 3, yappLeft] // Vector por position yoelds Pos=70, offset = normal offset + 10
|
||||
,[0, 3, 0, 3, 4, yappFront] // Note fillet/connection issues when closer to corner than roundRadius value
|
||||
];
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
328
case/YAPP_Box/examples/YAPP_Demo_buttons2_v30.scad
Normal file
328
case/YAPP_Box/examples/YAPP_Demo_buttons2_v30.scad
Normal file
@@ -0,0 +1,328 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a YAPP_Test_buttons2_v30 test box
|
||||
//
|
||||
// Rendering takes ~ 11 minutes (renderQuality 10)
|
||||
// Rendering takes ~ 5 minutes (renderQuality 5)
|
||||
//
|
||||
// Version 3.0 (12-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
//-- Bambu Lab X1C 0.4mm Nozzle PLA
|
||||
//insertDiam = 3.8 + 0.4;
|
||||
//screwDiam = 2.5 + 0.4;
|
||||
//-- Bambu Lab X1C 0.4mm Nozzle XT-Copolyester
|
||||
insertDiam = 3.8 + 0.5;
|
||||
screwDiam = 2.5 + 0.5;
|
||||
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 100;
|
||||
pcbWidth = 100;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 1.4;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.0;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 10;
|
||||
lidWallHeight = 10;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.0; //-> at least 1.8 * wallThickness
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 3.0;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 6;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 5; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 10;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
colorBase = "yellow";
|
||||
alphaBase = 0.8;//0.2;
|
||||
colorLid = "silver";
|
||||
alphaLid = 0.8;//0.2;
|
||||
showOrientation = true;
|
||||
showPCB = true;
|
||||
showSwitches = true;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Base)
|
||||
inspectXfromBack = false; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = true; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[5, 5]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBase =
|
||||
[
|
||||
];
|
||||
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsFront =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5
|
||||
[3, 2, shellWidth-6, shellHeight-4, 2, yappRoundedRect]
|
||||
];
|
||||
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsBack =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5
|
||||
[5, 2, shellWidth-10, shellHeight-4, 3, yappRoundedRect]
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = capLength
|
||||
// p(3) = capWidth
|
||||
// p(4) = capRadius
|
||||
// p(5) = capAboveLid
|
||||
// p(6) = switchHeight
|
||||
// p(7) = switchTravel
|
||||
// p(8) = poleDiameter
|
||||
// Optional:
|
||||
// p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// p(10) = Shape {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey} : Default = yappRectangle
|
||||
// p(11) = angle : Default = 0
|
||||
// p(12) = filletRadius : Default = 0/Auto
|
||||
// p(13) = buttonWall : Default = 2.0;
|
||||
// p(14) = buttonPlateThickness : Default= 2.5;
|
||||
// p(15) = buttonSlack : Default= 0.25;
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { yappLeftOrigin, <yappGlobalOrigin> }
|
||||
//-------------------------------------------------------------------
|
||||
pushButtons =
|
||||
[
|
||||
[20,pcbWidth/2,
|
||||
8, // Width
|
||||
8, // Length
|
||||
4, // Radius
|
||||
0, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappCircle, // Shape
|
||||
yappNoFillet
|
||||
]
|
||||
,[20,pcbWidth/2-20,
|
||||
8, // Width
|
||||
8, // Length
|
||||
4, // Radius
|
||||
0, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappCircle, // Shape
|
||||
0,
|
||||
undef,
|
||||
2.0, //buttonWall
|
||||
2.5, // button plate thickness
|
||||
0.5 // button slack
|
||||
]
|
||||
,[40,pcbWidth/2,
|
||||
8, // Width
|
||||
8, // Length
|
||||
4, // Radius
|
||||
0, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappPolygon, // Shape
|
||||
shapeArrow
|
||||
]
|
||||
,[40,pcbWidth/2-20,
|
||||
8, // Width
|
||||
8, // Length
|
||||
4, // Radius
|
||||
0, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappPolygon, // Shape
|
||||
90,
|
||||
shapeArrow
|
||||
]
|
||||
,[60,pcbWidth/2,
|
||||
8, // Width
|
||||
8, // Length
|
||||
2, // Radius
|
||||
-1, // Cap above Lid
|
||||
6, // Switch Height
|
||||
1, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappRoundedRect // Shape
|
||||
]
|
||||
,[80,pcbWidth/2,
|
||||
8, // Width
|
||||
8, // Length
|
||||
0, // Radius
|
||||
1, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappRectangle, // Shape
|
||||
0
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
328
case/YAPP_Box/examples/YAPP_Demo_buttons2_v31.scad
Normal file
328
case/YAPP_Box/examples/YAPP_Demo_buttons2_v31.scad
Normal file
@@ -0,0 +1,328 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a YAPP_Test_buttons2_v30 test box
|
||||
//
|
||||
// Rendering takes ~ 11 minutes (renderQuality 10)
|
||||
// Rendering takes ~ 5 minutes (renderQuality 5)
|
||||
//
|
||||
// Version 3.0 (12-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
//-- Bambu Lab X1C 0.4mm Nozzle PLA
|
||||
//insertDiam = 3.8 + 0.4;
|
||||
//screwDiam = 2.5 + 0.4;
|
||||
//-- Bambu Lab X1C 0.4mm Nozzle XT-Copolyester
|
||||
insertDiam = 3.8 + 0.5;
|
||||
screwDiam = 2.5 + 0.5;
|
||||
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 100;
|
||||
pcbWidth = 100;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 1.4;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.0;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 10;
|
||||
lidWallHeight = 10;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.0; //-> at least 1.8 * wallThickness
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 3.0;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 6;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 5; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 10;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
colorBase = "yellow";
|
||||
alphaBase = 0.8;//0.2;
|
||||
colorLid = "silver";
|
||||
alphaLid = 0.8;//0.2;
|
||||
showOrientation = true;
|
||||
showPCB = true;
|
||||
showSwitches = true;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Base)
|
||||
inspectXfromBack = false; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = true; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[5, 5]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBase =
|
||||
[
|
||||
];
|
||||
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsFront =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5
|
||||
[3, 2, shellWidth-6, shellHeight-4, 2, yappRoundedRect]
|
||||
];
|
||||
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsBack =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5
|
||||
[5, 2, shellWidth-10, shellHeight-4, 3, yappRoundedRect]
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = capLength
|
||||
// p(3) = capWidth
|
||||
// p(4) = capRadius
|
||||
// p(5) = capAboveLid
|
||||
// p(6) = switchHeight
|
||||
// p(7) = switchTravel
|
||||
// p(8) = poleDiameter
|
||||
// Optional:
|
||||
// p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// p(10) = Shape {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey} : Default = yappRectangle
|
||||
// p(11) = angle : Default = 0
|
||||
// p(12) = filletRadius : Default = 0/Auto
|
||||
// p(13) = buttonWall : Default = 2.0;
|
||||
// p(14) = buttonPlateThickness : Default= 2.5;
|
||||
// p(15) = buttonSlack : Default= 0.25;
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { yappLeftOrigin, <yappGlobalOrigin> }
|
||||
//-------------------------------------------------------------------
|
||||
pushButtons =
|
||||
[
|
||||
[20,pcbWidth/2,
|
||||
8, // Width
|
||||
8, // Length
|
||||
4, // Radius
|
||||
0, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappCircle, // Shape
|
||||
yappNoFillet
|
||||
]
|
||||
,[20,pcbWidth/2-20,
|
||||
8, // Width
|
||||
8, // Length
|
||||
4, // Radius
|
||||
0, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappCircle, // Shape
|
||||
0,
|
||||
undef,
|
||||
2.0, //buttonWall
|
||||
2.5, // button plate thickness
|
||||
0.5 // button slack
|
||||
]
|
||||
,[40,pcbWidth/2,
|
||||
8, // Width
|
||||
8, // Length
|
||||
4, // Radius
|
||||
0, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappPolygon, // Shape
|
||||
shapeArrow
|
||||
]
|
||||
,[40,pcbWidth/2-20,
|
||||
8, // Width
|
||||
8, // Length
|
||||
4, // Radius
|
||||
0, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappPolygon, // Shape
|
||||
90,
|
||||
shapeArrow
|
||||
]
|
||||
,[60,pcbWidth/2,
|
||||
8, // Width
|
||||
8, // Length
|
||||
2, // Radius
|
||||
-1, // Cap above Lid
|
||||
6, // Switch Height
|
||||
1, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappRoundedRect // Shape
|
||||
]
|
||||
,[80,pcbWidth/2,
|
||||
8, // Width
|
||||
8, // Length
|
||||
0, // Radius
|
||||
1, // Cap above Lid
|
||||
5, // Switch Height
|
||||
0.5, // Switch travel
|
||||
3, // Pole Diameter
|
||||
undef, // Height to top of PCB
|
||||
yappRectangle, // Shape
|
||||
0
|
||||
]
|
||||
|
||||
];
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
198
case/YAPP_Box/examples/YAPP_Demo_buttons_v30.scad
Normal file
198
case/YAPP_Box/examples/YAPP_Demo_buttons_v30.scad
Normal file
@@ -0,0 +1,198 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a YAPP_Test_buttons_v30 test box
|
||||
//
|
||||
// Rendering takes ~ 11 minutes (renderQuality 10)
|
||||
// Rendering takes ~ 5 minutes (renderQuality 5)
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 30;
|
||||
pcbWidth = 40;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.4;
|
||||
basePlaneThickness = 1.6;
|
||||
lidPlaneThickness = 1.6;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 10;
|
||||
lidWallHeight = 10;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0; //-> at least 1.8 * wallThickness
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 3.0;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 6;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 5; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
colorBase = "yellow";
|
||||
alphaBase = 0.8;//0.2;
|
||||
colorLid = "silver";
|
||||
alphaLid = 0.8;//0.2;
|
||||
showOrientation = true;
|
||||
showPCB = true;
|
||||
showSwitches = true;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 18; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Base)
|
||||
inspectXfromBack = false; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = true; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[5, 5, yappAllCorners]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = capLength
|
||||
// p(3) = capWidth
|
||||
// p(4) = capRadius
|
||||
// p(5) = capAboveLid
|
||||
// p(6) = switchHeight
|
||||
// p(7) = switchTravel
|
||||
// p(8) = poleDiameter
|
||||
// Optional:
|
||||
// p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle
|
||||
// p(11) = angle : Default = 0
|
||||
// p(12) = filletRadius : Default = 0/Auto
|
||||
// p(13) = buttonWall : Default = 2.0;
|
||||
// p(14) = buttonPlateThickness : Default= 2.5;
|
||||
// p(15) = buttonSlack : Default= 0.25;
|
||||
// p(16) = snapSlack : Default= 0.10;
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
//-------------------------------------------------------------------
|
||||
pushButtons =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5, 6, 7, 8
|
||||
[15, 10, 8, 6, 0, 3, 5.5, 1, 3.5, undef, yappRectangle]
|
||||
,[15, 30, 0, 0, 4, 0, 3, 1, 3.5, undef, yappCircle, undef, undef, undef, undef, 0.25, .2]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
|
||||
// Set standard view for Screen Shots
|
||||
$vpr = [80,0,104];
|
||||
$vpt = [-17, 15,8];
|
||||
$vpf = 22.5;
|
||||
$vpd = 102;
|
||||
|
||||
228
case/YAPP_Box/examples/YAPP_Demo_buttons_v31.scad
Normal file
228
case/YAPP_Box/examples/YAPP_Demo_buttons_v31.scad
Normal file
@@ -0,0 +1,228 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a YAPP_Test_buttons_v30 test box
|
||||
//
|
||||
// Rendering takes ~ 11 minutes (renderQuality 10)
|
||||
// Rendering takes ~ 5 minutes (renderQuality 5)
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 30;
|
||||
pcbWidth = 40;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.4;
|
||||
basePlaneThickness = 1.6;
|
||||
lidPlaneThickness = 1.6;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 10;
|
||||
lidWallHeight = 10;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0; //-> at least 1.8 * wallThickness
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 3.0;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 6;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 5; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
colorBase = "yellow";
|
||||
alphaBase = 0.8;//0.2;
|
||||
colorLid = "silver";
|
||||
alphaLid = 0.8;//0.2;
|
||||
showOrientation = true;
|
||||
showPCB = true;
|
||||
showSwitches = true;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 18; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Base)
|
||||
inspectXfromBack = false; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = true; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[5, 5, yappAllCorners]
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = StandHeight : From specified origin
|
||||
// p(3) = screwDiameter
|
||||
// p(4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// p(5) = insertDiameter
|
||||
// p(6) = outsideDiameter
|
||||
// Optional:
|
||||
// p(7) = insert Depth : default to entire connector
|
||||
// p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0
|
||||
// p(9) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }
|
||||
// n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = { yappCountersink }
|
||||
// n(e) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
connectors =
|
||||
[
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Push Buttons ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = capLength
|
||||
// p(3) = capWidth
|
||||
// p(4) = capRadius
|
||||
// p(5) = capAboveLid
|
||||
// p(6) = switchHeight
|
||||
// p(7) = switchTravel
|
||||
// p(8) = poleDiameter
|
||||
// Optional:
|
||||
// p(9) = Height to top of PCB : Default = standoffHeight + pcbThickness
|
||||
// p(10) = { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey } : Shape, Default = yappRectangle
|
||||
// p(11) = angle : Default = 0
|
||||
// p(12) = filletRadius : Default = 0/Auto
|
||||
// p(13) = buttonWall : Default = 2.0;
|
||||
// p(14) = buttonPlateThickness : Default= 2.5;
|
||||
// p(15) = buttonSlack : Default= 0.25;
|
||||
// p(16) = snapSlack : Default= 0.10;
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
//-------------------------------------------------------------------
|
||||
pushButtons =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5, 6, 7, 8
|
||||
[15, 14, 8, 6, 0, 3, 5.5, 1, 3.5, undef, yappRectangle]
|
||||
,[15, 28, 0, 0, 4, 0, 3, 1, 3.5, undef, yappCircle, undef, undef, undef, undef, 0.25, .2]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
|
||||
// Set standard view for Screen Shots
|
||||
|
||||
$vpr = [80,0,104];
|
||||
$vpt = [-17, 15,8];
|
||||
$vpf = 22.5;
|
||||
$vpd = 102;
|
||||
|
||||
198
case/YAPP_Box/examples/YAPP_Demo_cutout_yappRing_v30.scad
Normal file
198
case/YAPP_Box/examples/YAPP_Demo_cutout_yappRing_v30.scad
Normal file
@@ -0,0 +1,198 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0.5 (03-26-2024)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 41;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.25;
|
||||
lidPlaneThickness = 1.25;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 8;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 6; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 2;
|
||||
shiftLid = 5;
|
||||
colorLid = "gray";
|
||||
alphaLid = 1;//0.2;
|
||||
colorBase = "yellow";
|
||||
alphaBase = 1;//0.2;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
// yappRing | width, length, radius | | radius = outer radius,
|
||||
// | | | length = inner radius
|
||||
// | | | width = connection between rings
|
||||
// | | | 0 = No connectors
|
||||
// | | | positive = 2 connectors
|
||||
// | | | negative = 4 connectors
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
// n(g) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
// n(h) = { yappFromInside } Make the cut from the inside towards the outside
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
[20,20, 0, 10, 20, yappRing, yappCenter]
|
||||
,[70,20, 5, 10, 20, yappRing, yappDefault, 0, yappCenter]
|
||||
,[120,20, -5, 10, 20, yappRing, yappDefault, 45, yappCenter]
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
198
case/YAPP_Box/examples/YAPP_Demo_cutout_yappRing_v31.scad
Normal file
198
case/YAPP_Box/examples/YAPP_Demo_cutout_yappRing_v31.scad
Normal file
@@ -0,0 +1,198 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0.5 (03-26-2024)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 41;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.25;
|
||||
lidPlaneThickness = 1.25;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 8;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 6; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 2;
|
||||
shiftLid = 5;
|
||||
colorLid = "gray";
|
||||
alphaLid = 1;//0.2;
|
||||
colorBase = "yellow";
|
||||
alphaBase = 1;//0.2;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
// yappRing | width, length, radius | | radius = outer radius,
|
||||
// | | | length = inner radius
|
||||
// | | | width = connection between rings
|
||||
// | | | 0 = No connectors
|
||||
// | | | positive = 2 connectors
|
||||
// | | | negative = 4 connectors
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
// n(g) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
// n(h) = { yappFromInside } Make the cut from the inside towards the outside
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
[20,20, 0, 10, 20, yappRing, yappCenter]
|
||||
,[70,20, 5, 10, 20, yappRing, yappDefault, 0, yappCenter]
|
||||
,[120,20, -5, 10, 20, yappRing, yappDefault, 45, yappCenter]
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
@@ -0,0 +1,230 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 100; // Front to back
|
||||
pcbWidth = 80; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 10;
|
||||
paddingBack = 10;
|
||||
paddingRight = 30;
|
||||
paddingLeft = 40;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.25;
|
||||
lidPlaneThickness = 1.25;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 8;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 2;
|
||||
shiftLid = 5;
|
||||
colorLid = "Yellow";
|
||||
alphaLid = 1;//0.2;
|
||||
colorBase = "silver";
|
||||
alphaBase = 1;//0.2;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappLeftOrigin | <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, n
|
||||
// All 4 Coordinate combinations of (yappOrigin | yappCenter) and (yappCoordBox | yappCoordPCB)
|
||||
[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, n
|
||||
// All 8 Coordinate combinations of (yappOrigin | yappCenter) and (yappCoordBox | yappCoordPCB) and (yappLeftOrigin |yappGlobalOrigin)
|
||||
[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
,[25,15, 20, 12, 2, yappRoundedRect, yappCenter, yappCoordPCB, yappLeftOrigin]
|
||||
,[25,15, 20, 12, 2, yappRoundedRect, yappCenter, yappLeftOrigin]
|
||||
,[25,15, 20, 14, 2, yappRoundedRect]
|
||||
,[25,15, 20, 14, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 16, 2, yappRoundedRect, yappCoordPCB, yappLeftOrigin]
|
||||
,[25,15, 20, 16, 2, yappRoundedRect, yappLeftOrigin]
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
// All 4 Coordinate combinations of (yappOrigin | yappCenter) and (yappCoordBox | yappCoordPCB)
|
||||
[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// All 8 Coordinate combinations
|
||||
[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB, yappLeftOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappLeftOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB, yappLeftOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappLeftOrigin]
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, n
|
||||
// All 4 Coordinate combinations of (yappOrigin | yappCenter) and (yappCoordBox | yappCoordPCB)
|
||||
[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
// All 8 Coordinate combinations
|
||||
[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB, yappLeftOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappLeftOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB, yappLeftOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappLeftOrigin]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
@@ -0,0 +1,230 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 100; // Front to back
|
||||
pcbWidth = 80; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 10;
|
||||
paddingBack = 10;
|
||||
paddingRight = 30;
|
||||
paddingLeft = 40;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.25;
|
||||
lidPlaneThickness = 1.25;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 8;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 2;
|
||||
shiftLid = 5;
|
||||
colorLid = "Yellow";
|
||||
alphaLid = 1;//0.2;
|
||||
colorBase = "silver";
|
||||
alphaBase = 1;//0.2;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappAltOrigin | <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, n
|
||||
// All 4 Coordinate combinations of (yappOrigin | yappCenter) and (yappCoordBox | yappCoordPCB)
|
||||
[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, n
|
||||
// All 8 Coordinate combinations of (yappOrigin | yappCenter) and (yappCoordBox | yappCoordPCB) and (yappAltOrigin |yappGlobalOrigin)
|
||||
[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
,[25,15, 20, 12, 2, yappRoundedRect, yappCenter, yappCoordPCB, yappAltOrigin]
|
||||
,[25,15, 20, 12, 2, yappRoundedRect, yappCenter, yappAltOrigin]
|
||||
,[25,15, 20, 14, 2, yappRoundedRect]
|
||||
,[25,15, 20, 14, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 16, 2, yappRoundedRect, yappCoordPCB, yappAltOrigin]
|
||||
,[25,15, 20, 16, 2, yappRoundedRect, yappAltOrigin]
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
// All 4 Coordinate combinations of (yappOrigin | yappCenter) and (yappCoordBox | yappCoordPCB)
|
||||
[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// All 8 Coordinate combinations
|
||||
[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB, yappAltOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappAltOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB, yappAltOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappAltOrigin]
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, n
|
||||
// All 4 Coordinate combinations of (yappOrigin | yappCenter) and (yappCoordBox | yappCoordPCB)
|
||||
[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
// All 8 Coordinate combinations
|
||||
[25,15, 20, 10, 2, yappRoundedRect, yappCenter]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappCoordPCB, yappAltOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCenter, yappAltOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappCoordPCB, yappAltOrigin]
|
||||
,[25,15, 20, 10, 2, yappRoundedRect, yappAltOrigin]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
289
case/YAPP_Box/examples/YAPP_Demo_cutouts_v30.scad
Normal file
289
case/YAPP_Box/examples/YAPP_Demo_cutouts_v30.scad
Normal file
@@ -0,0 +1,289 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (03-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 41;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.25;
|
||||
lidPlaneThickness = 1.25;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 8;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 6; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 2;
|
||||
shiftLid = 5;
|
||||
colorLid = "gray";
|
||||
alphaLid = 1;//0.2;
|
||||
colorBase = "yellow";
|
||||
alphaBase = 1;//0.2;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = true;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands = [
|
||||
//[5, 5, yappHole]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
// n(g) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
// n(h) = { yappFromInside } Make the cut from the inside towards the outside
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, n
|
||||
// [120, 40, 30, 30, 10, yappPolygon, shape6ptStar]
|
||||
// ,[ 60, 55, 50, 50, 10, yappPolygon, shapeHexagon, [maskHoneycomb,0,3.3], yappCenter]
|
||||
//-- Test
|
||||
// ,[115, 95, 20, 30, 10, yappCircle, 10] //--> [D(b)] OK!
|
||||
// ,[140, 90, 20, 30, 1, yappRectangle, 10] //--> [E(b)] OK!
|
||||
// ,[165, 90, 20, 30, 3, yappRoundedRect, 10] //--> [F(b)] OK!
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, n
|
||||
// [ 25, 70, 15, 25, 0, yappRectangle, undef, 30, yappCenter]
|
||||
// ,[ 25, 30, 15, 25, 0, yappRectangle, yappCenter]
|
||||
// ,[ 50, 70, 15, 25, 5, yappRoundedRect, undef, 30, yappCenter]
|
||||
// ,[ 50, 30, 15, 25, 5, yappRoundedRect, yappCenter]
|
||||
// ,[ 75, 30, 0, 0, 8, yappCircle, yappCenter]
|
||||
// ,[100, 70, 12, 0, 8, yappCircleWithFlats, undef, 30, yappCenter]
|
||||
// ,[100, 30, 12, 0, 8, yappCircleWithFlats, yappCenter]
|
||||
// ,[125, 70, 4, 5, 8, yappCircleWithKey, undef, 30, yappCenter]
|
||||
// ,[125, 30, 4, 5, 8, yappCircleWithKey, yappCenter]
|
||||
// ,[160, 30, 30, 30, 8, yappPolygon,
|
||||
// [yappPolygonDef,[
|
||||
// [-0.50,0],[-0.25,+0.433012],[+0.45,-0.433012],[-0.25,-0.433012]]
|
||||
|
||||
// ], yappCenter]
|
||||
// ,[160, 65, 30, 30, 10, yappPolygon, shape6ptStar, yappCenter]
|
||||
//-- buggy
|
||||
// ,[165, 90, 20, 30, 3, yappRoundedRect, 10] //--> [G(L)] BUG!
|
||||
// ,[140, 90, 20, 30, 1, yappRectangle, 10] //--> [H(L)] BUG!
|
||||
// ,[115, 95, 20, 30, 10, yappCircle, 10] //--> [J(L)] BUG!
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
// [20, 11, 15, 25, 3, yappRoundedRect]
|
||||
// ,[ 30, 40, 25, 15, 3, yappRoundedRect, 10] //--> OK
|
||||
// ,[40, 11, 15, 25, 10, yappCircle]
|
||||
// ,[70, 4, 15, 17, 10, yappCircleWithFlats]
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// [20, 40, 25, 15, 3, yappRoundedRect, 20] //--> Bug!
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5,6,7,n
|
||||
[ 30, 0, 0, 0, 2, yappCircle, 5, yappCenter],
|
||||
[ 35, 0, 0, 0, 2, yappCircle, 5, yappCenter, yappFromInside],
|
||||
// [ 30, 0, 25, 15, 3, yappRoundedRect, 10] //--> OK
|
||||
// [160, 35, 4, 3, 6, yappCircleWithKey, 0, 90, yappCenter],
|
||||
// [ 90, 15, 30, 10, 0, yappRectangle, maskBars, yappCenter],
|
||||
// [ 90, 35, 30, 10, 0, yappRectangle, maskBars, yappCenter],
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
// [90, 5, 20, 15, 4, yappRoundedRect]
|
||||
// ,[15, -5, 20, 15, 10, yappCircle, 15] //--> [A(r)] OK
|
||||
// ,[40, -5, 20, 15, 5, yappRoundedRect, 15] //--> [B(r)]OK
|
||||
// ,[65, -5, 20, 15, 0, yappRectangle, 15] //--> [C(r)] OK
|
||||
// ,[65, 40, 20, 15, 0, yappRectangle, 15] //--> [K(b)] OK
|
||||
// ,[40, 40, 20, 15, 5, yappRoundedRect, 15] //--> [M(b)] OK
|
||||
// ,[15, 40, 20, 15, 10, yappCircle, 15] //--> [N(b)] OK
|
||||
];
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappSymmetric }
|
||||
// (n) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[(shellWidth/2)-40, 10, yappFront, yappCenter, yappSymmetric]
|
||||
,[25, 10, yappBack, yappSymmetric, yappCenter, yappRectangle]
|
||||
,[(shellLength/2)-60, 10, yappLeft, yappRight, yappCenter, yappRectangle, yappSymmetric]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
191
case/YAPP_Box/examples/YAPP_Demo_imagesPlane_v3.scad
Normal file
191
case/YAPP_Box/examples/YAPP_Demo_imagesPlane_v3.scad
Normal file
@@ -0,0 +1,191 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.1.2 (2024-04-16)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// For many/complex cutoutGrills, you might need to adjust
|
||||
// the max number of elements in OpenSCAD:
|
||||
//
|
||||
// Preferences->Advanced->Turn off rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte refers to Y axis,
|
||||
// height/hoogte refers to Z axis
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
printDisplayClips = true;
|
||||
|
||||
// ********************************************************************
|
||||
// The Following will be used as the first element in the pbc array
|
||||
|
||||
//Defined here so you can define the "Main" PCB using these if wanted
|
||||
pcbLength = 150; // front to back (X axis)
|
||||
pcbWidth = 100; // side to side (Y axis)
|
||||
pcbThickness = 1.6;
|
||||
standoffHeight = 1.0; //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
//===================================================================
|
||||
// *** PCBs ***
|
||||
// Printed Circuit Boards
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : yappCoordBoxInside[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = name
|
||||
// p(1) = length
|
||||
// p(2) = width
|
||||
// p(3) = posx
|
||||
// p(4) = posy
|
||||
// p(5) = Thickness
|
||||
// p(6) = standoff_Height
|
||||
// p(7) = standoff_Diameter
|
||||
// p(8) = standoff_PinDiameter
|
||||
// Optional:
|
||||
// p(9) = standoff_HoleSlack (default to 0.4)
|
||||
|
||||
//The following can be used to get PCB values elsewhere in the script - not in pcb definition.
|
||||
//If "PCB Name" is omitted then "Main" is used
|
||||
// pcbLength --> pcbLength("PCB Name")
|
||||
// pcbWidth --> pcbWidth("PCB Name")
|
||||
// pcbThickness --> pcbThickness("PCB Name")
|
||||
// standoffHeight --> standoffHeight("PCB Name")
|
||||
// standoffDiameter --> standoffDiameter("PCB Name")
|
||||
// standoffPinDiameter --> standoffPinDiameter("PCB Name")
|
||||
// standoffHoleSlack --> standoffHoleSlack("PCB Name")
|
||||
|
||||
pcb =
|
||||
[
|
||||
// Default Main PCB - DO NOT REMOVE the "Main" line.
|
||||
["Main", pcbLength,pcbWidth, 0,0, pcbThickness, standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]
|
||||
];
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 2;
|
||||
paddingBack = 2;
|
||||
paddingRight = 2;
|
||||
paddingLeft = 2;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 3.0;
|
||||
|
||||
|
||||
// Set the layer height of your printer
|
||||
printerLayerHeight = 0.2;
|
||||
|
||||
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
// -- Render --
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
|
||||
// --Preview --
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
showSideBySide = true; //-> Default = true
|
||||
onLidGap = 0; // tip don't override to animate the lid opening
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> Remove the walls from the lid : only if preview and showSideBySide=true
|
||||
hideBaseWalls = false; //-> Remove the walls from the base : only if preview and showSideBySide=true
|
||||
showOrientation = true; //-> Show the Front/Back/Left/Right labels : only in preview
|
||||
showPCB = false; //-> Show the PCB in red : only in preview
|
||||
showSwitches = false; //-> Show the switches (for pushbuttons) : only in preview
|
||||
showButtonsDepressed = false; //-> Should the buttons in the Lid On view be in the pressed position
|
||||
showOriginCoordBox = false; //-> Shows red bars representing the origin for yappCoordBox : only in preview
|
||||
showOriginCoordBoxInside = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showOriginCoordPCB = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showMarkersPCB = false; //-> Shows black bars corners of the PCB : only in preview
|
||||
showMarkersCenter = false; //-> Shows magenta bars along the centers of all faces
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromBottom = true; //-> View from the inspection cut up
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
|
||||
//===================================================================
|
||||
// *** Images ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// p(0) = posx
|
||||
// p(1) = posy/z
|
||||
// p(2) = rotation degrees CCW
|
||||
// p(3) = depth : positive values go into case (Remove) negative values are raised (Add)
|
||||
// p(4) = { yappLeft, yappRight, yappFront, yappBack, yappLid, yappBase } : plane
|
||||
// p(5) = "image filename.svg"
|
||||
// Optional:
|
||||
// p(6) = Scale : Default = 1 : ratio to scale image by (making it larger or smaller)
|
||||
//-------------------------------------------------------------------
|
||||
imagesPlane =
|
||||
[
|
||||
[ 40, 40, 0, 1, yappLid, "openscad-svgrepo-com.svg", 0.2 ]
|
||||
];
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
295
case/YAPP_Box/examples/YAPP_Demo_lightTubes_v30.scad
Normal file
295
case/YAPP_Box/examples/YAPP_Demo_lightTubes_v30.scad
Normal file
@@ -0,0 +1,295 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for test with lightTube
|
||||
//
|
||||
// Rendering takes ~ 11 minutes (renderQuality 10)
|
||||
// Rendering takes ~ 5 minutes (renderQuality 5)
|
||||
//
|
||||
// Version 3.0 (29-11-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 30;
|
||||
pcbWidth = 40;
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 2;
|
||||
paddingRight = 3;
|
||||
paddingLeft = 4;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.0;
|
||||
lidPlaneThickness = 1.0;
|
||||
|
||||
//-- Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
//-- + baseWallHeight + lidWallHeight
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 8;
|
||||
lidWallHeight = 13;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.6;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 7.0;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 7;
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 5; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 0.8;//0.2;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 0.8;//0.2;
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Base)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = true; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
//-------------------------------------------------------------------
|
||||
// Start of Debugging config (used if not overridden in template)
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
// Optional:
|
||||
// (2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// (3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// (4) = standoffDiameter Default = standoffDiameter;
|
||||
// (5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// (6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// (7) = filletRadius (0 = auto size)
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// (n) = { yappHole, <yappPin> } // Baseplate support treatment
|
||||
// (n) = { <yappAllCorners> | yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// (n) = { yappCoordBox, <yappCoordPCB> }
|
||||
// (n) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
// 0, 1,
|
||||
[5, 5, yappBaseOnly, yappFrontLeft, yappBackRight]
|
||||
, [5, 5, yappBoth, yappBackLeft, yappFrontRight]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase, cutoutsLid, cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top, Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsBase =
|
||||
[
|
||||
[shellLength/2,shellWidth/2 ,15,15, 5, yappPolygon ,0 ,30, yappCenter, shapeHexagon, maskHexCircles]
|
||||
];
|
||||
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsFront =
|
||||
[
|
||||
// 0, 1, 2, 3, 4, 5
|
||||
[5, 2, shellWidth-10, shellHeight-4, 2, yappRoundedRect, yappCoordBox]
|
||||
];
|
||||
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsBack =
|
||||
[
|
||||
[3, 2, shellWidth-6, shellHeight-4, 3, yappRoundedRect, yappCoordBox]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappSymmetric }
|
||||
// (n) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[(shellLength/2)-10, 3, yappLeft, yappCenter, yappSymmetric]
|
||||
,[(shellLength/2)-8, 3, yappRight, yappCenter, yappSymmetric, yappRectangle]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.
|
||||
// Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter
|
||||
// (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of
|
||||
// the left of the opening
|
||||
// n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
[(shellLength/2), 3, 6, 2.5, yappLeft, yappRight, yappCenter]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Light Tubes ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB: PCB[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = tubeLength
|
||||
// p(3) = tubeWidth
|
||||
// p(4) = tubeWall
|
||||
// p(5) = gapAbovePcb
|
||||
// p(6) = tubeType {yappCircle|yappRectangle}
|
||||
// Optional:
|
||||
// p(7) = lensThickness (how much to leave on the top of the lid for the
|
||||
// light to shine through 0 for open hole : Default = 0/Open
|
||||
// p(8) = Height to top of PCB : Default = standoffHeight+pcbThickness
|
||||
// p(9) = filletRadius : Default = 0/Auto
|
||||
// n(a) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(b) = { <yappGlobalOrigin>, yappLeftOrigin }
|
||||
// n(c) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
lightTubes =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5, 6/7
|
||||
[15, 10, 5, 6, 1, 0.1, yappCircle]
|
||||
,[15, 30, 1.5, 5, 1, 0.1, yappRectangle, .5]
|
||||
];
|
||||
|
||||
|
||||
|
||||
//========= MAIN CALL's ===========================================================
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
339
case/YAPP_Box/examples/YAPP_HookTest_v30.scad
Normal file
339
case/YAPP_Box/examples/YAPP_HookTest_v30.scad
Normal file
@@ -0,0 +1,339 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 4.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
// + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 25;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
// or 1.8x wallThickness if using snaps
|
||||
ridgeHeight = 10.0;
|
||||
ridgeSlack = 0.2;
|
||||
|
||||
//-- Radius of the shell corners
|
||||
roundRadius = 3;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used for PCB Supports, Push Button and showPCB
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 12;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.
|
||||
// (n) = { <yappCoordBox> | yappCoordPCB }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly } : What part of the shell to cut (only affects Left/Right/Front/Back
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[25,ridgeExtTop-10-3, 0, 0, 3, yappCircle]
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = pos
|
||||
// (1) = width
|
||||
// (2) = height : Distance below the ridge : Negative to move into lid
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// Note: use ridgeExtTop to reference the top of the extension for cutouts.
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtFront =
|
||||
[
|
||||
[85, 6, ridgeHeight]
|
||||
|
||||
// Make a ridge extension 6mm wide in the middle of the ridge
|
||||
,[95, 6, 5]
|
||||
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
,[25, 6, 10]
|
||||
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 20, 15]
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
ridgeExtLeft =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// (0) = posx
|
||||
// (1) = posy/z
|
||||
// (2) = rotation degrees CCW
|
||||
// (3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// (4) = plane {yappLeft | yappRight | yappFront | yappBack | yappTop | yappBottom}
|
||||
// (5) = font
|
||||
// (6) = size
|
||||
// (7) = "label text"
|
||||
//-------------------------------------------------------------------
|
||||
labelsPlane =
|
||||
[
|
||||
|
||||
];
|
||||
//========= HOOK functions ============================
|
||||
|
||||
// Hook functions allow you to add 3d objects to the case.
|
||||
// Lid/Base = Shell part to attach the object to.
|
||||
// Inside/Outside = Join the object from the midpoint of the shell to the inside/outside.
|
||||
// Pre = Attach the object Pre before doing Cutouts/Stands/Connectors.
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookLidInsidePre()
|
||||
{
|
||||
echo("hookLidInsidePre() ..");
|
||||
translate([shellInsideLength, shellInsideWidth, 0]) sphere(20);
|
||||
} // hookLidInsidePre()
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookLidInside()
|
||||
{
|
||||
echo("hookLidInside() ..");
|
||||
sphere(20);
|
||||
} // hookLidInside()
|
||||
|
||||
//===========================================================
|
||||
//===========================================================
|
||||
// origin = box(0,0,shellHeight)
|
||||
module hookLidOutsidePre()
|
||||
{
|
||||
echo("hookLidOutsidePre() ..");
|
||||
translate([shellInsideLength, shellInsideWidth, 0]) sphere(20);
|
||||
} // hookLidOutsidePre()
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,shellHeight)
|
||||
module hookLidOutside()
|
||||
{
|
||||
echo("hookLidOutside() ..");
|
||||
sphere(20);
|
||||
} // hookLidOutside()
|
||||
|
||||
//===========================================================
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseInsidePre()
|
||||
{
|
||||
echo("hookBaseInsidePre() ..");
|
||||
} // hookBaseInsidePre()
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseInside()
|
||||
{
|
||||
echo("hookBaseInside() ..");
|
||||
sphere(20);
|
||||
} // hookBaseInside()
|
||||
|
||||
//===========================================================
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseOutsidePre()
|
||||
{
|
||||
echo("hookBaseOutsidePre() ..");
|
||||
} // hookBaseOutsidePre()
|
||||
|
||||
//===========================================================
|
||||
// origin = box(0,0,0)
|
||||
module hookBaseOutside()
|
||||
{
|
||||
echo("hookBaseOutside() ..");
|
||||
sphere(20);
|
||||
} // hookBaseOutside()
|
||||
|
||||
//===========================================================
|
||||
//===========================================================
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
241
case/YAPP_Box/examples/YAPP_Reference_Masks_v30.scad
Normal file
241
case/YAPP_Box/examples/YAPP_Reference_Masks_v30.scad
Normal file
@@ -0,0 +1,241 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (03-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 250; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 2.0;
|
||||
lidPlaneThickness = 2.0;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 25;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 1.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 8;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 6; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 2;
|
||||
shiftLid = 5;
|
||||
colorLid = "gray";
|
||||
alphaLid = 1;//0.2;
|
||||
colorBase = "gray";
|
||||
alphaBase = 1;//0.2;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappAltOrigin } // Only affects Bottom(base), Back and Right Faces
|
||||
// n(g) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
// n(h) = { yappFromInside } Make the cut from the inside towards the outside
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
[10,10,5,5,undef,yappRectangle,yappCenter]
|
||||
,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin]
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
[10,10,5,5,undef,yappRectangle,yappCenter]
|
||||
,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin]
|
||||
|
||||
/*
|
||||
[25, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskHoneycomb]
|
||||
,[50, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskHexCircles]
|
||||
,[75, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskCircles]
|
||||
,[100, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskBars]
|
||||
,[125, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskOffsetBars]
|
||||
,[150, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter, maskSquares]
|
||||
// ,[175, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
*/
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
[10,10,5,5,undef,yappRectangle,yappCenter]
|
||||
,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin]
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
[10,10,5,5,undef,yappRectangle,yappCenter]
|
||||
,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin]
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
[10,10,5,5,undef,yappRectangle,yappCenter]
|
||||
,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin]
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
[10,10,5,5,undef,yappRectangle,yappCenter]
|
||||
,[10,10,undef,undef,2.5,yappCircle,yappCenter, yappAltOrigin]
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.
|
||||
// Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter
|
||||
// (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of
|
||||
// the left of the opening
|
||||
// n(e) = { <yappGlobalOrigin>, yappAltOrigin } : Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
// [20, 6, 6, 3, yappLeft]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
269
case/YAPP_Box/examples/YAPP_Reference_Shapes_v30.scad
Normal file
269
case/YAPP_Box/examples/YAPP_Reference_Shapes_v30.scad
Normal file
@@ -0,0 +1,269 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (03-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 250; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.25;
|
||||
lidPlaneThickness = 1.25;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 8;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 6; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 2;
|
||||
shiftLid = 5;
|
||||
colorLid = "gray";
|
||||
alphaLid = 1;//0.2;
|
||||
colorBase = "yellow";
|
||||
alphaBase = 1;//0.2;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
// n(g) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
// n(h) = { yappFromInside } Make the cut from the inside towards the outside
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
|
||||
//yappCenter demo
|
||||
/*
|
||||
[10, 10, 10, 20, undef, yappRectangle] //(A)
|
||||
,[10, 50, 10, 20, undef, yappRectangle, yappCenter] //(B)
|
||||
|
||||
,[30, 10, undef, undef, 5, yappCircle, ] //(C)
|
||||
,[30, 50, undef, undef, 5, yappCircle, yappCenter] //(D)
|
||||
|
||||
,[50, 10, 10, 20, 2, yappRoundedRect, ] //(E)
|
||||
,[50, 50, 10, 20, 2, yappRoundedRect, yappCenter] //(F)
|
||||
|
||||
,[70, 10, 15, undef, 10, yappCircleWithFlats, ] //(G)
|
||||
,[70, 50, 15, undef, 10, yappCircleWithFlats, yappCenter] //(H)
|
||||
|
||||
,[90, 10, 5, 2, 8, yappCircleWithKey, ] //(I)
|
||||
,[90, 50, 5, 2, 8, yappCircleWithKey, yappCenter] //(J)
|
||||
|
||||
,[110, 10, 20, 20, undef, yappPolygon, shape6ptStar] //(K)
|
||||
,[110, 50, 20, 20, undef, yappPolygon, shape6ptStar, yappCenter] //(L)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// [0, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
[25, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[50, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[75, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[100, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[125, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[150, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[175, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
//,[200, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
|
||||
,[25, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeIsoTriangle, yappCenter]
|
||||
,[50, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeIsoTriangle2, yappCenter]
|
||||
,[75, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeHexagon, yappCenter]
|
||||
,[100, 40, 20, 20, undef, yappPolygon, undef, $t*360, shape6ptStar, yappCenter]
|
||||
,[125, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeTriangle, yappCenter]
|
||||
,[150, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeTriangle2, yappCenter]
|
||||
,[175, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeArrow, yappCenter]
|
||||
//,[200, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeArrow2, yappCenter]
|
||||
|
||||
// Mask Demo
|
||||
// ,[ 160, 55, 50, 50, 10, yappRectangle, 1, shapeHexagon, [maskHoneycomb,0,0,0], yappCenter, yappFromInside]
|
||||
// ,[ 160, 55, 50, 50, 10, yappRectangle, 1, shapeHexagon, [maskHoneycomb,0,0,0], yappCenter, yappFromInside]
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5,6,7,n
|
||||
// [ 30, 3, 25, 15, 3, yappRoundedRect, 1]
|
||||
// ,[ 60, 3, 25, 15, 3, yappRoundedRect, 1, yappFromInside]
|
||||
// ,[ 20, 1, 5, 5, 1, yappRoundedRect, 5, yappFromInside, yappCoordBox] // Cuts out into mounting tab
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.
|
||||
// Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter
|
||||
// (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of
|
||||
// the left of the opening
|
||||
// n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
// [20, 6, 6, 3, yappLeft]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
381
case/YAPP_Box/examples/YAPP_RidgeExtDemo_v30.scad
Normal file
381
case/YAPP_Box/examples/YAPP_RidgeExtDemo_v30.scad
Normal file
@@ -0,0 +1,381 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 4.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
// + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 25;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
// or 1.8x wallThickness if using snaps
|
||||
ridgeHeight = 10.0;
|
||||
ridgeSlack = 0.2;
|
||||
|
||||
//-- Radius of the shell corners
|
||||
roundRadius = 3;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used for PCB Supports, Push Button and showPCB
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 12;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.
|
||||
// (n) = { yappCoordBox | <yappCoordPCB> }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly } : What part of the shell to cut (only affects Left/Right/Front/Back
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
// This can only have a cable put through it after the case is assembled
|
||||
// This could be used as a locking pin
|
||||
[75,(ridgeHeight/2), 0, 0, 1, yappCircle, yappCenter]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[85,ridgeHeight-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// In the Middle of the Ridge
|
||||
,[95+3,(ridgeHeight/2), 0, 0, 2.5, yappCircle, yappCenter]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[45, 15-3, 20, 6, 3, yappRoundedRect]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38, 15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[28,8, 0, 0, 3, yappCircle, yappCenter, yappCoordBox]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,8, 6, 6, 0, yappPolygon, shape6ptStar, yappLeftOrigin, yappCenter, yappCoordBox]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[55,13, 20, 6, 3, yappRoundedRect, yappCenter, yappCoordBox]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38,35, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter, yappCoordBox]
|
||||
|
||||
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
// Height = ridgeExtTop - height of the ext - the diameter of the circle
|
||||
[5,10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[15+3,15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[25,15-3, 10, 6, 3, yappRoundedRect]
|
||||
|
||||
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[25,10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,10-3, 6, 6, 0, yappPolygon, shape6ptStar, yappLeftOrigin]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[45,15-3, 20, 6, 3, yappRoundedRect]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38,15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = pos
|
||||
// (1) = width
|
||||
// (2) = height : Distance below the ridge : Negative to move into lid
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappLeftOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// Note: use ridgeExtTop to reference the top of the extension for cutouts.
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtFront =
|
||||
[
|
||||
[85, 6, ridgeHeight]
|
||||
|
||||
// Make a ridge extension 6mm wide in the middle of the ridge
|
||||
,[95, 6, 5]
|
||||
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
,[25, 6, 10]
|
||||
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 20, 15]
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 8mm from the bottom of the box
|
||||
[25, 6, 8, yappCoordBox]
|
||||
|
||||
// Make a ridge extension 6mm wide 8mm from the bottom of the box from the left edge
|
||||
,[25, 6, 8, yappLeftOrigin, yappCoordBox, yappCenter]
|
||||
|
||||
// Make a ridge extension 20mm wide 13mm from the bottom of the box
|
||||
,[45, 20, 13, yappCoordBox]
|
||||
|
||||
// Make a ridge extension 6mm wide 35mm from the bottom of the box
|
||||
,[35, 6, 35, yappCoordBox]
|
||||
];
|
||||
|
||||
ridgeExtLeft =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[5, 6, 10]
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[15, 6, 15]
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[25, 10, 15]
|
||||
|
||||
// Make a row of ridgeExt from 8mm below the PCB to
|
||||
,[ 40, 5, -8]
|
||||
,[ 50, 5, -4]
|
||||
,[ 60, 5, -0]
|
||||
,[ 70, 5, 4]
|
||||
,[ 80, 5, 8]
|
||||
,[ 90, 5, 12]
|
||||
,[100, 5, 16]
|
||||
,[110, 5, 20]
|
||||
,[120, 5, 24]
|
||||
,[130, 5, 28]
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[25, 6, 10]
|
||||
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge from the left edge
|
||||
,[25, 6, 10, yappLeftOrigin]
|
||||
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 20, 15]
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// p(0) = posx
|
||||
// p(1) = posy/z
|
||||
// p(2) = rotation degrees CCW
|
||||
// p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// p(4) = plane {yappLeft | yappRight | yappFront | yappBack | yappLid | yappBase}
|
||||
// p(5) = font
|
||||
// p(6) = size
|
||||
// p(7) = "label text"
|
||||
//-------------------------------------------------------------------
|
||||
labelsPlane =
|
||||
[
|
||||
// [5, 5, 0, 3, yappLid, "Liberation Mono:style=bold", 5, "YAPP Lid" ]
|
||||
// ,[5, 5, 0, 3, yappBase, "Liberation Mono:style=bold", 5, "YAPP Base" ]
|
||||
// ,[5, 5, 0, 3, yappLeft, "Liberation Mono:style=bold", 5, "YAPP Left" ]
|
||||
// ,[5, 5, 0, 3, yappRight, "Liberation Mono:style=bold", 5, "YAPP Right" ]
|
||||
// ,[5, 5, 0, 3, yappFront, "Liberation Mono:style=bold", 5, "YAPP Front" ]
|
||||
// ,[5, 5, 0, 3, yappBack, "Liberation Mono:style=bold", 5, "YAPP Back" ]
|
||||
|
||||
// ,[10, 15, 45, 3, yappLid, "Liberation Mono:style=bold", 5, "YAPP Lid" ]
|
||||
// ,[10, 15, 45, 3, yappBase, "Liberation Mono:style=bold", 5, "YAPP Base" ]
|
||||
// ,[10, 15, 45, 3, yappLeft, "Liberation Mono:style=bold", 5, "YAPP Left" ]
|
||||
// ,[10, 15, 45, 3, yappRight, "Liberation Mono:style=bold", 5, "YAPP Right" ]
|
||||
// ,[10, 15, 45, 3, yappFront, "Liberation Mono:style=bold", 5, "YAPP Front" ]
|
||||
// ,[10, 15, 45, 3, yappBack, "Liberation Mono:style=bold", 5, "YAPP Back" ]
|
||||
|
||||
// ,[35, 5, 0, -2, yappLid, "Liberation Mono:style=bold", 5, "YAPP Lid" ]
|
||||
// ,[35, 5, 0, -2, yappBase, "Liberation Mono:style=bold", 5, "YAPP Base" ]
|
||||
// ,[35, 5, 0, -2, yappLeft, "Liberation Mono:style=bold", 5, "YAPP Left" ]
|
||||
// ,[35, 5, 0, -2, yappRight, "Liberation Mono:style=bold", 5, "YAPP Right" ]
|
||||
// ,[35, 5, 0, -2, yappFront, "Liberation Mono:style=bold", 5, "YAPP Front" ]
|
||||
// ,[35, 5, 0, -2, yappBack, "Liberation Mono:style=bold", 5, "YAPP Back" ]
|
||||
|
||||
// ,[30, 15, 45, -2, yappLid, "Liberation Mono:style=bold", 5, "YAPP Lid" ]
|
||||
// ,[30, 15, 45, -2, yappBase, "Liberation Mono:style=bold", 5, "YAPP Base" ]
|
||||
// ,[30, 15, 45, -2, yappLeft, "Liberation Mono:style=bold", 5, "YAPP Left" ]
|
||||
// ,[30, 15, 45, -2, yappRight, "Liberation Mono:style=bold", 5, "YAPP Right" ]
|
||||
// ,[30, 15, 45, -2, yappFront, "Liberation Mono:style=bold", 5, "YAPP Front" ]
|
||||
// ,[30, 15, 45, -2, yappBack, "Liberation Mono:style=bold", 5, "YAPP Back" ]
|
||||
];
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
381
case/YAPP_Box/examples/YAPP_RidgeExtDemo_v31.scad
Normal file
381
case/YAPP_Box/examples/YAPP_RidgeExtDemo_v31.scad
Normal file
@@ -0,0 +1,381 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 4.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
// + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 25;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
// or 1.8x wallThickness if using snaps
|
||||
ridgeHeight = 10.0;
|
||||
ridgeSlack = 0.2;
|
||||
|
||||
//-- Radius of the shell corners
|
||||
roundRadius = 3;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used for PCB Supports, Push Button and showPCB
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = false; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 12;
|
||||
shiftLid = 5;
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
// +-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be provided
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = from Back
|
||||
// (1) = from Left
|
||||
// (2) = width
|
||||
// (3) = length
|
||||
// (4) = radius
|
||||
// (5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// (6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// (7) = angle : Default = 0
|
||||
// (n) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// (n) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask for the cutout.
|
||||
// (n) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added it will be used as a mask for the cutout. With the Rotation and offsets applied. This can be used to fine tune the mask placement within the opening.
|
||||
// (n) = { yappCoordBox | <yappCoordPCB> }
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappAltOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// (n) = { <yappBoth> | yappLidOnly | yappBaseOnly } : What part of the shell to cut (only affects Left/Right/Front/Back
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
// This can only have a cable put through it after the case is assembled
|
||||
// This could be used as a locking pin
|
||||
[75,(ridgeHeight/2), 0, 0, 1, yappCircle, yappCenter]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[85,ridgeHeight-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// In the Middle of the Ridge
|
||||
,[95+3,(ridgeHeight/2), 0, 0, 2.5, yappCircle, yappCenter]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[45, 15-3, 20, 6, 3, yappRoundedRect]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38, 15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[28,8, 0, 0, 3, yappCircle, yappCenter, yappCoordBox]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,8, 6, 6, 0, yappPolygon, shape6ptStar, yappAltOrigin, yappCenter, yappCoordBox]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[55,13, 20, 6, 3, yappRoundedRect, yappCenter, yappCoordBox]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38,35, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter, yappCoordBox]
|
||||
|
||||
|
||||
];
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
// Height = ridgeExtTop - height of the ext - the diameter of the circle
|
||||
[5,10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[15+3,15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[25,15-3, 10, 6, 3, yappRoundedRect]
|
||||
|
||||
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
[25,10-3, 0, 0, 3, yappCircle]
|
||||
|
||||
// Make the hole thru the end of the ridge extansion
|
||||
,[25,10-3, 6, 6, 0, yappPolygon, shape6ptStar, yappAltOrigin]
|
||||
|
||||
// Make the rounded rect thru the end of the ridge extansion
|
||||
,[45,15-3, 20, 6, 3, yappRoundedRect]
|
||||
|
||||
// Make the hexagonal thru the end of the ridge extansion
|
||||
,[38,15, 6, 6, 0, yappPolygon, 0, 30, shapeHexagon, yappCenter]
|
||||
|
||||
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Ridge Extension ***
|
||||
// Extension from the lid into the case for adding split opening at various heights
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = pos
|
||||
// (1) = width
|
||||
// (2) = height : Distance below the ridge : Negative to move into lid
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin>, yappCenter }
|
||||
// (n) = { yappAltOrigin, <yappGlobalOrigin> } // Only affects Top(lid), Back and Right Faces
|
||||
|
||||
// Note: use ridgeExtTop to reference the top of the extension for cutouts.
|
||||
// Note: Snaps should not be placed on ridge extensions as they remove the ridge to place them.
|
||||
//-------------------------------------------------------------------
|
||||
ridgeExtFront =
|
||||
[
|
||||
[85, 6, ridgeHeight]
|
||||
|
||||
// Make a ridge extension 6mm wide in the middle of the ridge
|
||||
,[95, 6, 5]
|
||||
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
,[25, 6, 10]
|
||||
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 20, 15]
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
];
|
||||
|
||||
ridgeExtBack =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 8mm from the bottom of the box
|
||||
[25, 6, 8, yappCoordBox]
|
||||
|
||||
// Make a ridge extension 6mm wide 8mm from the bottom of the box from the left edge
|
||||
,[25, 6, 8, yappAltOrigin, yappCoordBox, yappCenter]
|
||||
|
||||
// Make a ridge extension 20mm wide 13mm from the bottom of the box
|
||||
,[45, 20, 13, yappCoordBox]
|
||||
|
||||
// Make a ridge extension 6mm wide 35mm from the bottom of the box
|
||||
,[35, 6, 35, yappCoordBox]
|
||||
];
|
||||
|
||||
ridgeExtLeft =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[5, 6, 10]
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[15, 6, 15]
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[25, 10, 15]
|
||||
|
||||
// Make a row of ridgeExt from 8mm below the PCB to
|
||||
,[ 40, 5, -8]
|
||||
,[ 50, 5, -4]
|
||||
,[ 60, 5, -0]
|
||||
,[ 70, 5, 4]
|
||||
,[ 80, 5, 8]
|
||||
,[ 90, 5, 12]
|
||||
,[100, 5, 16]
|
||||
,[110, 5, 20]
|
||||
,[120, 5, 24]
|
||||
,[130, 5, 28]
|
||||
];
|
||||
|
||||
ridgeExtRight =
|
||||
[
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge
|
||||
[25, 6, 10]
|
||||
|
||||
// Make a ridge extension 6mm wide 10mm below the top of the ridge from the left edge
|
||||
,[25, 6, 10, yappAltOrigin]
|
||||
|
||||
// Make a ridge extension 20mm wide 15mm below the top of the ridge
|
||||
,[45, 20, 15]
|
||||
|
||||
// Make a ridge extension 6mm wide 15mm below the top of the ridge
|
||||
,[35, 6, 15]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Labels ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// p(0) = posx
|
||||
// p(1) = posy/z
|
||||
// p(2) = rotation degrees CCW
|
||||
// p(3) = depth : positive values go into case (Remove) negative valies are raised (Add)
|
||||
// p(4) = plane {yappLeft | yappRight | yappFront | yappBack | yappLid | yappBase}
|
||||
// p(5) = font
|
||||
// p(6) = size
|
||||
// p(7) = "label text"
|
||||
//-------------------------------------------------------------------
|
||||
labelsPlane =
|
||||
[
|
||||
// [5, 5, 0, 3, yappLid, "Liberation Mono:style=bold", 5, "YAPP Lid" ]
|
||||
// ,[5, 5, 0, 3, yappBase, "Liberation Mono:style=bold", 5, "YAPP Base" ]
|
||||
// ,[5, 5, 0, 3, yappLeft, "Liberation Mono:style=bold", 5, "YAPP Left" ]
|
||||
// ,[5, 5, 0, 3, yappRight, "Liberation Mono:style=bold", 5, "YAPP Right" ]
|
||||
// ,[5, 5, 0, 3, yappFront, "Liberation Mono:style=bold", 5, "YAPP Front" ]
|
||||
// ,[5, 5, 0, 3, yappBack, "Liberation Mono:style=bold", 5, "YAPP Back" ]
|
||||
|
||||
// ,[10, 15, 45, 3, yappLid, "Liberation Mono:style=bold", 5, "YAPP Lid" ]
|
||||
// ,[10, 15, 45, 3, yappBase, "Liberation Mono:style=bold", 5, "YAPP Base" ]
|
||||
// ,[10, 15, 45, 3, yappLeft, "Liberation Mono:style=bold", 5, "YAPP Left" ]
|
||||
// ,[10, 15, 45, 3, yappRight, "Liberation Mono:style=bold", 5, "YAPP Right" ]
|
||||
// ,[10, 15, 45, 3, yappFront, "Liberation Mono:style=bold", 5, "YAPP Front" ]
|
||||
// ,[10, 15, 45, 3, yappBack, "Liberation Mono:style=bold", 5, "YAPP Back" ]
|
||||
|
||||
// ,[35, 5, 0, -2, yappLid, "Liberation Mono:style=bold", 5, "YAPP Lid" ]
|
||||
// ,[35, 5, 0, -2, yappBase, "Liberation Mono:style=bold", 5, "YAPP Base" ]
|
||||
// ,[35, 5, 0, -2, yappLeft, "Liberation Mono:style=bold", 5, "YAPP Left" ]
|
||||
// ,[35, 5, 0, -2, yappRight, "Liberation Mono:style=bold", 5, "YAPP Right" ]
|
||||
// ,[35, 5, 0, -2, yappFront, "Liberation Mono:style=bold", 5, "YAPP Front" ]
|
||||
// ,[35, 5, 0, -2, yappBack, "Liberation Mono:style=bold", 5, "YAPP Back" ]
|
||||
|
||||
// ,[30, 15, 45, -2, yappLid, "Liberation Mono:style=bold", 5, "YAPP Lid" ]
|
||||
// ,[30, 15, 45, -2, yappBase, "Liberation Mono:style=bold", 5, "YAPP Base" ]
|
||||
// ,[30, 15, 45, -2, yappLeft, "Liberation Mono:style=bold", 5, "YAPP Left" ]
|
||||
// ,[30, 15, 45, -2, yappRight, "Liberation Mono:style=bold", 5, "YAPP Right" ]
|
||||
// ,[30, 15, 45, -2, yappFront, "Liberation Mono:style=bold", 5, "YAPP Front" ]
|
||||
// ,[30, 15, 45, -2, yappBack, "Liberation Mono:style=bold", 5, "YAPP Back" ]
|
||||
];
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
155
case/YAPP_Box/examples/YAPP_Test_SnapJoints_v30.scad
Normal file
155
case/YAPP_Box/examples/YAPP_Test_SnapJoints_v30.scad
Normal file
@@ -0,0 +1,155 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (01-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = true;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.5;
|
||||
lidPlaneThickness = 1.5;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
// + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
// or 2.5x wallThickness if using snaps
|
||||
ridgeHeight = 3.6;
|
||||
ridgeSlack = 0.2;
|
||||
|
||||
//-- Radius of the shell corners
|
||||
roundRadius = 3;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used for PCB Supports, Push Button and showPCB
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 0;
|
||||
shiftLid = 5;
|
||||
colorLid = "gray";
|
||||
alphaLid = 0.9; // 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 0.9; // 1;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// (0) = posx | posy
|
||||
// (1) = width
|
||||
// (n) = yappLeft / yappRight / yappFront / yappBack (one or more)
|
||||
// Optional:
|
||||
// (n) = { <yappOrigin> | yappCenter }
|
||||
// (n) = { yappSymmetric }
|
||||
// (n) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
// Test all combinations of yappCenter & yappRectangle
|
||||
[(shellWidth/2)-10, 5, yappFront, yappBack, yappCenter, yappSymmetric]
|
||||
,[(shellLength/2)-10, 5, yappLeft, yappRight, yappCenter, yappSymmetric]
|
||||
|
||||
,[(shellWidth/2)-20, 5, yappFront, yappBack, yappSymmetric]
|
||||
,[(shellLength/2)-20, 5, yappLeft, yappRight, yappSymmetric]
|
||||
|
||||
,[(shellWidth/2)-30, 5, yappFront, yappBack, yappCenter, yappSymmetric, yappRectangle]
|
||||
,[(shellLength/2)-30, 5, yappLeft, yappRight, yappCenter, yappSymmetric, yappRectangle]
|
||||
|
||||
,[(shellWidth/2)-40, 5, yappFront, yappBack, yappSymmetric, yappRectangle]
|
||||
,[(shellLength/2)-40, 5, yappLeft, yappRight, yappSymmetric, yappRectangle]
|
||||
|
||||
];
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
40
case/YAPP_Box/examples/YAPP_ViewShapes_v30.scad
Normal file
40
case/YAPP_Box/examples/YAPP_ViewShapes_v30.scad
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
|
||||
|
||||
if(len(preDefinedShapes) > 0)
|
||||
{
|
||||
for(i=[0:len(preDefinedShapes)-1])
|
||||
{
|
||||
shape=preDefinedShapes[i];
|
||||
translate([10,(i*25)+10,0])
|
||||
{
|
||||
color("red")
|
||||
linear_extrude(1)
|
||||
{
|
||||
|
||||
scale([20,20,1])
|
||||
polygon(shape[1][1]);
|
||||
}
|
||||
|
||||
color("Black")
|
||||
translate([0,0,-0.5])
|
||||
linear_extrude(2)
|
||||
{
|
||||
circle(d=1);
|
||||
}
|
||||
|
||||
color("Black")
|
||||
linear_extrude(1)
|
||||
{
|
||||
translate([15,-5,0])
|
||||
text(shape[0]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
217
case/YAPP_Box/examples/YAPP_WemosD1mini_v30.scad
Normal file
217
case/YAPP_Box/examples/YAPP_WemosD1mini_v30.scad
Normal file
@@ -0,0 +1,217 @@
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// Script to creates a box for a Wemos D1 mini
|
||||
//
|
||||
// Version 1.2 (12-12-2023)
|
||||
//
|
||||
//---------------------------------------------------------
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-as --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
| | v
|
||||
| -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
printLidShell = true;
|
||||
printBaseShell = true;
|
||||
|
||||
// Edit these parameters for your own board dimensions
|
||||
wallThickness = 1.5;
|
||||
basePlaneThickness = 1.0;
|
||||
lidPlaneThickness = 1.0;
|
||||
|
||||
baseWallHeight = 5;
|
||||
lidWallHeight = 3;
|
||||
|
||||
//-- D E B U G -------------------
|
||||
showSideBySide = true;
|
||||
onLidGap = 3;
|
||||
shiftLid = 0;
|
||||
hideLidWalls = false;
|
||||
colorLid = "yellow";
|
||||
hideBaseWalls = false;
|
||||
colorBase = "white";
|
||||
showPCB = false;
|
||||
showMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from front, <0 from back)
|
||||
inspectY = 0; //-> 0=none (>0 from left, <0 from right)
|
||||
//-- D E B U G -------------------
|
||||
|
||||
// Total height of box = basePlaneThickness + lidPlaneThickness
|
||||
// + baseWallHeight + lidWallHeight
|
||||
pcbLength = 35.0;
|
||||
pcbWidth = 26.0;
|
||||
pcbThickness = 1.0;
|
||||
|
||||
// padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1.5;
|
||||
paddingLeft = 1.5;
|
||||
|
||||
// ridge where base and lid off box can overlap
|
||||
// Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 3.5;
|
||||
ridgeSlack = 0.1;
|
||||
roundRadius = 1.0;
|
||||
|
||||
// How much the PCB needs to be raised from the base
|
||||
// to leave room for solderings and whatnot
|
||||
standoffHeight = 2.0;
|
||||
pinDiameter = 1.8;
|
||||
pinHoleSlack = 0.1;
|
||||
standoffDiameter = 4;
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// Optional:
|
||||
// p(2) = Height to bottom of PCB : Default = standoffHeight
|
||||
// p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcbThickness, yappCoordBox=0
|
||||
// p(4) = standoffDiameter Default = standoffDiameter;
|
||||
// p(5) = standoffPinDiameter Default = standoffPinDiameter;
|
||||
// p(6) = standoffHoleSlack Default = standoffHoleSlack;
|
||||
// p(7) = filletRadius (0 = auto size)
|
||||
// n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// n(b) = { <yappPin>, yappHole } // Baseplate support treatment
|
||||
// n(c) = { <yappAllCorners>, yappFrontLeft | yappFrontRight | yappBackLeft | yappBackRight }
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { yappNoFillet }
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[3.6, 3, 2, yappBoth, yappPin, yappBackLeft] // back-left
|
||||
,[3.6, 3.4, 2, yappBoth, yappPin, yappFrontRight] // back-right
|
||||
,[3.6, 7, 2, yappBoth, yappHole, yappFrontLeft] // front-left
|
||||
,[3.6, 3.4, 2, yappBoth, yappHole, yappBackRight] // front-right
|
||||
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : {yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey}
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
cutoutsLid =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5
|
||||
[6, -1, (pcbLength-12), 5, 0, yappRectangle] // left-header
|
||||
,[6, pcbWidth-4, pcbLength-12, 5, 0, yappRectangle] // right-header
|
||||
,[18.7, 8.8, 0, 0, 1, yappCircle] // blue led
|
||||
];
|
||||
|
||||
//-- base plane -- origin is pcb[0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posy
|
||||
cutoutsBase =
|
||||
[
|
||||
[6, -1, (pcbLength-12), 5, 0, yappRectangle] // left-header
|
||||
,[6, pcbWidth-4, pcbLength-12, 5, 0, yappRectangle] // right-header
|
||||
];
|
||||
|
||||
//-- front plane -- origin is pcb[0,0,0]
|
||||
// (0) = posy
|
||||
// (1) = posz
|
||||
cutoutsFront =
|
||||
[
|
||||
[14.0, 1.0, 12.0, 7, 0, yappRectangle, yappCenter] // microUSB
|
||||
];
|
||||
|
||||
//-- left plane -- origin is pcb[0,0,0]
|
||||
// (0) = posx
|
||||
// (1) = posz
|
||||
cutoutsLeft =
|
||||
[
|
||||
[31.0, 0.5, 4.5, 3, 0, yappRectangle, yappCenter] // reset button
|
||||
];
|
||||
|
||||
//===================================================================
|
||||
// *** Snap Joins ***
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx | posy
|
||||
// p(1) = width
|
||||
// p(2) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// Optional:
|
||||
// n(a) = { <yappOrigin>, yappCenter }
|
||||
// n(b) = { yappSymmetric }
|
||||
// n(c) = { yappRectangle } == Make a diamond shape snap
|
||||
//-------------------------------------------------------------------
|
||||
snapJoins =
|
||||
[
|
||||
[shellLength-17, 5, yappLeft]
|
||||
,[shellLength-10, 5, yappRight]
|
||||
,[(shellWidth/2)-2.5, 5, yappBack]
|
||||
];
|
||||
|
||||
|
||||
//--- this is where the magic happens ---
|
||||
YAPPgenerate();
|
||||
107
case/YAPP_Box/examples/YAPP_connectors_v30.scad
Normal file
107
case/YAPP_Box/examples/YAPP_connectors_v30.scad
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
***************************************************************************
|
||||
** Yet Another Parameterised Projectbox generator
|
||||
**
|
||||
** Copyright (c) 2021, 2022, 2023, 2024 Willem Aandewiel
|
||||
**
|
||||
** With help from:
|
||||
** - Keith Hadley (parameterized label depth)
|
||||
** - Oliver Grafe (connectorsPCB)
|
||||
** - Juan Jose Chong (dynamic standoff flange)
|
||||
** - Dan Drum (cleanup code)
|
||||
** - Dave Rosenhauer (fillets and a lot more)
|
||||
**
|
||||
**
|
||||
** for many or complex cutouts you might need to adjust
|
||||
** the number of elements:
|
||||
**
|
||||
** Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
** ^^^^^^
|
||||
**
|
||||
** TERMS OF USE: MIT License. See base offile.
|
||||
***************************************************************************
|
||||
*/
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 150; // Front to back
|
||||
pcbWidth = 150; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
// -- Render --
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
|
||||
// --Preview --
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
showSideBySide = false; //-> Default = true
|
||||
onLidGap = 1; // tip don't override to animate the lid opening
|
||||
//onLidGap = ((ridgeHeight) - (ridgeHeight * abs(($t-0.5)*2)))*2; // tip don't override to animate the lid opening/closing
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; // Remove the walls from the lid : only if preview and showSideBySide=true
|
||||
hideBaseWalls = false; // Remove the walls from the base : only if preview and showSideBySide=true
|
||||
showOrientation = true; // Show the Front/Back/Left/Right labels : only in preview
|
||||
showPCB = false; // Show the PCB in red : only in preview
|
||||
showSwitches = false; // Show the switches (for pushbuttons) : only in preview
|
||||
showButtonsDepressed = false; // Should the buttons in the Lid On view be in the pressed position
|
||||
showOriginCoordBox = false; // Shows red bars representing the origin for yappCoordBox : only in preview
|
||||
showOriginCoordBoxInside = false; // Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showOriginCoordPCB = false; // Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showMarkersPCB = false; // Shows black bars corners of the PCB : only in preview
|
||||
showMarkersCenter = false; // Shows magenta bars along the centers of all faces
|
||||
inspectX = 8; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromBottom = true; //-> View from the inspection cut up
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Connectors ***
|
||||
// Standoffs with hole through base and socket in lid for screw type connections.
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// p(2) = StandHeight : From specified origin
|
||||
// p(3) = screwDiameter
|
||||
// p(4) = screwHeadDiameter (don't forget to add extra for the fillet)
|
||||
// p(5) = insertDiameter
|
||||
// p(6) = outsideDiameter
|
||||
// Optional:
|
||||
// p(7) = insert Depth : default to entire connector
|
||||
// p(8) = PCB Gap : Default if yappCoordPCB then pcbThickness else 0
|
||||
// p(9) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }
|
||||
// n(b) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(c) = { yappNoFillet }
|
||||
// n(d) = { yappCountersink }
|
||||
// n(e) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
// n(f) = { yappThroughLid = changes the screwhole to the lid and the socket to the base}
|
||||
//-------------------------------------------------------------------
|
||||
connectors =
|
||||
[
|
||||
// [ 10, 10, 4, 3, 5, 4, 7, yappAllCorners], // All of the corners of the PCB inset 10,10
|
||||
// [ 8, 8, 4, 3, 5, 4, 7, yappCoordBox], //Defaults to yappBackLeft of yappCoordBox
|
||||
// [ 8-wallThickness, 28, 4, 3, 5, 4, 7, 5, 1.6, yappBackLeft, yappCoordBoxInside], // Shifted so that they all aligh for inspection cut
|
||||
// [ 8-pcbX(), 48, 4, 3, 5, 4, 7, 16, yappBackLeft], // Shifted so that they all aligh for inspection cut
|
||||
[ 8, 68, 14, 3, 5, 4, 7, 6, yappBackLeft, yappCoordBox], // Shifted so that they all aligh for inspection cut
|
||||
[ 8, 38, 14, 3, 5, 4, 7, 6, yappBackLeft, yappCoordBox, yappThroughLid], // Shifted so that they all aligh for inspection cut
|
||||
];
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
269
case/YAPP_Box/examples/YAPP_cutouts_from_inside_v30.scad
Normal file
269
case/YAPP_Box/examples/YAPP_cutouts_from_inside_v30.scad
Normal file
@@ -0,0 +1,269 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0 (03-12-2023)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// You might need to adjust the number of elements:
|
||||
//
|
||||
// Preferences->Advanced->Turn of rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte to Y,
|
||||
// height/hoogte to Z
|
||||
|
||||
/*
|
||||
padding-back>|<---- pcb length ---->|<padding-front
|
||||
RIGHT
|
||||
0 X-ax --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
^ | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B Y | | 0,y x,y | | ^ F
|
||||
A - | | | | | R
|
||||
C a | | | | | pcb width O
|
||||
K x | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
| -5,0 +----------------------+ | ---
|
||||
| | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-ax --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
//-- pcb dimensions -- very important!!!
|
||||
pcbLength = 250; // Front to back
|
||||
pcbWidth = 100; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.0;
|
||||
basePlaneThickness = 1.25;
|
||||
lidPlaneThickness = 1.25;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 25;
|
||||
lidWallHeight = 23;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 2.0;
|
||||
|
||||
//-- How much the PCB needs to be raised from the base
|
||||
//-- to leave room for solderings and whatnot
|
||||
standoffHeight = 10.0; //-- used only for pushButton and showPCB
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
standoffDiameter = 8;
|
||||
|
||||
|
||||
|
||||
//-- C O N T R O L -------------//-> Default ---------
|
||||
showSideBySide = true; //-> true
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
renderQuality = 6; //-> from 1 to 32, Default = 8
|
||||
onLidGap = 2;
|
||||
shiftLid = 5;
|
||||
colorLid = "gray";
|
||||
alphaLid = 1;//0.2;
|
||||
colorBase = "yellow";
|
||||
alphaBase = 1;//0.2;
|
||||
hideLidWalls = false; //-> false
|
||||
hideBaseWalls = false; //-> false
|
||||
showOrientation = true;
|
||||
showPCB = false;
|
||||
showSwitches = false;
|
||||
showPCBmarkers = false;
|
||||
showShellZero = false;
|
||||
showCenterMarkers = false;
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 0; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; // View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromTop = false; //-> View from the inspection cut down
|
||||
//-- C O N T R O L ---------------------------------------
|
||||
|
||||
//===================================================================
|
||||
// *** Cutouts ***
|
||||
// There are 6 cutouts one for each surface:
|
||||
// cutoutsBase (Bottom), cutoutsLid (Top), cutoutsFront, cutoutsBack, cutoutsLeft, cutoutsRight
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Required Not Used Note
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
// yappRectangle | width, length | radius |
|
||||
// yappCircle | radius | width, length |
|
||||
// yappRoundedRect | width, length, radius | |
|
||||
// yappCircleWithFlats | width, radius | length | length=distance between flats
|
||||
// yappCircleWithKey | width, length, radius | | width = key width length=key depth
|
||||
// yappPolygon | width, length | radius | yappPolygonDef object must be
|
||||
// | | | provided
|
||||
//----------------------+-----------------------+---------------+------------------------------------
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = from Back
|
||||
// p(1) = from Left
|
||||
// p(2) = width
|
||||
// p(3) = length
|
||||
// p(4) = radius
|
||||
// p(5) = shape : { yappRectangle | yappCircle | yappPolygon | yappRoundedRect
|
||||
// | yappCircleWithFlats | yappCircleWithKey }
|
||||
// Optional:
|
||||
// p(6) = depth : Default = 0/Auto : 0 = Auto (plane thickness)
|
||||
// p(7) = angle : Default = 0
|
||||
// n(a) = { yappPolygonDef } : Required if shape = yappPolygon specified -
|
||||
// n(b) = { yappMaskDef } : If a yappMaskDef object is added it will be used as a mask
|
||||
// for the cutout.
|
||||
// n(c) = { [yappMaskDef, hOffset, vOffset, rotation] } : If a list for a mask is added
|
||||
// it will be used as a mask for the cutout. With the Rotation
|
||||
// and offsets applied. This can be used to fine tune the mask
|
||||
// placement within the opening.
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { <yappOrigin>, yappCenter }
|
||||
// n(f) = { <yappGlobalOrigin>, yappLeftOrigin } // Only affects Top(lid), Back and Right Faces
|
||||
// n(g) = [yappPCBName, "XXX"] : Specify a PCB. Defaults to [yappPCBName, "Main"]
|
||||
// n(h) = { yappFromInside } Make the cut from the inside towards the outside
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
cutoutsBase =
|
||||
[
|
||||
];
|
||||
|
||||
cutoutsLid =
|
||||
[
|
||||
|
||||
//yappCenter demo
|
||||
/*
|
||||
[10, 10, 10, 20, undef, yappRectangle] //(A)
|
||||
,[10, 50, 10, 20, undef, yappRectangle, yappCenter] //(B)
|
||||
|
||||
,[30, 10, undef, undef, 5, yappCircle, ] //(C)
|
||||
,[30, 50, undef, undef, 5, yappCircle, yappCenter] //(D)
|
||||
|
||||
,[50, 10, 10, 20, 2, yappRoundedRect, ] //(E)
|
||||
,[50, 50, 10, 20, 2, yappRoundedRect, yappCenter] //(F)
|
||||
|
||||
,[70, 10, 15, undef, 10, yappCircleWithFlats, ] //(G)
|
||||
,[70, 50, 15, undef, 10, yappCircleWithFlats, yappCenter] //(H)
|
||||
|
||||
,[90, 10, 5, 2, 8, yappCircleWithKey, ] //(I)
|
||||
,[90, 50, 5, 2, 8, yappCircleWithKey, yappCenter] //(J)
|
||||
|
||||
,[110, 10, 20, 20, undef, yappPolygon, shape6ptStar] //(K)
|
||||
,[110, 50, 20, 20, undef, yappPolygon, shape6ptStar, yappCenter] //(L)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// [0, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
[25, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[50, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[75, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[100, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[125, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[150, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[175, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
,[200, 40, 20, 20, undef, yappRectangle, 0.2, yappCenter] //(A)
|
||||
|
||||
,[25, 40, 20, 20, undef, yappPolygon, 1.5, $t*360, shapeIsoTriangle, yappCenter, yappFromInside]
|
||||
,[50, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeIsoTriangle2, yappCenter]
|
||||
,[75, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeHexagon, yappCenter]
|
||||
,[100, 40, 20, 20, undef, yappPolygon, undef, $t*360, shape6ptStar, yappCenter]
|
||||
,[125, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeTriangle, yappCenter]
|
||||
,[150, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeTriangle2, yappCenter]
|
||||
,[175, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeArrow, yappCenter]
|
||||
// ,[200, 40, 20, 20, undef, yappPolygon, undef, $t*360, shapeArrow2, yappCenter]
|
||||
|
||||
// Mask Demo
|
||||
// ,[ 160, 55, 50, 50, 10, yappRectangle, 1, shapeHexagon, [maskHoneycomb,0,0,0], yappCenter, yappFromInside]
|
||||
// ,[ 160, 55, 50, 50, 10, yappRectangle, 1, shapeHexagon, [maskHoneycomb,0,0,0], yappCenter, yappFromInside]
|
||||
];
|
||||
|
||||
cutoutsFront =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsBack =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
cutoutsLeft =
|
||||
[
|
||||
//-- 0, 1, 2, 3, 4, 5,6,7,n
|
||||
// [ 30, 3, 25, 15, 3, yappRoundedRect, 1]
|
||||
// ,[ 60, 3, 25, 15, 3, yappRoundedRect, 1, yappFromInside]
|
||||
// ,[ 20, 1, 5, 5, 1, yappRoundedRect, 5, yappFromInside, yappCoordBox] // Cuts out into mounting tab
|
||||
];
|
||||
|
||||
cutoutsRight =
|
||||
[
|
||||
];
|
||||
|
||||
|
||||
//===================================================================
|
||||
// *** Box Mounts ***
|
||||
// Mounting tabs on the outside of the box
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordBox: box[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = pos : position along the wall : [pos,offset] : vector for position and offset X.
|
||||
// Position is to center of mounting screw in leftmost position in slot
|
||||
// p(1) = screwDiameter
|
||||
// p(2) = width of opening in addition to screw diameter
|
||||
// (0=Circular hole screwWidth = hole twice as wide as it is tall)
|
||||
// p(3) = height
|
||||
// Optional:
|
||||
// p(4) = filletRadius : Default = 0/Auto(0 = auto size)
|
||||
// n(a) = { yappLeft | yappRight | yappFront | yappBack } : one or more
|
||||
// n(b) = { yappNoFillet }
|
||||
// n(c) = { <yappBase>, yappLid }
|
||||
// n(d) = { yappCenter } : shifts Position to be in the center of the opening instead of
|
||||
// the left of the opening
|
||||
// n(e) = { <yappGlobalOrigin>, yappLeftOrigin } : Only affects Back and Right Faces
|
||||
//-------------------------------------------------------------------
|
||||
boxMounts =
|
||||
[
|
||||
// [20, 6, 6, 3, yappLeft]
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
2
case/YAPP_Box/examples/openscad-svgrepo-com.svg
Normal file
2
case/YAPP_Box/examples/openscad-svgrepo-com.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>file_type_openscad</title><path d="M25.9,6.3a3.331,3.331,0,0,0-1.227-.348.568.568,0,0,0-.32.075l-1.724.83a11.075,11.075,0,0,0-17.288,8.32l-1.8.862h0l-.237.118-.006.007A3,3,0,0,0,2,18.887a8.049,8.049,0,0,0,1.147,3.99c1.212,2.1,3.1,3.54,4.7,3.54h0a2.325,2.325,0,0,0,1.171-.332V26.07l1.462-.711a11.07,11.07,0,0,0,16.97-8.836l1.314-.746.02-.014a2.917,2.917,0,0,0,.875-1.062l.023-.064A4.357,4.357,0,0,0,30,12.9a8.964,8.964,0,0,0-1.318-4.048A7.822,7.822,0,0,0,25.9,6.3m-5.708,3.92c.975-.51,1.513-1.173,1.516-1.868h0c0,.7-.539,1.352-1.517,1.863M9.651,24.774c-.018.044-.018.044-.028.065a2,2,0,0,1-.792.894H8.823a1.935,1.935,0,0,1-.978.249c-1.469,0-3.227-1.336-4.375-3.325a7.585,7.585,0,0,1-1.1-3.77,2.661,2.661,0,0,1,1.1-2.4l.234-.113.042-.015a.329.329,0,0,1,.044-.016.345.345,0,0,1,.042-.014l.047-.015.04-.011.05-.013.04-.008.053-.011.04-.007.054-.008H4.2l.055-.006H4.7l.063.006H4.8l.068.01H4.9l.076.013.036.008.071.016.035.008.074.019c.075.017.514.181.514.181a7.233,7.233,0,0,1,3.134,3.04c.127.219.243.441.348.664.079.167.152.333.219.5.045.112.087.223.126.335.073.208.136.416.189.622.02.076.039.152.056.228a.274.274,0,0,0,.013.055,5.012,5.012,0,0,1-.006,2.44s-.115.322-.134.367m2.275-.532-1.422.685-.387.186-.3.143c.009-.015.018-.03.026-.045l.018-.031c.03-.053.059-.109.087-.166l.008,0,.008-.016c.028-.061.055-.122.08-.186.016-.04.03-.082.045-.124l.009-.03a6.852,6.852,0,0,0-.937-5.27A7.47,7.47,0,0,0,5.7,16.115l-.146-.054-.139-.045-.088-.025-.062-.017-.05-.013-.1-.023-.058-.012-.1-.018-.1-.015-.065-.009H4.757l.583-.28.379-.183L6.7,14.95a2.024,2.024,0,0,1,.746-.136c1.47,0,3.231,1.338,4.38,3.329a7.66,7.66,0,0,1,1.1,3.68,2.8,2.8,0,0,1-.984,2.423m2.418-13.394a6.965,6.965,0,0,1-1.786-.618,1.867,1.867,0,0,1-.174-.1,4.158,4.158,0,0,1-.468-.309,1.911,1.911,0,0,1-.875-1.469c0-.7.539-1.362,1.517-1.873a8.436,8.436,0,0,1,3.817-.823,8.436,8.436,0,0,1,3.817.823,3.886,3.886,0,0,1,.957.681,2.333,2.333,0,0,1,.246.289l.185.324v.01c.02.044.037.088.052.132h0c.014.043.026.087.036.131v.018a.31.31,0,0,0,.009.05c0,.017.008.045.011.068a.41.41,0,0,0-.01-.069.546.546,0,0,0,.01.069v.026a1.239,1.239,0,0,1,.007.136c0,.7-.541,1.354-1.518,1.864a8.448,8.448,0,0,1-3.818.808h0l-.019.014h-.406a1.616,1.616,0,0,1-.209-.009h-.112c-.1-.006-.192-.014-.287-.024h-.021c-.105-.011-.209-.024-.313-.038Zm4.929,9.519a8.188,8.188,0,0,1,.89-2.213c1.1-1.911,2.792-3.2,4.2-3.2a1.843,1.843,0,0,1,.94.241,2.008,2.008,0,0,1,.871,1.117,3.094,3.094,0,0,1,.1.366l.063.386a4.293,4.293,0,0,1,.028.439,7.288,7.288,0,0,1-1.053,3.623c-1.1,1.912-2.793,3.2-4.2,3.2a1.852,1.852,0,0,1-.94-.24,1.917,1.917,0,0,1-.77-.867,2.828,2.828,0,0,1-.191-.558,4.039,4.039,0,0,1-.1-.883,5.516,5.516,0,0,1,.072-.943Zm10.059-5.856-.023.064a2.54,2.54,0,0,1-.74.884l-1.107.628-.022.013V16a11.089,11.089,0,0,0-4.472-8.889h.009l1.583-.762h0a.379.379,0,0,1,.111-.013,2.878,2.878,0,0,1,1.076.317,7.393,7.393,0,0,1,2.634,2.431A8.8,8.8,0,0,1,29.628,12.9a3.994,3.994,0,0,1-.3,1.616" style="fill:#f6ce2e"/></svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
208
case/YAPP_Box/examples/pcbStandTest.scad
Normal file
208
case/YAPP_Box/examples/pcbStandTest.scad
Normal file
@@ -0,0 +1,208 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// Yet Another Parameterized Projectbox generator
|
||||
//
|
||||
// This is a box for <template>
|
||||
//
|
||||
// Version 3.0.1 (2024-01-15)
|
||||
//
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//
|
||||
// For many/complex cutoutGrills, you might need to adjust
|
||||
// the max number of elements in OpenSCAD:
|
||||
//
|
||||
// Preferences->Advanced->Turn off rendering at 250000 elements
|
||||
// ^^^^^^
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
include <../YAPPgenerator_v3.scad>
|
||||
|
||||
//---------------------------------------------------------
|
||||
// This design is parameterized based on the size of a PCB.
|
||||
//---------------------------------------------------------
|
||||
// Note: length/lengte refers to X axis,
|
||||
// width/breedte refers to Y axis,
|
||||
// height/hoogte refers to Z axis
|
||||
|
||||
/*
|
||||
padding-back|<------pcb length --->|<padding-front
|
||||
RIGHT
|
||||
0 X-axis --->
|
||||
+----------------------------------------+ ---
|
||||
| | ^
|
||||
| | padding-right
|
||||
Y | | v
|
||||
| | -5,y +----------------------+ | ---
|
||||
B a | | 0,y x,y | | ^ F
|
||||
A x | | | | | R
|
||||
C i | | | | | pcb width O
|
||||
K s | | | | | N
|
||||
| | 0,0 x,0 | | v T
|
||||
^ | -5,0 +----------------------+ | ---
|
||||
| | | padding-left
|
||||
0 +----------------------------------------+ ---
|
||||
0 X-as --->
|
||||
LEFT
|
||||
*/
|
||||
|
||||
|
||||
//-- which part(s) do you want to print?
|
||||
printBaseShell = true;
|
||||
printLidShell = true;
|
||||
printSwitchExtenders = false;
|
||||
|
||||
|
||||
// ********************************************************************
|
||||
// The Following will be used as the first element in the pbc array
|
||||
pcbLength = 100; // Front to back
|
||||
pcbWidth = 20; // Side to side
|
||||
pcbThickness = 1.6;
|
||||
standoffHeight = 10.0; //-- How much the PCB needs to be raised from the base to leave room for solderings and whatnot
|
||||
standoffDiameter = 7;
|
||||
standoffPinDiameter = 2.4;
|
||||
standoffHoleSlack = 0.4;
|
||||
|
||||
//===================================================================
|
||||
// *** PCBs ***
|
||||
// Printed Circuit Boards
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : yappCoordBoxInside[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = name
|
||||
// p(1) = length
|
||||
// p(2) = width
|
||||
// p(3) = posx
|
||||
// p(4) = posy
|
||||
// p(5) = Thickness
|
||||
// p(6) = standoffHeight
|
||||
// p(7) = standoffDiameter
|
||||
// p(8) = standoffPinDiameter
|
||||
// p(9) = standoffHoleSlack (default to 0.4)
|
||||
// Optional:
|
||||
|
||||
//The following can be used to get PCB values elsewhere in the script - not in pcb definition.
|
||||
//If "PCB Name" is omitted then "Main" is used
|
||||
// pcbLength --> pcbLength("PCB Name")
|
||||
// pcbWidth --> pcbWidth("PCB Name")
|
||||
// pcbThickness --> pcbThickness("PCB Name")
|
||||
// standoffHeight --> standoffHeight("PCB Name")
|
||||
// standoffDiameter --> standoffDiameter("PCB Name")
|
||||
// standoffPinDiameter --> standoffPinDiameter("PCB Name")
|
||||
// standoffHoleSlack --> standoffHoleSlack("PCB Name")
|
||||
|
||||
pcb =
|
||||
[
|
||||
["Main", pcbLength,pcbWidth, 0,0, pcbThickness, standoffHeight, standoffDiameter, standoffPinDiameter, standoffHoleSlack]
|
||||
];
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-- padding between pcb and inside wall
|
||||
paddingFront = 1;
|
||||
paddingBack = 1;
|
||||
paddingRight = 1;
|
||||
paddingLeft = 1;
|
||||
|
||||
//-- Edit these parameters for your own box dimensions
|
||||
wallThickness = 2.4;
|
||||
basePlaneThickness = 1.2;
|
||||
lidPlaneThickness = 1.2;
|
||||
|
||||
//-- Total height of box = lidPlaneThickness
|
||||
// + lidWallHeight
|
||||
//-- + baseWallHeight
|
||||
// + basePlaneThickness
|
||||
//-- space between pcb and lidPlane :=
|
||||
//-- (bottonWallHeight+lidWallHeight) - (standoffHeight+pcbThickness)
|
||||
baseWallHeight = 9;
|
||||
lidWallHeight = 17;
|
||||
|
||||
//-- ridge where base and lid off box can overlap
|
||||
//-- Make sure this isn't less than lidWallHeight
|
||||
ridgeHeight = 5.0;
|
||||
ridgeSlack = 0.2;
|
||||
roundRadius = 3.0;
|
||||
|
||||
// Set the layer height of your printer
|
||||
printerLayerHeight = 0.2;
|
||||
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
// -- Render --
|
||||
renderQuality = 8; //-> from 1 to 32, Default = 8
|
||||
|
||||
// --Preview --
|
||||
previewQuality = 5; //-> from 1 to 32, Default = 5
|
||||
showSideBySide = false; //-> Default = true
|
||||
onLidGap = 10; // tip don't override to animate the lid opening
|
||||
colorLid = "YellowGreen";
|
||||
alphaLid = 1;
|
||||
colorBase = "BurlyWood";
|
||||
alphaBase = 1;
|
||||
hideLidWalls = false; //-> Remove the walls from the lid : only if preview and showSideBySide=true
|
||||
hideBaseWalls = false; //-> Remove the walls from the base : only if preview and showSideBySide=true
|
||||
showOrientation = true; //-> Show the Front/Back/Left/Right labels : only in preview
|
||||
showPCB = false; //-> Show the PCB in red : only in preview
|
||||
showSwitches = true; //-> Show the switches (for pushbuttons) : only in preview
|
||||
showButtonsDepressed = false; //-> Should the buttons in the Lid On view be in the pressed position
|
||||
showOriginCoordBox = false; //-> Shows red bars representing the origin for yappCoordBox : only in preview
|
||||
showOriginCoordBoxInside = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showOriginCoordPCB = false; //-> Shows blue bars representing the origin for yappCoordBoxInside : only in preview
|
||||
showMarkersPCB = false; //-> Shows black bars corners of the PCB : only in preview
|
||||
showMarkersCenter = false; //-> Shows magenta bars along the centers of all faces
|
||||
inspectX = 0; //-> 0=none (>0 from Back)
|
||||
inspectY = 13.5; //-> 0=none (>0 from Right)
|
||||
inspectZ = 0; //-> 0=none (>0 from Bottom)
|
||||
inspectXfromBack = true; //-> View from the inspection cut foreward
|
||||
inspectYfromLeft = true; //-> View from the inspection cut to the right
|
||||
inspectZfromBottom = true; //-> View from the inspection cut up
|
||||
//---------------------------
|
||||
//-- C O N T R O L --
|
||||
//---------------------------
|
||||
|
||||
//===================================================================
|
||||
// *** PCB Supports ***
|
||||
// Pin and Socket standoffs
|
||||
//-------------------------------------------------------------------
|
||||
// Default origin = yappCoordPCB : pcb[0,0,0]
|
||||
//
|
||||
// Parameters:
|
||||
// Required:
|
||||
// p(0) = posx
|
||||
// p(1) = posy
|
||||
// Optional:
|
||||
// p(2) = Height to bottom of PCB : Default = standoff_Height
|
||||
// p(3) = PCB Gap : Default = -1 : Default for yappCoordPCB=pcb_Thickness, yappCoordBox=0
|
||||
// p(4) = standoff_Diameter Default = standoff_Diameter;
|
||||
// p(5) = standoff_PinDiameter Default = standoff_PinDiameter;
|
||||
// p(6) = standoff_HoleSlack Default = standoff_HoleSlack;
|
||||
// p(7) = filletRadius (0 = auto size)
|
||||
// p(8) = Pin Length : Default = 0 -> PCB Gap + standoff_PinDiameter
|
||||
// Indicated length of pin without the half sphere on top
|
||||
// n(a) = { <yappBoth> | yappLidOnly | yappBaseOnly }
|
||||
// n(b) = { <yappPin>, yappHole, yappTopPin }
|
||||
// yappPin = Pin on Base and Hole on Lid
|
||||
// yappHole = Hole on Both
|
||||
// yappHole = Hole on Base and Pin on Lid
|
||||
// n(c) = { yappAllCorners, yappFrontLeft | <yappBackLeft> | yappFrontRight | yappBackRight }
|
||||
// n(d) = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }
|
||||
// n(e) = { yappNoFillet } : Removes the internal and external fillets and the Rounded tip on the pins
|
||||
// n(f) = [yappPCBName, "XXX"] : {Specify a PCB defaults to "Main"
|
||||
//-------------------------------------------------------------------
|
||||
pcbStands =
|
||||
[
|
||||
[5, 10, undef, undef, 2, 1] // Original method
|
||||
,[15, 10, undef, undef, 4, 2, undef, undef, pcbThickness() + 2 ] // Custom Length of PCB Thickness + 2
|
||||
,[25, 10, undef, undef, 4, 2, undef, undef, 999 , yappHole] // Default Hole in Lid and Pin in Base Pin Length is ignored
|
||||
,[35, 10, undef, undef, 4, 2, yappHole] // Default Hole in Lid and Pin in Base Pin Length is ignored
|
||||
,[45, 10, undef, undef, 4, 2, undef, undef, pcbThickness() +2 , yappTopPin] // Hole in Base and Pin in Lid
|
||||
,[55, 10, undef, undef, 4, 2, undef, undef, pcbThickness() +2 , yappNoFillet] // No Outer Fillet
|
||||
,[65, 10, undef, undef, 4, 2, undef, undef, 4 ] // Custom Length of 4
|
||||
,[75, 10, undef, undef, 4, 2, undef, undef, -0.0001 ] // Custom Length of Zero (have to use 0.0001 so it's not actually zero so the default isn't used
|
||||
];
|
||||
|
||||
//---- This is where the magic happens ----
|
||||
YAPPgenerate();
|
||||
Reference in New Issue
Block a user