Skip to content

cap_box.scad

pinkfish edited this page Jan 14, 2025 · 25 revisions

LibFile: cap_box.scad

This file has all the modules needed to generate a cap box.

To use, add the following lines to the beginning of your file:

include <boardgame_toolkit.scad>

File Contents

  1. Section: CapLid

Section: CapLid

Function: CapBoxDefaultCapHeight()

Description:

Works out the default value for the cap box height.

Arguments:

By Position What it does
height the height of the box.

Function: CapBoxDefaultFingerHoldHeight()

Description:

Works out the default value for the cap box finger hold height.

Arguments:

By Position What it does
height the height of the box.

Function: CapBoxDefaultFingerHoldLen()

Description:

Works out the default value for the cap box finger hold length.

Arguments:

By Position What it does
height the height of the box.

Function: CapBoxDefaultLidWallThickness()

Description:

Works out the default value for the cap box wall thickness.

Arguments:

By Position What it does
wall_thickness the wall thickness of the box.

Module: MakeBoxWithCapLid()

Topics: CapLid

Usage: MakeBoxWithCapLid(100, 50, 20);

Description:

Makes a box with a cap lid. Inside the children of the box you can use the $inner_height , $inner_width, $inner_length = length variables to deal with the box sizes.

Arguments:

By Position What it does
width outside width of the box
length inside width of the box
height outside height of the box
cap_height height of the cap on the box (default 10)
lid_thickness thickness of the lid (default default_lid_thickness)
wall_thickness thickness of the walls (default default_wall_thickness)
floor_thickness thickness of the floor (default default_floor_thickness)
size_sizeing amount of wiggle room between pieces (default m_piece_wiggle_room)
lid_wall_thickness the thickess of the walls in the lid (default wall_thickness / 2)
lid_finger_hold_len length of the finger hold sections to cut out (default min(width,lenght)/5)
finger_hold_height how heigh the finger hold bit it is (default 5)
material_colour the colour of the material in the box (default default_material_colour)
last_child_positive if the last child in the list is a positive add to the box, not negative (default false)

Example 1:

MakeBoxWithCapLid() Example 1
include <boardgame_toolkit.scad>
MakeBoxWithCapLid(100, 50, 20);



Example 2:

MakeBoxWithCapLid() Example 2
include <boardgame_toolkit.scad>
MakeBoxWithCapLid(100, 50, 10, lid_finger_hold_len = 4);



Example 3:

MakeBoxWithCapLid() Example 3
include <boardgame_toolkit.scad>
MakeBoxWithCapLid(100, 50, 5, cap_height = 2, finger_hold_height = 1);

Module: CapBoxLid()

Topics: CapBox

Usage: CapBoxLid(100, 50, 20);

Description:

Lid for a cap box, small cap to go on the box with finger cutouts.

Arguments:

By Position What it does
width outside width of the box
length inside width of the box
height outside height of the box
cap_height height of the cap on the box (default 10)
lid_thickness thickness of the lid (default default_lid_thickness)
wall_thickness thickness of the walls (default default_wall_thickness)
size_sizeing amount of wiggle room between pieces (default m_piece_wiggle_room)
lid_wall_thickness the thickess of the walls in the lid (default wall_thickness / 2)
finger_hold_height how heigh the finger hold bit it is (default 5)
lid_roudning how much to round the edge of the lid (default wall_thickness / 2)
lid_inner_rounding how much to round the inside of the box (default calc_lid_wall_thickness/2)
material_colour the colour of the material in the box (default default_material_colour)

Example 1:

CapBoxLid() Example 1
include <boardgame_toolkit.scad>
CapBoxLid(100, 50, 30);



Example 2:

CapBoxLid() Example 2
include <boardgame_toolkit.scad>
CapBoxLid(100, 50, 10);



Example 3:

CapBoxLid() Example 3
include <boardgame_toolkit.scad>
CapBoxLid(100, 50, 10, cap_height = 3);




Module: CapBoxLidWithLabelAndCustomShape()

Topics: CapBox

Usage: CapBoxLidWithLabelAndCustomShape(100, 50, text\_width = 70, text\_height = 20, text\_str = "Frog");

Description:

Lid for a cap box, small cap to go on the box with finger cutouts. This uses the first child as the shape for repeating on the lid.

Arguments:

