SkillAgentSearch skills...

Trayfinity

Customizable gridfinity tray generator for OpenSCAD

Install / Use

/learn @annevanleyden/Trayfinity
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Trayfinity Workbench

Infinite possibilities in generating gridfinity assortment trays.

Overview

This workbench can be used to generate subdivided trays, compatible with Zack Freedman's gridfinity system. You can use it in three ways:

  1. Generate a simple tray with regular row and column divisions.
  2. Layout your own tray the way you would an html table.
  3. Generate your own features.

2 and 3 can be mixed, so you can generate your own content in place of any cell.

For option 1, simply open trayfinity.scad and use the customizer.

A simple tray

All of the code samples below assume these two includes:

use <trayfinity-modules.scad>
include <trayfinity-constants.scad>

Generating a tray is a two-step process: first create the data structure that describes the tray, then generate the tray from the data structure.

definition = build_tray_definition(
  width_units = 5,
  depth_units = 5,
  height_units = 8,
  label_placement = "column",
  layout = generate_layout(num_columns = 4, num_rows = 3)
);
  
trayfinity_tray(definition);  

basic-tray

The generate_layout() function will generate a simple layout with the specified number of columns and rows.

Tray definition

Below is a desciption of the parameters that the build_tray_definition() function accepts.

Tray properties

| property | Default | Description | |----------------------------|------------|-----------------------------------------------------------------------------------------------------------------------------------| | width_units | 5 | X dimension in grid units (multiples of 42 mm). | | depth_units | 3 | Y dimension in grid units (multiples of 42 mm). | | height_units | 4 | Z dimension (multiples of 7 mm + 4.75 mm for the bottom interface) | | layout | | Layout specification as generated with the generate_layout() function. | | column_widths | [] | Relative column widths. Unspecified column widths are assumed to be 1. | | row_depths | [] | Relative row depths. Unspecified row depths are assumed to be 1. | | wall_thickness | 0.95 | Thickness of the outer wall. | | divider_thickness | 0.9 | Width of internal subdividers. | | lip_size | "standard" | Size of the lip. Possible values: "standard", "reduced", "none". | | magnet_diameter | 6.5 | Diameter of the cutouts for the magnets. The design default is 6.5 mm. The depth of the hole will be 2.4 mm. Set to 0 to disable. | | screw_depth | 4.75 | Depth of the cutouts for the screws. The design default is 4.75 mm. The diameter of the hole will be 3 mm. Set to 0 to disable. | | corner_attachments_only | false | Only add attachments (magnets and/or screws) to tray corners. | | attachment_overhang_remedy | true | Add extra feature in attachement holes to allow your slicer to use bridges. Only when both screws and magnets are enabled. | | bottom_interface_divide | 1 | Subdivide bottom interface pads. Max is 4 if no attachments specified. |

Default cell properties

For all but a few cell properties, defaults can be specified at the tray level, so you don't have to repeat them for each cell. You can override these properties on a cell-by-cell basis, by only specifying the properties that must be overridden for that cell.

Basic layout properties:

| property | Default | Description | |--------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | floor_thickness | 0.8 | Minimum thickness above bottom interface or screw holes if a screw_depth of more than 4.75 is specified. | | fillet_radius | 0 | Fillet radius of the inside of a cell. Set to 0 to default to 3.75 - wall_thickness. On the corners of the tray the default is the minimum to guarantee a minimum wall thickness. | | fingerslide_radius | 11 | Include larger fillet at the front side of each cell. Set to a value below fillet_radius to disable. |

Label properties:

| property | Default | Description | |--------------------|-------------------|-------------------------------------------------------------------------------------------| | label_placement | "all" | Include overhang for labeling. Possible values: "all", "column", "row", "single", "none". | | label_align | "left" | Alignment of the label. Possible values: "left", "right", "center", "full". | | label_width | 30 | Width of the label in mm. | | label_depth | 10 | Depth of the label in mm. |

Label text properties:

| property | Default | Description | |--------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | font | "Liberation Sans" | Font to use for the label. See the OpenSCAD documentation for details. | | font_size | 5 | Size of the label text. This is roughly the vertical size of the letters in mm. | | text_color | "black" | Text color is mainly used for exporting labels of a certain color for multicolor printing. You can specify a color name or hex value. | | text_height | 0.0 | How far the text sticks out of the label. This setting effectively moves the label down instead of moving the text up. This to ensure that the text does not interfere with stacking. | | text_depth | 0.3 | How deep the text is carved out of the label. | | text_margin_v | 1.0 | Margin on the left for label text or at the right when label_align == "right". | | text_margin_h | 1.0 | Margin at the bottom for label text. |

Custom layouts

Defining a layout

For defining a layout, there are 2 functions: row() and cell(). row() has a single parameter: an array of cells. For the cell() parameters, see next section.

layout = 
  [  
    row(
      [ 
        cell(1, 1),
        cell(1, 1)
      ]
    )
  ];
  
trayfinity_tray(build_tray_definition(layout = layout));

The colspan and rowspan work as in an html table:

layout = 
  [  
    row(
      [ 
        cell(1, 2),
        cell(2, 1)
      ]
    ),
    row(
      [ 
        cell(1, 1),
        cell(1, 1)
      ]
    )
  ];
  
trayfinity_tray(build_tray_definition(layout = layout));

-colspanrowspan-demo

Cell properties

The cell() function accepts the following parameters for setting the properties.

Basic layout properties:

| property | Default | Description | |--------------------|---------|-------------------------------------------------------------------------------------------------------------------------------| | colspan | 1 | Span the cell over this many columns. This will always be the first parameter, so you can use it positionally. |
| rowspan | 1 | Span the cell over this many rows. This will always be the second parameter, so you can use it positionally. |

View on GitHub
GitHub Stars10
CategoryDevelopment
Updated21d ago
Forks1

Languages

OpenSCAD

Security Score

75/100

Audited on Mar 19, 2026

No findings