Metadata-Version: 2.5
Name: cadbuildr-tslot
Version: 0.1.0
Summary: T-slot aluminium framing on CADbuildr foundation + frames: catalog profiles (80/20 first), connectors with part numbers, one-liner boxes / tables, BOM and checks
Author: CADbuildr Team
License-File: LICENSE
Requires-Python: <4.0.0,>=3.10.0
Requires-Dist: cadbuildr-foundation<0.3.0,>=0.2.21
Requires-Dist: cadbuildr-frames<0.3.0,>=0.2.0
Description-Content-Type: text/markdown

# cadbuildr.tslot

## Summary

T-slot aluminium framing (80/20 style) on CADbuildr foundation and
`cadbuildr-frames`: real T-slot cross-sections from catalog data, connectors
with catalog part numbers (T-nuts, button-head screws, anchor fasteners,
inside-corner and gusseted brackets, joining plates, end caps), butt-jointed
frames with the hardware placed for you, one-liner boxes and tables, a bill
of materials you can order from, and checks.

## Tags

cad, python, t-slot, 80/20, aluminium-extrusion, framing, frames, connectors, bom, catalog, assembly

## Status

yellow

## Guidelines

- Vendor catalogs are DATA (`cadbuildr/tslot/catalogs/c8020.py`): every row
  records its public source URL, and any value the vendor does not publish
  is listed in the row's `approximated` dict with the reason. No vendor CAD
  files, drawings or images are used. Add Misumi / Bosch Rexroth /
  OpenBuilds as another data module + `register_catalog`.
- One parametric section builder (`section.py`) draws every profile from
  its series' slot data; nothing is a hand-written per-profile class.
- Frames is the core: `TSlotFrame` is a `cadbuildr.frames.Frame` with
  `corner="butt"` and the `TSlotJoints` connector rule (the frames connector
  hook). Cut lengths come from the frames layout — one source of truth.
- Fail loudly: a member landing between slots, non-perpendicular members,
  an unknown part number or a profile too small for the requested size
  raise `ValueError` naming the members; `frame.check()` reports members
  too short for their hardware, nuts that do not fit and collisions.
- Publish-first: depends on `cadbuildr-foundation` and `cadbuildr-frames`
  from PyPI only.

## Dependencies

### Upstream

- [cadbuildr-foundation](https://pypi.org/project/cadbuildr-foundation/) (PyPI)
- `cadbuildr-frames` >= 0.2.0 (connector hook; PyPI release pending)

### Downstream

- None yet (to be added to the curated-libraries registry once on PyPI).

## Usage

```python
from cadbuildr import tslot
from cadbuildr.foundation import show

table = tslot.table(800, 500, 750, series="1010")   # corner brackets + end caps
print(table.bom_table())
print(table.check())        # [] = OK
show(table)

box = tslot.box(600, 400, 300, series="1515", joints="anchor")
```

All one-liner sizes are OUTER dimensions in mm (X width, Y depth, Z height,
standing on z = 0). Posts / legs run the full height, rails are cut to fit
between them.

| Entry point | What you get |
|---|---|
| `tslot.box(w, d, h, series="1010", joints="anchor")` | 12-member box: 4 posts, 4 + 4 rails, end caps on the exposed post ends |
| `tslot.table(w, d, h, series="1010", joints="corner_bracket", shelf_height=None, top_thickness=None)` | 4 legs + top rails (+ shelf rails, + top panel), capped feet |
| `tslot.TSlotFrame(skeleton, profile="1010", joints=...)` | any skeleton of `cadbuildr.frames` segments (`box_edges`, `rectangle`, `polyline`, `Line3D`) |
| `tslot.extrusion("1515", 600)` / `TSlotExtrusion` | one cut length with slot anchors |
| `tslot.part("4119")` | one connector Part by part number |
| `tslot.profiles()` | the catalog's profile part numbers |

`joints`: `"anchor"` (anchor fastener in the rail end + counterbore
machining), `"corner_bracket"` (inside corner bracket, 2 screws + 2 T-nuts),
`"gusset"` (gusseted bracket) or `None`. `series=` takes a profile part
number (`"1010"`, `"1020"`, `"1515"`, `"40-4040"`…); `profile=` is the same.

### Frame methods

- `frame.bom()` -> `BomRow(item, category, part_number, description, qty,
  cut_length, weight)`; `frame.bom_table()` renders it with totals
  (extrusion length per profile, connector / fastener counts, weight from
  catalog kg/m). `tslot.totals(frame)` returns the totals as a dict.
- `frame.check(exact=False, strict=False)` -> list of `Problem`.
- `frame.add_panel("top", thickness=6.35)` -> a sheet on an outer face.
- `frame.slot_anchor(member, "slot_top_0", at=100)` -> an anchor to mate
  your own parts (stdlib's `TSlotNut` mates on these too).
- Inherited from frames: `cut_list()`, `cut_list_table()`, `members`,
  `junctions`, `connectors`.

### Anchors

Extrusions and frame members are built along local +X, profile u (width)
on +Y and v (height) on +Z. Anchors: `end_a`, `end_b` (outward +Z),
`axis`, and one per slot at the slot opening at the start of the material:
`slot_<face>_<i>` with face `top` (+v), `bottom`, `left` (-u), `right`,
`i` counted along the face; +Z = outward face normal, +X = along the
extrusion (stdlib's `AluExtrusion` convention).

## Catalog coverage (80/20)

See `cadbuildr/tslot/catalogs/c8020.py` (source URL per row).

- Profiles: 1010, 1020, 1030, 2020 (10 series); 1515, 1530, 1545, 3030
  (15 series); 20-2020, 20-2040, 25-2525, 30-3030, 40-4040, 45-4545.
  Size, area, weight, Ix / Iy are catalog values.
- Connectors (10 / 15 series, some 40): economy, standard, roll-in and
  drop-in T-nuts; button head screws; standard anchor fasteners; 2- and
  4-hole inside corner brackets; gusseted brackets; straight / L / T
  joining plates; end caps for 1010, 1020, 1515.

### Approximations

- 10 / 15 series slots: opening and lip are labelled catalog dimensions;
  undercut width, chamber depth and bottom width are the unlabelled catalog
  drawing dimensions read as those features (they reproduce the catalog
  section area within 1.5 % / 3.3 %).
- Metric slots: 80/20 does not publish them; opening / lip / undercut are
  typical values for the series' fastener and the depth is solved so the
  section area matches the catalog area.
- Multi-cell profiles: internal hollows are not published; the hollow
  between cells is sized so the area matches the catalog (2 x 2 profiles
  stay ~12 % heavy: listed in their rows). BOM weights always use catalog
  kg/m.
- Anchor counterbore position, bracket gusset web shape, T-nut letter
  dimensions read from distributor tables: see each row's `approximated`.

## Not supported (yet)

- Leveling feet / casters, linear bearings and sliders, panel mounting
  hardware, end-tap / access-hole end fasteners.
- Joining plates as an automatic joint type (the parts exist:
  `tslot.part("4151")`).
- 45-degree / non-perpendicular joints; members off a slot line.
- Metric-series brackets other than 40-4336, metric end caps.

## Example

`examples/tslot_showcase.py` builds a 1010 table with corner brackets and
end caps and a 1515 anchor-fastened box, and prints their BOMs.

User docs: `tsjs/apps/documentation/pages/Foundation/Libraries/tslot.mdx`.
Agent skill: `SKILL.md`.

## Tests

```bash
cd py && uv run --frozen --package cadbuildr-tslot python -m pytest packages/cadbuildr/tslot/tests -q
```
