Skip to content

sliding_box.scad

pinkfish edited this page Nov 23, 2024 · 20 revisions

LibFile: sliding_box.scad

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

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

include <boardgame_toolkit.scad>

File Contents

  1. Section: SlidingBox

Section: SlidingBox

All the pieces for making sliding lids and different types of sliding lids/boxes.

Module: SlidingLid()

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingLid(width=10, length=30, lid_thickness=3, wall_thickness = 2, size_spacing = 0.2);

Description:

Creates a sliding lid for a sliding lid box, the children to this module are inserted into the lid. This does all the right things on the edges, uses some wiggle room to add in a buffer and also does a small amount of angling on the ends to make them easier to insert.

Arguments:

By Position What it does
width the width of the box itself
length the length of the box itself
lid_thickness thickness of the lid (default default_lid_thickness)
wall_thickness thickness of the walls (default default_wall_thickness)
size_spacing how much of an offset to use in generate the slides spacing on all four sides defaults to
[m_piece_wiggle_room](base_bgtk.scad#constant-m_piece_wiggle_room)

Example 1:

SlidingLid() Example 1
include <boardgame_toolkit.scad>
SlidingLid(width=100, length=100, lid_thickness=3, wall_thickness = 2)
  translate([ 10, 10, 0 ])
    LidMeshHex(width = 100, length = 100, lid_thickness = 3, boundary = 10, radius = 12);

Module: SlidingBoxLidWithLabelAndCustomShape()

Topics: SlidingBox, SlidingLid

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

Description:

Lid for a sliding lid box. 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 outside length of the box
lid_boundary boundary around the outside for the lid (default 10)
lid_thickness thickness of the lid (default default_lid_thickness)
size_sizeing amount of wiggle room between pieces (default m_piece_wiggle_room)
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_rounding how much rounding on the edge of the lid (default wall_thickness/2)

Example 1:

SlidingBoxLidWithLabelAndCustomShape() Example 1
include <boardgame_toolkit.scad>
SlidingBoxLidWithLabelAndCustomShape(100, 50, 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: SlidingBoxLidWithLabel

Topics: SlidingBox, SlidingLid

Usage:

  • SlidingBoxLidWithLabel(width = 100, length = 100, lid_thickness = 3, text_width = 60, text_height = 30, text_str
  • = "Trains", label_rotated = false);

Description:

This is a composite method that joins together the other pieces to make a simple lid with a label and a hex grid. The children to this as also pulled out of the lid so can be used to build more complicated lids.

Arguments:

By Position What it does
width width of the box (outside dimension)
length length of the box (outside dimension)
text_width width of the text section
text_height length of the text section
text_str The string to write
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)
lid_boundary how much boundary should be around the pattern (default 10)
label_radius radius of the rounded corner for the label section (default 12)
label_border how wide the border strip on the label should be (default 2)
label_offset how far inside the border the label should be (default 4)
label_rotated if the label should be rotated (default false)
label_radius radius of the label bit (default 5)
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 how much of an offset to use in generate the slides spacing on all four sides defaults to
[m_piece_wiggle_room](base_bgtk.scad#constant-m_piece_wiggle_room)

Example 1:

SlidingBoxLidWithLabel Example 1
include <boardgame_toolkit.scad>
SlidingBoxLidWithLabel(
    width = 100, length = 100, lid_thickness = 3, text_width = 60,
    text_height = 30, text_str = "Trains", label_rotated = false);

Module: MakeBoxWithSlidingLid()

Topics: SlidingBox

Usage:

  • MakeBoxWithSlidingLid(50,100,20);

Description:

Makes a box with a sliding lid, this just creates the box itself with the cutouts for the sliding lid pieces. The children to this will be removed from inside the box and how to add in the cutouts.

The children all start from the edge inside the wall width and up from the floor in the box.

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 width of the box (outside width)
length length of the box (outside length)
height height of the box (outside height)
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)

Example 1:

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




Clone this wiki locally