By Position What it does
width outside width of the box
length inside width of the box
height outside height of the box
lid_boundary boundary around the outside for the lid (default 10)
cap_height height of the cap on the box (default 10)
lid_thickness thickness of the lid (default default_lid_thickness)
wall_thickness thickness of the walls (default default_wall_thickness)
size_sizeing amount of wiggle room between pieces (default m_piece_wiggle_room)
lid_wall_thickness the thickess of the walls in the lid (default wall_thickness / 2)
finger_hold_height how heigh the finger hold bit it is (default 5)
label_radius radius of the label corners (default 5)
label_border border of the item (default 2)
label_offset offset in from the edge for the label (default 4)
label_rotated if the label is rotated (default false)
layout_width the width of the layout pieces (default default_lid_layout_width)
shape_width width of the shape (default default_lid_shape_width)
shape_thickness how wide the pieces are (default default_lid_shape_thickness)
aspect_ratio the aspect ratio (multiple by dy) (default default_lid_aspect_ratio)
size_spacing extra spacing to apply between pieces (default m_piece_wiggle_room)
lid_pattern_dense if the layout is dense (default false)
lid_dense_shape_edges the number of edges on the dense layout (default 6)
label_colour the color of the label (default undef)
material_colour the colour of the material in the box (default default_material_colour)
label_solid_background generate a solid label background, useful for mmu (default
[default_label_solid_background](base_bgtk.scad#constant-default_label_solid_background))
label_background_colour the colour of the label background (default default_label_background_colour)

Example 1:

CapBoxLidWithLabelAndCustomShape() Example 1
include <boardgame_toolkit.scad>
CapBoxLidWithLabelAndCustomShape(100, 50, 30, text_width = 70, text_height = 20, text_str = "Frog") {
  ShapeByType(shape_type = SHAPE_TYPE_SUPERSHAPE, shape_thickness = 2, supershape_m1 = 12, supershape_m2 = 12,
     supershape_n1 = 1, supershape_b = 1.5, shape_width = 15);
}

Module: CapBoxLidWithLabel()

Topics: CapBox

Usage: CapBoxLidWithLabel(100, 50, text\_width = 70, text\_height = 20, text\_str = "Frog");

Description:

Lid for a cap box, small cap to go on the box with finger cutouts.

Arguments:

By Position What it does
width outside width of the box
length inside width of the box
height outside height of the box
lid_boundary boundary around the outside for the lid (default 10)
cap_height height of the cap on the box (default 10)
lid_thickness thickness of the lid (default default_lid_thickness)
wall_thickness thickness of the walls (default default_wall_thickness)
size_sizeing amount of wiggle room between pieces (default m_piece_wiggle_room)
lid_wall_thickness the thickess of the walls in the lid (default wall_thickness / 2)
finger_hold_height how heigh the finger hold bit it is (default 5)
label_radius radius of the label corners (default 5)
border border of the item (default 2)
label_offset offset in from the edge for the label (default 4)
label_rotated if the label is rotated (default false)
layout_width the width of the layout pieces (default default_lid_layout_width)
shape_width width of the shape (default default_lid_shape_width)
shape_thickness how wide the pieces are (default default_lid_shape_thickness)
aspect_ratio the aspect ratio (multiple by dy) (default default_lid_aspect_ratio)
size_spacing extra spacing to apply between pieces (default m_piece_wiggle_room)
label_colour the color of the label (default undef)
material_colour the colour of the material in the box (default default_material_colour)
label_solid_background generate a solid label background, useful for mmu (default
[default_label_solid_background](base_bgtk.scad#constant-default_label_solid_background))
label_background_colour the colour of the label background (default default_label_background_colour)

Example 1:

CapBoxLidWithLabel() Example 1
include <boardgame_toolkit.scad>
CapBoxLidWithLabel(100, 50, 30, text_width = 70, text_height = 20, text_str = "Frog");

Example 2:

CapBoxLidWithLabel() Example 2
include <boardgame_toolkit.scad>
CapBoxLidWithLabel(100, 50, 30, text_width = 70, text_height = 20, text_str = "Frog");

Example 3:

CapBoxLidWithLabel() Example 3
include <boardgame_toolkit.scad>
CapBoxLidWithLabel(100, 50, 30, text_width = 70, text_height = 20, text_str = "Frog", material_colour =
"lightblue", label_colour = "black");

Example 4:

CapBoxLidWithLabel() Example 4
include <boardgame_toolkit.scad>
default_lid_shape_type = SHAPE_TYPE_CIRCLE;
default_lid_shape_thickness = 1;
default_lid_shape_width = 13;
default_lid_layout_width = 10;
CapBoxLidWithLabel(120, 70, 30, text_width = 70, text_height = 20, text_str = "Cards");

Clone this wiki locally