Blender Project: ArtBin Thread Holder Tray

ArtBin sells trays to hold 1100m spools of embroidery thread, but those only hold 36 cones in the 13×13 box! The ArtBin thread trays hold more, although you can only set a cone on every other peg. What I wanted was something that can hold the maximum number of Mareira 1100 yard cones of rayon embroidery thread – something that comes closest to just cramming them into the box as tightly as possible.

For some reason, there is no such product available. I couldn’t even find a 3d model to print. It’s fairly simple – the footprint is a square. I’m not printing something this large in one piece, but a strip can be printed when rotated diagonally across the print bed.

Staggering the even strips gives me 8 cones on odd strips and 7 cones on even strips, and I can tightly pack the strips to approach the maximum hex packing density. Ten strips fit in a single ArtBin Super Satchel – 75 thread cones with a little space between them at the bottom.

I added “teeth” to the strips to interlock the units. I figured individual strips would slide around the case otherwise

I may need to add something to accommodate the raised plastic within the case. Until then, this is my python script to generate the thread cone holder.

import bpy
import math

# =====================================================
# CLEAN
# =====================================================

bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)

# =====================================================
# PARAMETERS
# =====================================================

MM = 1

def mm(v):
    return v * MM

STRIP_LENGTH = 330.0
STRIP_THICK  = 5.0 # Was 3
STRIP_WIDTH  = 33.0

STRIPS_TO_PRINT = 10
BED_SPACING = 2.0

PEG_PITCH    = 40.0

PEG_HEIGHT   = 75.0
PEG_BASE_DIA = 12.0
PEG_TOP_DIA  = 9.0

KEY_WIDTH  = 20.0
KEY_DEPTH  = 5.0

KEY_XS = [
    -110.0,
       0.0,
     110.0
]

CLEARANCE = 0.30

BEVEL_WIDTH = 0.75
BEVEL_SEGS = 3

BOX_INTERIOR = 336.55

def add_cube(name, x, y, z, loc):

    bpy.ops.mesh.primitive_cube_add(
        location=loc
    )

    obj = bpy.context.active_object
    obj.name = name

    obj.scale = (
        mm(x/2),
        mm(y/2),
        mm(z/2)
    )

    return obj


def apply_boolean(target, cutter):

    mod = target.modifiers.new(
        name="Bool",
        type='BOOLEAN'
    )

    mod.object = cutter
    mod.operation = 'DIFFERENCE'

    bpy.context.view_layer.objects.active = target

    bpy.ops.object.modifier_apply(
        modifier=mod.name
    )


def peg_params(strip_index):

    if strip_index % 2 == 0:
        return 8, 0

    return 7, 20


def get_edge_mode(strip_index, strip_count):

    if strip_index == 0:
        return "top"

    if strip_index == strip_count - 1:
        return "bottom"

    return "middle"

def make_strip(
        name,
        peg_count,
        peg_offset,
        edge_mode,
        x_shift=0,
        y_shift=0):

    body = add_cube(
        f"{name}_BODY",
        STRIP_LENGTH,
        STRIP_WIDTH,
        STRIP_THICK,
        (
            mm(x_shift),
            mm(y_shift),
            mm(STRIP_THICK/2)
        )
    )

    pieces = [body]
    cutters = []

    # -----------------------------------------
    # TOP KEYS
    # -----------------------------------------

    if edge_mode in ("top", "middle"):

        for x in KEY_XS:

            tooth = add_cube(
                f"{name}_TOP_KEY",
                KEY_WIDTH,
                KEY_DEPTH,
                STRIP_THICK,
                (
                    mm(x_shift + x),
                    mm(
                        y_shift +
                        STRIP_WIDTH/2 +
                        KEY_DEPTH/2
                    ),
                    mm(STRIP_THICK/2)
                )
            )

            pieces.append(tooth)

    # -----------------------------------------
    # BOTTOM SOCKETS
    # -----------------------------------------

    if edge_mode in ("middle", "bottom"):

        for x in KEY_XS:

            cutter = add_cube(
                f"{name}_BOTTOM_SOCKET",
                KEY_WIDTH + CLEARANCE,
                KEY_DEPTH + CLEARANCE,
                STRIP_THICK * 4,
                (
                    mm(x_shift + x),
                    mm(
                        y_shift -
                        STRIP_WIDTH/2 +
                        KEY_DEPTH/2
                    ),
                    mm(STRIP_THICK/2)
                )
            )

            cutters.append(cutter)
            
    # -----------------------------------------
    # JOIN BODY + KEYS
    # -----------------------------------------

    bpy.ops.object.select_all(
        action='DESELECT'
    )

    for obj in pieces:
        obj.select_set(True)

    bpy.context.view_layer.objects.active = body

    bpy.ops.object.join()

    strip = bpy.context.active_object

    # -----------------------------------------
    # SOCKET CUTS
    # -----------------------------------------

    for cutter in cutters:
        apply_boolean(strip, cutter)

    for cutter in cutters:
        bpy.data.objects.remove(
            cutter,
            do_unlink=True
        )

    # -----------------------------------------
    # PEGS
    # -----------------------------------------

    join_parts = [strip]

    start_x = (
        -STRIP_LENGTH/2 +
        STRIP_WIDTH/2 +
        peg_offset
    )

    for peg_index in range(peg_count):

        px = (
            start_x +
            peg_index * PEG_PITCH
        )

        bpy.ops.mesh.primitive_cone_add(
            radius1=mm(
                PEG_BASE_DIA/2
            ),
            radius2=mm(
                PEG_TOP_DIA/2
            ),
            depth=mm(
                PEG_HEIGHT
            ),
            location=(
                mm(x_shift + px),
                mm(y_shift),
                mm(
                    STRIP_THICK +
                    PEG_HEIGHT/2
                )
            )
        )

        join_parts.append(
            bpy.context.active_object
        )
    bpy.ops.object.select_all(
        action='DESELECT'
    )

    for obj in join_parts:
        obj.select_set(True)

    bpy.context.view_layer.objects.active = strip

    bpy.ops.object.join()

    strip = bpy.context.active_object
    strip.name = name

    bevel = strip.modifiers.new(
        "Bevel",
        'BEVEL'
    )

    bevel.width = mm(BEVEL_WIDTH)
    bevel.segments = BEVEL_SEGS

    return strip
required_width = (
    STRIPS_TO_PRINT *
    STRIP_WIDTH
)

center_spacing = math.sqrt(
    (20.0 ** 2) +
    (STRIP_WIDTH ** 2)
)

cone_clearance = (
    center_spacing -
    38.0
)

print("")
print("========== DESIGN REPORT ==========")
print(f"Box Interior: {BOX_INTERIOR:.2f} mm")
print(f"Rows: {STRIPS_TO_PRINT}")
print(f"Width Used: {required_width:.2f} mm")
print(f"Margin Left: {BOX_INTERIOR - required_width:.2f} mm")
print(f"Cone Clearance: {cone_clearance:.2f} mm")
print("===================================")
print("")

for strip_index in range(STRIPS_TO_PRINT):

    peg_count, peg_offset = peg_params(
        strip_index
    )

    edge_mode = get_edge_mode(
        strip_index,
        STRIPS_TO_PRINT
    )

    make_strip(
        name=f"STRIP_{strip_index}",
        peg_count=peg_count,
        peg_offset=peg_offset,
        edge_mode=edge_mode,
        x_shift=0,
        y_shift=(
            strip_index *
            (STRIP_WIDTH + BED_SPACING)
        )
    )

    print(
        f"Strip {strip_index}: "
        f"pegs={peg_count} "
        f"offset={peg_offset} "
        f"mode={edge_mode}"
    )

print("")
print("===================================")
print("INTERLOCKING STRIPS GENERATED")
print("===================================")
print("")            

Leave a Reply

Your email address will not be published. Required fields are marked *