Skip to content

Instantly share code, notes, and snippets.

@fzerorubigd
Created August 9, 2022 12:01
Show Gist options
  • Save fzerorubigd/6a7545ef4db886c2371b7f02dda06964 to your computer and use it in GitHub Desktop.
Save fzerorubigd/6a7545ef4db886c2371b7f02dda06964 to your computer and use it in GitHub Desktop.
An openscad example
include <bit/boardgame_insert_toolkit_lib.2.scad>;
// determines whether lids are output.
g_b_print_lid = true;
// determines whether boxes are output.
g_b_print_box = true;
// Focus on one box
g_isolated_print_box = "";
// Used to visualize how all of the boxes fit together.
g_b_visualization = f;
// this is the outer wall thickness.
//Default = 1.5mm
g_wall_thickness = 1.5;
// The tolerance value is extra space put between planes of the lid and box that fit together.
// Increase the tolerance to loosen the fit and decrease it to tighten it.
//
// Note that the tolerance is applied exclusively to the lid.
// So if the lid is too tight or too loose, change this value ( up for looser fit, down for tighter fit ) and
// you only need to reprint the lid.
//
// The exception is the stackable box, where the bottom of the box is the lid of the box below,
// in which case the tolerance also affects that box bottom.
//
g_tolerance = 0.15;
// This adjusts the position of the lid detents downward.
// The larger the value, the bigger the gap between the lid and the box.
g_tolerance_detents_pos = 0.1;
data =
[
[ "minimal", // our box. name is just for code organization.
[
[ BOX_SIZE_XYZ, [46.5, 46.5, 15.0] ], // one kv pair specifying the x, y, and z of our box exterior.
[ BOX_COMPONENT, // our first component.
[
[ CMP_NUM_COMPARTMENTS_XY, [4, 4] ], // it's a grid of 4 x 4
[ CMP_COMPARTMENT_SIZE_XYZ, [ 10, 10, 13.0] ], // each compartment is 10mm x 10mm x 13mm
]
]
]
]
];
MakeAll();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment